how can chose a fix rectangular in series of images that position may be changeable?
이전 댓글 표시
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
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
Image Analyst
2015년 4월 29일
Then, if the size must remain 30 after the user is done interacting with it, to be robust you must find out the size they made it and then fix one of the corners and adjust the other corners to make sure the size is still 30x30.
Thomas Koelen
2015년 4월 29일
If this is the case, which corner would you use? How do you know where it went wrong? You can fix it by adjust a corner but you could also just force the widths to be 30 by doing this:
imshow('pout.tif')
h=imrect(gca,[0 0 30 30]);
pos=wait(h);
pos(3:4)=30;
would have the same effect but is easier.
Image Analyst
2015년 4월 29일
Yes, exactly. That will fix the upper left. Or you could use menu() to ask the user which corner to fix. Or you could just draw the box yourself with 4 calls to line() (to make sure it's always exactly 30 pixels), and then have two scroll bars on the GUI to let the user translate the box around.
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?
카테고리
도움말 센터 및 File Exchange에서 Image Segmentation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
