7

I've defined contours in skimage following documenation:

contours = measure.find_contours(img, 0.8)

In OpenCV area could be obtained using:

cv2.contourArea(cnt)

Does skimage contains something similar (functionality for contour features)?

MykolaSharhan
  • 396
  • 7
  • 15

1 Answers1

1

I didn't find any similar function in scikit-image, however with some manipulation of the data you can use the function from opencv. You only need to expand the numpy object and convert it to float32 UMat.

# Expand numpy dimensions
c = np.expand_dims(countour.astype(np.float32), 1)
# Convert it to UMat object
c = cv2.UMat(c)
area = cv2.contourArea(c)
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459