I am using skimage to watershed processing since it gives better results. But once finding contours, contour properties are found far more easily with opencv.
I use this to find the contours from skimage watershed:
contours = measure.find_contours(watershed(-distance, markers, mask=th4), 0.8)
to draw contours I use this:
cv2.drawContours(rimg6, [A.astype(np.int32)], -1, (0,255,0), 4)
As skimage gives real numbers and opencv only works with intagers I use this to turn the contours into integers:
A = np.floor(contours[0])
A = A.astype(int)
contour drawing does nothing with [A.astype(np.int32)], and when I use A.astype(np.int32) (without brackets I mean) I get this error:
OpenCV(4.1.2) /io/opencv/modules/imgproc/src/drawing.cpp:2509: error: (-215:Assertion failed) npoints > 0 in function 'drawContours'
What should I do?