MATLAB Answers


How can I fill regions?

Asked by Tomas
on 2 Nov 2012

Hi, I used imfill to fill régions. In some cases imfill fill all the regions as a single region. How can I correct this?

edg = edge(I,'log',0);



1 Answer

Answer by Image Analyst
on 3 Nov 2012

Your edge filter probably had some kind of edge artifact that made a line all the way around the edge of your image. You have to find out why that is and either prevent it or break that line.


Of course. So, where did you upload your image?

It's not clear what a region is, but I can tell that using an edge detector will not get them. You may have to do it manually with imfreehand().

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!