trishume / eyeLike

A webcam based pupil tracking implementation.
MIT License
917 stars 335 forks source link

pupilFilter.h won't run if image is continuous #18

Closed jtressle closed 6 years ago

jtressle commented 6 years ago

If the image is continuous, minVector is never populated because nRows is set to 1. Is setting nRows = 1 necessary?

Thanks, Jan-Michael

`if (I.isContinuous()) { nCols *= nRows; nRows = 1; }

int i, j;
uchar* p;
for (i = 2; i < nRows - 2; i = i + 5)
{
    p = I.ptr<uchar>(i);
    for (j = 2; j < nCols - 2; j = j + 5)
    {

        minVector.push_back(p[j]);
        if ((p[j] + p[j - 2] + p[j + 2]) / 3 < min) {
            min = p[j];
        }
    }
}`