Exact black region detection in black and white image
4 views (last 30 days)
Show older comments
ronny3050
on 11 Apr 2016
Answered: Image Analyst
on 6 Aug 2016

Hello,
Attached is a black and white image, I. I would like to detect the black regions in the image (for instance, the black piano keys). However, regionprops are not helping me because the regions aren't boxes. I would like to detect the exact boundaries of each key.
I appreciate all the help.
-Deb
Edit: I have looked at several demos and examples online such as the Image Segmentation demos by 'Image Analyst', however, I need the exact boundary, and not an approximate box.
0 Comments
Accepted Answer
Walter Roberson
on 11 Apr 2016
The keys are not individual regions. Your only individual black regions the whole upper part, the whole bottom boundary, and a couple of dots that appear to be artifacts.
0 Comments
More Answers (1)
Image Analyst
on 6 Aug 2016
Deb:
The top black line can be detected by scanning every column to find the top, then just turn the next 20 pixels or so white. Then the black regions will be separated.
If it's still a problem, write back.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!