This PR fixes bugs in the masking ancillary step. When cv2.connectedComponentsWithStats is applied, the number of the components could be larger than 65504. Then, the remaining components could have inf value, then the error affects the remaining step.
This PR fixes bugs in the
masking ancillary
step. Whencv2.connectedComponentsWithStats
is applied, the number of the components could be larger than65504
. Then, the remaining components could haveinf
value, then the error affects the remaining step.