0

I have the following image. My task is to examine the shape of worms (enclosed in rectangles) and classify them as dead/alive - the ones that are rod-like (straight) are dead and the curved ones are alive.

enter image description here

I have used adaptive thresholding on the source image, drawn the contours and bounding rectangles using OpenCV 3.1.0 in Python 2.7.1 . What would be the simplest and perhaps an efficient way to achieve the above aim.

(isConvex() certainly doesn't work :p)

Jeru Luke
  • 20,118
  • 13
  • 80
  • 87
singhuist
  • 302
  • 1
  • 6
  • 17

1 Answers1

1

One approach would be to compare the length of the contour (or worm) to the diagonal distance of the bounding box (upper left corner to bottom right corner distance). The straight ones will have a length closer to this distance than the curvy ones will.

brad
  • 930
  • 9
  • 22