필터 지우기
필터 지우기

Creating a dialog box menu for the imread function.

조회 수: 1 (최근 30일)
Edvardas
Edvardas 2013년 4월 16일
Hello,
Currently I am finishing an image analyzing script the reads graphs from a .jpg image file. One of the things I did is make it viable to use for various sizes of image files for different graphs, however I am stuck on implementing a menu through which I could choose an image file which then would be read via the imread function, and then the data would be used throughout the script.
Ideally what I'm thinking of is something of the form of this (I realize that this particular option can only be run when using Load function, I think, I just put it as an example of what I'm aiming towards), tp is the matrix for the image file:
if menu == 1
tp=imread('temp468.jpg');
elseif menu == 2
tp=imread('temp480.jpg');
elseif menu == 3
tp=imread('temp502.jpg');
elseif menu == 4
tp=imread('temp590.jpg');
elseif menu == 5
tp=imread('temp597.jpg');
elseif menu == 6
tp=imread('temp711.jpg');
elseif menu == 7
tp=imread('temp730.jpg');
elseif menu == 8
tp = imread('temp850.jpg');
end
menu = menu('title', 'Tile 468', 'Tile 480', 'Tile 502', 'Tile 590', 'Tile 597', 'Tile 711', 'Tile 730', 'Tile 850');
If someone would have a suggestion of what could be done to get a pop up menu which would allow the selection of what image file to read I would be very grateful.
Thank you for your time.
Regards,
Edvardas.

채택된 답변

Image Analyst
Image Analyst 2013년 4월 16일
Don't use menu for both the function and it's return argument. Also, the call to menu() must come before you call imread() so that you know what image to read in.
  댓글 수: 1
Edvardas
Edvardas 2013년 4월 16일
Oh, kind of an embarrassing mistake then.
Thank you for pointing out, everything works as expected now!
Regards,
Edvardas

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

추가 답변 (0개)

카테고리

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