how to plotting the selected images

조회 수: 1 (최근 30일)
Ahmed
Ahmed 2011년 9월 7일
hai.
i have question on how to plotting the selected images from folder into axes when push button has been click. And how to update the selected image in axes1 into second push button(analysis operation in second push button) ?

채택된 답변

Walter Roberson
Walter Roberson 2011년 9월 7일
imread() each selected image. image() the image, specifying the axes handle as the first parameter of the image() call to be sure that it is drawn in to the proper axes. If you want the images to show up beside each other, use the x and y parameters of the image call to specify the data coordinates of the centers of the lower-left and upper-right pixels.
I am unclear about what you are asking in your second question, but I suspect that the answer is "You can set() the selected image as a property of the second push button [e.g., UserData] and have the button's callback check that property to determine what it is working on; or you can have the second button's callback check the status of the original object to determine what is selected and then act appropriately."

추가 답변 (1개)

Ahmed
Ahmed 2011년 9월 7일
uigetfile({'*.jpg;*.tif;*.png;*.gif','All Image Files';... '*.*','All Files' },'mytitle',... 'C:\Work\myfile.jpg') %select image from folder
image = imread('uigetfile'); % Load a test image
axes(handles.axes1)
hAxes = gca; % Get a handle to the current
axes imshow(image);
pause(1);
i try to do this,which i want the selected image will display at axes1.
  댓글 수: 3
Ahmed
Ahmed 2011년 9월 8일
still can't display the selected image at axes..
or maybe need putting something update command at 'function axes1_CreateFcn(hObject, eventdata, handles) '
Walter Roberson
Walter Roberson 2011년 9월 8일
Sorry, should have been fullfile() instead of fullfilename()
You appear to be using an existing axes. Are your axis limit modes set to manual or to automatic (default is automatic)?
I never use the CreateFcn; never found a use for it.

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

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by