fabiocarrara / meye

A deep-learning-based web tool for translational and real-time pupillometry
https://www.pupillometry.it
GNU General Public License v3.0
40 stars 10 forks source link

roiPos error #34

Closed lachioma closed 2 years ago

lachioma commented 2 years ago

In the Matlab version of Meye, I tried to replicate Example 3 from example.m but on an image of mine. When using ROI = [330,70,130,100]; I get the following error:

Unable to perform assignment because the size of the left side is 130-by-100 and the size of the right
side is 100-by-130.

Error in Meye/predictImage (line 79)
                pupilMask(roiPos(2):roiPos(2)+roiPos(3)-1,...

I think that lines 79 and 80 of Meye.m contain an error with the indices of roiPos and should be changed to:

pupilMask(roiPos(2):roiPos(2)+roiPos(4)-1,...
      roiPos(1):roiPos(1)+roiPos(3)-1) = imresize(rawMask, [roiPos(4), roiPos(3)],"bilinear");

Now it runs but I think there is still something wrong.

fabiocarrara commented 2 years ago

thanks for bringing this up. @LeonardoLupori can you check this?

LeonardoLupori commented 2 years ago

Hi @lachioma !

Thanks a lot for pointing this out.

As you already saw, I got the order of width and height wrong in 2 places: both where you pointed and when creating the crop.

I already created a pull request that should solve the issue. You should get an update as soon as it is merged. Let us know whether it also works for you!

All the best, Leo

fabiocarrara commented 2 years ago

35 merged, thanks @LeonardoLupori .

@lachioma feel free to close if this solves your problem.

lachioma commented 2 years ago

Thank you!