Ask Your Question

Revision history [back]

SimpleBlobDetector and zero moment

Hi,

I use SimpleBlobDetector and I have got an exception when there is a line in Mat img at row 0 or img.rows-1 or column 0 or img.cols-1. An example of such image is here

In one of previous case all moments m00, m10, .... are equal to 0. When SimpleBlobDetector is used at line 270 it is written

center.location = Point2d(moms.m10 / moms.m00, moms.m01 / moms.m00);

There is no check about m00. Is it right?

Thanks for your answer

SimpleBlobDetector and zero moment

Hi,

I use SimpleBlobDetector and I have got an exception when there is a line in Mat img at row 0 or img.rows-1 or column 0 or img.cols-1. An example of such image is here

In one of previous case all moments m00, m10, .... are equal to 0. When SimpleBlobDetector is used at line 270 it is written

center.location = Point2d(moms.m10 / moms.m00, moms.m01 / moms.m00);

There is no check about m00. m00 here. There is check at line 290 but it's too late Is it right?

Thanks for your answer