Ask Your Question
2

How do I detect the centerline of an object

asked 2014-04-17 09:16:12 -0600

Guyygarty gravatar image

Hi,

I am writing a program for analyzing chromosome aberrations. I typically get chromosome images that look more or less like a bunch of scattered bananas:

chromosome image

I have figured out how to get the outline and the (rotated) bounding boxes. What I would really like is to be able to get the centerline. By centerline I mean a line going through the geometric center of the binarized object (as shown below), not necessarily through the brightest pixels, which may be on the sides rather than the center.

image description

Any tips on how to code this would be appreciated.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
7

answered 2014-04-17 11:38:50 -0600

Haris gravatar image

updated 2014-04-17 22:39:45 -0600

All you have to do is,

  1. Find contour.
  2. Draw each contour with thickness=CV_FILLED.

  3. Now for each contour apply thinning algorithm as explained here.

See the result I got for the above sample image.

image description

edit flag offensive delete link more

Comments

Thanks! I'll try that. guy

Guyygarty gravatar imageGuyygarty ( 2014-04-18 07:46:48 -0600 )edit

Question Tools

Stats

Asked: 2014-04-17 09:16:12 -0600

Seen: 10,446 times

Last updated: Apr 17 '14