Select a specific area of an RGB image

1 次查看(过去 30 天)
Hi everybody,
i have an RGB image and i want to select (not cut) a specific area with the following dimensions: [Xmin Ymin width length].
How can i do it?
Thank you so much!
  1 个评论
KALYAN ACHARJYA
KALYAN ACHARJYA 2019-3-1
编辑:KALYAN ACHARJYA 2019-3-1
Define four spatial co-ordinates.
Please elaborate, is there any issue?
or
RGB=insertShape(I,'rectangle',[Position],'LineWidth',xx);

请先登录,再进行评论。

回答(1 个)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019-3-1
编辑:KALYAN ACHARJYA 2019-3-1
Are you looking for this one?
im=imread('test.jpg');
%[Xmin Ymin width length].
%Values are for example purpose only
Xmin=24;
Ymin=25;
length=20;
width=20;
%%
result=insertShape(im,'rectangle',[Xmin Ymin Xmin+length Ymin+width],'LineWidth',2);
imshow(result);

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by