Filter löschen
Filter löschen

How do I find the coordinates of the bounding box of an image

25 Ansichten (letzte 30 Tage)
Prabs
Prabs am 30 Okt. 2013
Kommentiert: Image Analyst am 25 Feb. 2020
I have got a BoundingBox on a binary image through regionprops. Want to find the co-oridnates of that Bounding-Box and possibly the vertical and horizontal limits of them.
Thanks in advance

Antworten (4)

Image Analyst
Image Analyst am 30 Okt. 2013
regionprops() gives you the bounding box, like you said, so I don't quite know what you're asking.
See my Image Segmentation tutorial: http://www.mathworks.com/matlabcentral/fileexchange/25157-image-segmentation-tutorial-blobsdemo. I find the bounding boxes of the coins and crop out the sub-image.
  6 Kommentare
Jia Zhen
Jia Zhen am 20 Apr. 2015
Hi, whaat is the function to give the regionprops data? I could not find the BoundingBox data and i did not know how to access to it.
Image Analyst
Image Analyst am 20 Apr. 2015
regionprops() is the function that give regionprops data. Just use it with your labeled image.
measurements = regionprops(labeledImage, 'BoundingBox');
Did you see my initial answer? It links you to a website with my tutorial that shows you step-by-step in incredibly well commented and instructive code exactly how to use it.

Melden Sie sich an, um zu kommentieren.


NURUL AMIRA MHD RIZAL
NURUL AMIRA MHD RIZAL am 9 Mai 2018
Does the bounding box can be set into the specific parts of an image? Example, i want it to be placed at human arm, knee and so on. How can I set it that way?
  1 Kommentar
Image Analyst
Image Analyst am 9 Mai 2018
Yes it can. Just feed the coordinates into rectangle() and you can put it wherever you want.

Melden Sie sich an, um zu kommentieren.


Amir Barkhordary
Amir Barkhordary am 13 Jul. 2018
I am trying to create a rectangular bounding box of coordinates (latitude and longitude) to find out about the SST in Great Barrier Reef. For example the coordinates of Lizard Island in Queensland are: -14.667997328 145.455664844. In order to create a SST file using seaDAS Program I would would at least to have more coordinates (such left right top bottom) for this region but I do not know how create such a box containing the region's geographical characteristics in Matlab. I would appreciate any help :)

Riccardo Panza
Riccardo Panza am 26 Feb. 2019
doesn't work
  3 Kommentare
Matpar
Matpar am 25 Feb. 2020
Hi Image Analyst, I am trying to do the same process but I would like to display all the rectangles of the regions for the output! can you guide me please?
What I am trying to achieve is via the image
I reached here
blobMeasurements = regionprops(logical(BW), 'BoundingBox');
numberOfBlobs = size(blobMeasurements, 1);
Image Analyst
Image Analyst am 25 Feb. 2020
Matpar, try this untested code:
hold on;
for k = 1 : numberOfBlobs % For every blob...
% Get the bounding box of this one blob.
thisBB = blobMeasurements(k).BoundingBox;
% Display it over the image.
rectangle('Position', thisBB, 'LineWidth', 2)
end

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Geographic Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by