machinevision-toolbox-python icon indicating copy to clipboard operation
machinevision-toolbox-python copied to clipboard

Properly fix moments for OpenCV single-pixel / single-line segments

Open Tobias-Fischer opened this issue 1 year ago • 0 comments

At the moment, there is an issue where self.data and contours do not have the same number of list elements, leading to a crash: https://github.com/petercorke/machinevision-toolbox-python/blob/dd408f2b5a9f3dc3adc7d1501470025211ad0813/machinevisiontoolbox/ImageBlobs.py#L256-L260

We previously tried to address this in #5, but this was an incomplete fix. Here, we go through the TODO and properly set all the moments where OpenCV returns nonsense.

Tobias-Fischer avatar Oct 23 '24 06:10 Tobias-Fischer