how separate overlapping objects?

1 view (last 30 days)
Rob
Rob on 22 Oct 2012
Answered: Vidhi Agarwal on 12 Jun 2025
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.
  1 Comment
Rob
Rob on 22 Oct 2012
sorry, I said same colour but in fact they have different shades of blue but small variation.

Sign in to comment.

Answers (1)

Vidhi Agarwal
Vidhi Agarwal on 12 Jun 2025
Hi @Rob,
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!

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!