how separate overlapping objects?
Show older comments
Hello, I have an image with two overlapping squared objects of the same size and colour. They are on a uniform backround and one object exceeds the other from the left with with a 10 degrees tilt. I need to extract the object on the top. How can I proceed?. Thanking you in advance for your help.
Answers (1)
Vidhi Agarwal
on 12 Jun 2025
0 votes
I understand you are trying to extract the top overlapping object in an image with two similar blue squares (small color variation, ~10° tilt, and on a uniform background). Below are the rough steps that can help you in getting started:
- Read the image in MATLAB.
- Convert it to greyscale or HSV: Since the color difference is small but consistent, using hue or intensity helps.
- Segment the Top Object by Thresholding: Use adaptive or manual thresholding on hue or intensity.
- Clean and Rotate-Aware Processing: Use morphological operations to isolate connected tilted regions.
- Find Tilted Top Region Using Region Properties: Use "regionprops" to get orientation and bounding box.
- Extract the Object from Original Image.
For better understanding of "regionprops" refer to: https://www.mathworks.com/help/images/ref/regionprops.html
Hope this helps!
Categories
Find more on Image Arithmetic 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!