Find Area of Intersecting rectangles

1 vue (au cours des 30 derniers jours)
vivek
vivek le 23 Fév 2015
Commenté : Joseph Cheng le 23 Fév 2015
What would be the easiest and most efficient way to compute the intersecting area of vertical and horizontal intersecting rectangles.I have attached a image to explain the issue. Horizontal rectangles are in red Vertical rewctangles are in green Overlap area is marked in violet. Just to mention the horizontal and vertical rectangles can be of different size
  1 commentaire
Image Analyst
Image Analyst le 23 Fév 2015
Exactly what data are you starting with? An RGB image just like this? Or a list of row and column numbers that define where the stripes are?

Connectez-vous pour commenter.

Réponses (1)

Joseph Cheng
Joseph Cheng le 23 Fév 2015
This sounds like a simple math problem. Since you know the width of the vertical (lets call it widthV) and the width of the horizontal (widthH) then one of the intersection's area would be widthV*widthH. then if you know the number of vertical and horizontal rectangles (numV and numH) then the total number of intersections is numV*numH. so the total "purple" or intersection area is numV*numH*(widthV*widthH);
  3 commentaires
vivek
vivek le 23 Fév 2015
Just to mention the horizontal and vertical rectangles can be of different size.So finding area of intersection of one and multiplying by number of intersections will not work
Joseph Cheng
Joseph Cheng le 23 Fév 2015
How are the rectangles generated? are you reading in an image file, are you generating them? if it is an image then read in the first line and first column. Put a threshold (in either color or amplitude) and find X pixels above threshold in the vertical and Y pixels above threshold in the horizontal. then the total intersection is X*Y.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by