tknapen / nsd_access

python package to access the data of the NSD (natural scenes dataset) fMRI project
MIT License
40 stars 16 forks source link

Fix annotations reference frame #1

Open tknapen opened 5 years ago

tknapen commented 5 years ago

For the experiment, COCO images were cropped to be square. This means that the spatial parameters returned by the COCO interface are off, and need to be re-mapped to correct for the cropping.

iancharest commented 4 years ago

just leaving some notes here with regards to our potential solution:

from the cropbox we can get to x or y translation factors

from the original picture dimensions we can get the x and y scaling factors

then, the rest is just a vector matrix dot product of the xy coordinates of the annotation segmentation points with an affine transform matrix

[cx 0 tx 0 cy ty 0 0 1]

cx being scaling in x, cy scaling in y, tx translation in x and ty translation in y

then we check for out of bound annotation points and filter these classes out (for the class labels)