Ask Your Question
0

Image segmentation, where to start?

asked 2020-06-25 10:27:17 -0600

Nano1 gravatar image

updated 2020-06-26 07:53:01 -0600

Hi There,

Quite new to image processing and OpenCV, I have for a task to segment an image as attached. The initial quality of the image cannot be improved.

image description

The goal is to be able to segment each cell on that picture independently. The cell amount, size and arrangement may change so there is no way of applying some kind of static mask.

So far I've tried a few approach, one being Canny + Edge detection but this yields poor results.

As can be seen, the cells themselves are not homogeneous, although, the background is quite homogeneous. Is there some ways to segment that picture, perhaps using the background to be able to define lines ?

Thanks and cheers.

EDIT:

So far I've been able to produce this, which I guess is a good step.

Process was Filter2D, Adaptive Threshold, morphology & HoughLineP (in red).

image description

However, I'm stuck into defining triangles, my guess would be to make some algorithm to define lines angles and then finding crossing points, although it's relatively complex. Would be some OpenCV functionality make the task easier ?

edit retag flag offensive close merge delete

Comments

would you share the code you tried so far. take a look at https://answers.opencv.org/question/8...

sturkmen gravatar imagesturkmen ( 2020-06-25 13:22:48 -0600 )edit

"However, I'm stuck into defining triangles" Instead of searching for intersections perhaps you could also rotate the image with an averaged angle and assume constant spacings?

Visionmop gravatar imageVisionmop ( 2020-06-26 10:14:01 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-06-25 11:56:35 -0600

dbots94 gravatar image

First threshold the image. Then find the contours (just the the outside one) and fit a rotated rectangle to it. Then with that rectangle, rotate and crop the cells region. After that, having just the cells region, try the canny edge detector, or threshold+findContours. You can also look into HoughLines and see if it helps. Good luck

edit flag offensive delete link more

Comments

I've updated the post.

Nano1 gravatar imageNano1 ( 2020-06-26 07:53:14 -0600 )edit

To ease your tasks, you should rotate the image before trying to segment it into rectangles... From what you have, My guess would be to try to enlarge the lines (erosion), so that in a findContour you find contours for each rectangle.

dbots94 gravatar imagedbots94 ( 2020-06-29 08:14:39 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-06-25 10:27:17 -0600

Seen: 357 times

Last updated: Jun 26 '20