Ask Your Question

Identifying marine mammals edges and length

asked 2017-09-12 17:56:12 -0500

I'm beginning to look into photogrammetry of marine mammals, basically measuring length and width, identifying health, body condition, etc. And as a first step I'm looking to do some basic edge detection to create a simple outline of an animal and then measure it from tail to nose. Typically this is done manually in programs like ImageJ and my plan is to do this automatically in python with OpenCV and I'm curious for recommended tools within OpenCV. I've gone through a good bit of the OpenCV tutorials, played around with some Canny edge detection (see image below) and tried to get a lay of the land but I'm curious if there are suggestions for tools, algorithms, and techniques for the two steps listed below:

  1. Get a continuous outline of an animal in the water
  2. Measure from the center of the tail to the center of the nose to get pixel distance

    image description

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-09-12 19:53:34 -0500

Tetragramm gravatar image

I have suggestions for number 2. Number 1 is hard without being able to play with images, but you might want to try smoothing the image first. It looks very noisy.

For Number 2, I have two possibilities. The first is to take the moments of the points, which gives you the three values of the covariance matrix, and the center. You can use that to find the long axis of the covariance ellipse, and from the center that should intersect the nose and tail. If you only get a contour around 3/4 the body, say, then the center might be off.

Second is very similar, but use the function minAreaRect, to get a rotated rectangle. This gives you the long axis, and you can find the center easily. If you don't clean up the area outside the outline it could mess this up though.

Perhaps averaging the results from these two is best, but you'll have to experiment.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-09-12 17:56:12 -0500

Seen: 166 times

Last updated: Sep 12 '17