Azzera filtri
Azzera filtri

How can I mark the central point in annotate box

3 visualizzazioni (ultimi 30 giorni)
Currently, I'm working on a vehicle detection project. I want to know how can I mark central point in annotate frame.
  2 Commenti
dpb
dpb il 29 Ott 2023
Show us a snippet of code that creates what you mean by "annotate frame"; the annotation function has no type of 'frame' so we don't have any way to know what you're talking about...
Thinal Sumanaratne
Thinal Sumanaratne il 29 Ott 2023
I want to create something like this green dot.

Accedi per commentare.

Risposte (3)

Sulaymon Eshkabilov
Sulaymon Eshkabilov il 29 Ott 2023
If you're plotting the results, then you can put the text or symbol, arrow, etc at specific coordinate points using annotation.

dpb
dpb il 29 Ott 2023
I=imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1524096/image.png');
imshow(I)
figure
colormap gray
B=imagesc(I(:,:,1)>=175 & I(:,:,2)<75,[0 1]);
seems able to find the bounding boxes; one would presume, however, you would already have those from somewhere else, of is that part of the problem? What you're not providing is anything that is specific to your actual problem; yes, we can see the image but we don't know other than that it is a link how you got to this point with it -- there are tools in the Image Processing TB (that I don't have and don't really have a klew about image processing, the above was just a crude way to locate the red line in the image on the assumption it was almost pure red and so the first plane would be pretty big number and the others pretty small; this is pretty easy in the given image as there aren't other reds/pinks in the image to confuse matters).
The Q? is how were those bounding boxes drawn and do you not have the identification of them from the TB? If not, then locating them starting with something like the above is probably the way, but I simply don't know enough about actually using it to do so quickly. @Image Analyst has prepared a lot of tutorials in the area; search for answers or the File Exchange for his postings and you'll learn a lot...

Walter Roberson
Walter Roberson il 29 Ott 2023
Suppose you have BB, an N x 4 array of bounding boxes of the form [x y width height] . These might have come from regionprops('BoundingBox') or they might have come from some kind of object detector.
Then
centers = BB(:,1:2) + BB(:,3:4)/2;
pointsize = 6;
scatter(centers(:,1), centers(:,2), pointsize, 'g')

Community Treasure Hunt

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

Start Hunting!

Translated by