how can chose a fix rectangular in series of images that position may be changeable?

1 次查看(过去 30 天)
I have to extract the rectangle for a seris of images that the size of rectangular is 30*30 but the position of rectangular is changeable in every images. Is there any way? I know that I can use imcrop and getrect. but these command need xmin,ymin position. I just need to fix xwith and ywitd. Is there any way?

回答(2 个)

Thomas Koelen
Thomas Koelen 2015-4-29
imshow('pout.tif')
h=imrect(gca,[0 0 30 30]);
wait(h)
Gives you a draggable rectangle with xwidth and ywidth of 30.
  5 个评论
sara
sara 2015-4-29
编辑:sara 2015-4-29
thanks Thomas Koelen and Image Analyst...but how can cut this segment that the coordinate preserved? can I use imcrop after this?
Image Analyst
Image Analyst 2015-4-29
Cut? What does that mean? And do you need to have the width be 30 after the user is done with it, or will you take whatever he made it?

请先登录,再进行评论。


sara
sara 2015-4-29
dear Image Analyst
I need to have the width be 30 after the user is done with it. you have a demo in this link http://www.mathworks.com/matlabcentral/answers/86477-how-to-isolate-certain-part-of-image at the of this page I find a code that when I run it, the result is like below:
I want to have a fix size square (30*30) that user can change the coordinate and has a result like below...i mean crop image with original coordinate. I hope that I could explain my opinion.

类别

Help CenterFile Exchange 中查找有关 Display and Exploration 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by