shape detection and classification without regionprop command
Show older comments
1. A binary (black and white) image with all the shapes in white and background in black. In addition, a number, indicating the classification according to the above numbered descriptors, must be inserted in the center of each shape. A value of zero (0) should be placed in the center of the shape that does not fall into one of the above classifications.
A color image with each shape displayed in a pre-assigned color i.e. instead of inserting a number into each shape they can be displayed in different colors e.g. blue for all circles and yellow for all hexagons. The color black must be assigned to all unclassified shapes. The background of this image must be white.
A binary (black and white) image with all the shapes in white and background in black. In addition, a number, indicating the area (in m2 and 3 decimal places), must be inserted in the center of each shape in the image. A text value of "N/A" should be placed in the center of the shape that does not fall into one of the above classifications. Assume each pixel represents a distance of 1 mm.
In my attached files you would find my progress on each part of the question. I have done most of it, i just need your help to see where i am wrong.
9 Comments
It's not urgent. You should have started your homework earlier.
As I doubt many people will be willing to spend the time to download your code, figure out how to run it, and then figure out what it's supposed to do, why don't you tell us what is not working and what is expected and show just the relevant portion of code?
jason
on 11 Nov 2014
Guillaume
on 11 Nov 2014
You need to make it as easy as possible for people to help you.
The first sentence of your question ( A binary (black and white)...) does not even have a verb. If you make it hard to understand your question, people won't bother.
Similarly, you give us a bunch of code (three files which at first glance look exactly the same) and ask us to figure out what's wrong with it. Rather than letting us guess, you need to be more precise and tell us what you expect (the final image is displayed with numbers in it) and what actually happens (the final image is displayed correctly but there's no number in it).
Furthermore, If I try to run your first file I get an error " img_wk_bw not defined ". Again you're making hard to help you by providing code with typos.
After spending much longer than I wanted looking at your code, it seems to me that your problem is that you've displayed your numbers on the figure for each shape, but you haven't done so on the final figure. I'm not sure why you then expect the numbers to be there.
jason
on 11 Nov 2014
jason
on 11 Nov 2014
jason
on 11 Nov 2014
jason
on 12 Nov 2014
jason
on 12 Nov 2014
Image Analyst
on 19 Mar 2017
Attach YOUR code. I'm attaching my shape detection demos.
Accepted Answer
Categories
Find more on ROI-Based Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
