machinevision-toolbox-python
machinevision-toolbox-python copied to clipboard
Properly fix moments for OpenCV single-pixel / single-line segments
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.