CAN I DIRECTLY BROWSE THE THE IMAGE TO GUI USING IMREAD AND IMSHOW FUNCTION ONLY

조회 수: 1 (최근 30일)
IMAGE=IMREAD(IMAGENAME); IMSHOW(IMG);

채택된 답변

Walter Roberson
Walter Roberson 2016년 9월 16일
What do you mean by "browse" ?
In the code
IMAGE = imread(IMAGENAME);
imshow(IMAGE)
it is permitted for IMAGENAME to be a string which is the exact name of an image file, or to be the name of an image file which is somewhere on your MATLAB path. It is also permitted for IMAGENAME to be in the form of an http url.
However, if you do not already know the name or url of the desired image file, then you will need to use additional functions to locate it. imread() does not have any method to permit users to browse directories to select an image.
  댓글 수: 2
aditya kumar sahu
aditya kumar sahu 2016년 9월 17일
Thank u @walter-roberson...Browse in the the sense drag and drop to gui..
Walter Roberson
Walter Roberson 2016년 9월 17일
No, you need additional functions to be able to drag and drop files from outside MATLAB into MATLAB. See https://www.mathworks.com/matlabcentral/answers/24123-drag-and-drop-file-to-figure
If you already have the images represented as graphics objects within the GUI, such as if you had icons for each of the images, then see http://www.mathworks.com/matlabcentral/answers/94681-how-do-i-implement-drag-and-drop-functionality-in-matlab

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by