필터 지우기
필터 지우기

HOw to draw boundingBox/rectangle transperent over an image

조회 수: 47 (최근 30일)
Lora
Lora 2014년 10월 10일
댓글: Image Analyst 2019년 7월 13일
i i have four coordinates which correspond to (x,y,width,height) . I can draw a rectangle over an image from this script but it is a filled rectangle with redcolor i want a a bounding box or a transparent rectangle.It might be very trivial but i am not a regular coder.
I=imread('000027.jpg');
figure,imshow(I)
hold on
rectangle('Position',[203, 147, 218, 162],'FaceColor','r')
Thanks guys

채택된 답변

Image Analyst
Image Analyst 2014년 10월 10일
Change FaceColor to EdgeColor:
rgbImage=imread('peppers.png');
imshow(rgbImage)
hold on
rectangle('Position', [203, 147, 218, 162],...
'EdgeColor','r', 'LineWidth', 3)
  댓글 수: 3
Biswas Lohani V K
Biswas Lohani V K 2016년 2월 18일
how can I write name on the top of this rectangular?
Image Analyst
Image Analyst 2016년 2월 18일
Use the text() function
text(x, y, 'This is my rectangle', 'FontSize', 20);

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

추가 답변 (1개)

mohd abdul wahed faisal faisal
mohd abdul wahed faisal faisal 2019년 7월 13일
bro instead of rectangle i want the particular area(irregular shape)

Community Treasure Hunt

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

Start Hunting!

Translated by