How to divide a shape into 4 areas, using the diagonals of its bounding box?
3 views (last 30 days)
Show older comments
Hi, I have a big blob with a small blob within it and I am trying to detect in which area of the big one the small one (its centroid) lies. By comparing the coordinates of the centroid of the small blob against coordinates of the centroid of the big blob, I did detect where it lies within the 4 "quadrants" you get when you divide the big blob with a cross-section (top right, top left, bottom right, bottom left), see black lines in image.
I would like to divide the big blob in a different way, similar to the one above but rotated by 45 degrees. I would like to get the 4 sections separated by the red lines (forming an X) in the image, numbered '1','2','3','4'. I thought of getting the bounding box of the big blob and then the diagonals of the box.
BigBlobBox = regionprops(BigBlob, 'BoundingBox' );
How would I get the areas of the big blob within each of the 4 areas created by the intersection of the diagonals? Any ideas/suggestions would be very appreciated. Thanks!
0 Comments
Answers (1)
Image Analyst
on 19 Sep 2016
Why not just get the centroid of the small one? Why do all this stuff about dividing the big one up in to slanted quadrants and messing with bounding boxes and all that??? If you want to know there the small one is, just get its centroid or a list of all the pixel coordinates it occupies. Perhaps if you showed the original gray scale image it might be more clear.
Why do you want to know where the small one is anyway? For example, maybe you really need to know the average radial profile of the small blob but came up with this quadrant/bounding box scheme thinking you had to do it that way, but if you just let us know what you really need to know, we'd come up with a better approach.
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!