Hello. Im using a user defined rectangle to define a ROI on a tiff image.
p=[760,1660,500,500]
h = imrect(handles.axes1, p)
p = wait(h);
p = h.getPosition();
assignin('base','p',round(p))
addNewPositionCallback(h,@(p)assignin('base','p',p));
I am using guide, and want the ability to enter the values in "p" from a text box. Can I just create the string and assign it to "p"?
thanks Jason

 채택된 답변

Image Analyst
Image Analyst 2014년 2월 13일

0 개 추천

Sure, no problem.
str = get(handles.editX1, 'string');
leftColumn = str2double(str);
str = get(handles.editWidth, 'string');
width = str2double(str);
str = get(handles.editY1, 'string');
topRow = str2double(str);
str = get(handles.editHeight, 'string');
height = str2double(str);
p = [leftColumn, topRow, width, height];

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Display Image에 대해 자세히 알아보기

태그

질문:

2014년 2월 13일

답변:

2014년 2월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by