Odd Outcome From imerode and bwlabel
1 view (last 30 days)
Show older comments
Hello,
I am trying to program a shape placement algorithm using image processing in Matlab.
The algorithm should place images of shapes on a larger background image in a way that minimizes the wasted background. I am using imerode to erode the current background image with the bounding box of the shape to be placed as the structuring element. Thus, imerode should return an image with 1's everywhere where the origin of the structuring element can be placed so that it is entirely contained within the background image. Imerode does this correctly. However, when I use bwlabel on the image returned from erosion for further processing, an image of the structuring element appears in the bottom left corner. I don't understand why this is happening. I'm sure it would help to see the images that I am refering to but I don't think pictures can be attached to this question. Can anyone explain please? Any help would be greatly appreciated. Thank you.
2 Comments
Sean de Wolski
on 17 Oct 2011
Use a free image hosting website and give us the link. Also, post the code and use formatting so we can see what MATLAB is _actually_ doing.
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
Answers (2)
See Also
Categories
Find more on Display and Exploration 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!