Filter löschen
Filter löschen

I have a canal image and need to detect only edge portion? So how do I separate foreground from background?

2 Ansichten (letzte 30 Tage)
How do I separate foreground from the background?

Antworten (1)

Image Analyst
Image Analyst am 25 Nov. 2017
You can use imfreehand(). See attached demo.
The water is very cluttered with reflections in some parts. Like the tree - it could just as well be a tree hanging over the canal as a reflection of a tree above the canal.
There is no "canal water" segmentation algorithm in MATLAB so you'll have to write your own algorithm from lower level routines. Like maybe you can assume the water is fairly smooth and can then just use stdfilt(). Then threshold and get rid of blob touching the top of the image because that would be sky, assuming you don't have any images where the canal goes all the way to the top of the image.
To work for all possible canal images, this is very tough. It could well be your Masters or Ph.D. project (in which case you'll have to invent the algorithm yourself instead of having us hand you one). Hopefully it IS your whole project and not just part of your main project, or else you'd have to hope your images are really simple so a simple algorithm can segment out the water.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by