필터 지우기
필터 지우기

How can I mark the central point in annotate box

조회 수: 3 (최근 30일)
Thinal Sumanaratne
Thinal Sumanaratne 2023년 10월 29일
답변: Walter Roberson 2023년 10월 29일
Currently, I'm working on a vehicle detection project. I want to know how can I mark central point in annotate frame.
  댓글 수: 2
dpb
dpb 2023년 10월 29일
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 2023년 10월 29일
I want to create something like this green dot.

댓글을 달려면 로그인하십시오.

답변 (3개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 10월 29일
If you're plotting the results, then you can put the text or symbol, arrow, etc at specific coordinate points using annotation.
  댓글 수: 1
Thinal Sumanaratne
Thinal Sumanaratne 2023년 10월 29일
Year
I want to know how to do it. like code or reference to follow

댓글을 달려면 로그인하십시오.


dpb
dpb 2023년 10월 29일
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 2023년 10월 29일
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')

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by