Ask Your Question
0

How to get areas of objects after watershed segmentation?

asked 2019-08-12 01:52:06 -0600

savailonei gravatar image

updated 2019-08-12 03:24:19 -0600

I have a result of watershed algorithm as follows: watershed.png

How would I find all the separate areas of blobs I have in this result?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-08-20 08:47:54 -0600

updated 2019-08-20 08:48:25 -0600

Have a look at the coin segmentation example using watershed. If you calculate the distance transforms, than threshold it strictly and then look for separate blobs you have what you need..

edit flag offensive delete link more

Comments

Thank you for your answer. I need to filter the blobs based on areas resulting from watershed. How would I get those areas?

savailonei gravatar imagesavailonei ( 2019-08-21 02:49:55 -0600 )edit

You are retrieving the watershed regions as markers. These are basically points that have a specific ID. You can add all the points to a vector<Point>, then call convexHull which will return a contour and on top of that you can apply the function contourArea which can then be used to sort or filter your regions.

StevenPuttemans gravatar imageStevenPuttemans ( 2019-08-21 04:30:43 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-08-12 01:52:06 -0600

Seen: 355 times

Last updated: Aug 12 '19