필터 지우기
필터 지우기

How to mask numbering inside rectangular ROI

조회 수: 2 (최근 30일)
Levente Gellért
Levente Gellért 2023년 3월 9일
댓글: Image Analyst 2023년 3월 14일
Dear MAtlab Community, while reading some matlab release notes, I have found the attached image.
Could someone explain to me what is the easy way to achive some image like that (actually I want to have numbering in rectangular ROIs)
Thanks for sharing your ideas!
BEst
lg

답변 (3개)

Cameron
Cameron 2023년 3월 9일
This shows the value as a label instead of in the middle.
imshow(imread('peacock.jpg'))
prompt = {'Enter ROI label:'};
dlgtitle = 'Input';
dims = [1 45];
definput = {''};
answer = ' ';
while ~isempty(answer)
answer = inputdlg(prompt,dlgtitle,dims,definput);
if ~isempty(answer)
r1 = drawrectangle('Label',string(answer));
end
end

Image Analyst
Image Analyst 2023년 3월 10일
I don't know what you mean by "archive". Maybe try imwrite or exportgraphics.
If you want to display circles without a label, then call viscircles.
  댓글 수: 2
Levente Gellért
Levente Gellért 2023년 3월 10일
Dear Image Analyst, sorry, I do not understand your reply. Maybe you misuderstood my word achieve?
Best
lg
Image Analyst
Image Analyst 2023년 3월 10일
@Levente Gellért Oh right. You had "achive" (not a word because of the missing letter) and I thought it meant "archive" while you meant "achieve".
It looks like your image used drawellipse. Please see my attached drawing demos. You can adapt one of them to get your image with the circle and handles (for resizing it) on it:
It's a generic, general purpose demo of how to threshold an image to find blobs, and then measure things about the blobs, and extract certain blobs based on their areas or diameters.

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


Levente Gellért
Levente Gellért 2023년 3월 14일
Dear Commenters, In the meantime I have found the most easy solution, hence, the 'text' function. That is what I needed. Thanks for your ideas!
lg
  댓글 수: 1
Image Analyst
Image Analyst 2023년 3월 14일
It would have been easier for us to answer had you said that you just wanted the text instead of a circle with handles to adjust the size of the circle. But anyway, glad that you found text works for you. If you have the Computer Vision Toolbox you can also use insertText which will burn the text into the image pixels, instead of text which puts text into the graphical overlay above the image.

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

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by