필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to select only first picture from a given file using GUI, then use variables from one function in another???

조회 수: 1 (최근 30일)
Hi everyone,
I have a pushbutton in a gui and I want to use the 'uigetdir' function, or something similar, to make it load ONLY the first image from a file. I then want to use the 'roipoly' function on this picture. So is there a way something like Image = uigetdir(roipoly(1)); ???
Also, when I have used this roipoly function I will be left with the points that have been clicked on in the image (xi, yi etc..). If I save these values as xMin = min(xi) and yMin - min(yi) etc then how can I use these variables in another function?
So how can I get another pushbutton to the call these values to be used in that part of the code?
Many thanks for all your help,
Ellis

답변 (1개)

Walter Roberson
Walter Roberson 2016년 5월 25일
[filename, pathname] = uigetdir('Select an image');
thisfile = fullfile(pathname, filename);
myimage = imread(thisfile);
roi = roipoly(myimage);

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by