how to find holes in objects in matlab image?
-
is it possible to find holes in connected components, i.e in objects in an image. if so, can we also count holes? Like, I have used cc = bwlabel(image); to do connected components labeling. Now, how to find number of holes in each object ?
-
Answer:
You could use the Euler characteristic. From the Matlab documentation: The bweuler function returns the Euler number for a binary image. The Euler number is a measure of the topology of an image. It is defined as the total number of objects in the image minus the number of holes in those objects. You can use either 4- or 8-connected neighborhoods. But be aware that a single pixel "hole" can change the Euler characteristic. You might want to use some opening/closing to smooth object outlines before using bweuler.
Ayesha Khan at Stack Overflow Visit the source
Other answers
A hole is the presence of nothing, so you can just invert the image and then count connected components.
thiton
Related Q & A:
- How to implement different clickable Area on an image-page through image map?Best solution by Stack Overflow
- How to find the derivative without using a symbolic function in Matlab?Best solution by Stack Overflow
- how to Create a Java Package from MATLAB Code?Best solution by Stack Overflow
- How can I remove duplicate Objects from array of Objects in javascript?Best solution by Stack Overflow
- How to extract a specific text from an image?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.