How do I display an image that a user uploads?
์กฐํ ์: 2 (์ต๊ทผ 30์ผ)
์ด์ ๋๊ธ ํ์
Shelby
2024๋
2์ 6์ผ
ํธ์ง: Walter Roberson
2024๋
2์ 7์ผ
I am building an app that take's an image that a user inputs and scans it using OCR for specific words. I want the user to upload an image and then display it on my app. Could someone help me figure out where I'm going wrong? This is my current code:
function UploadFileButtonPushed(app, event)
[filename, pathname] = uigetfile({'*.png;*.jpg;*.jpeg;*.bmp', 'Image Files (*.png, *.jpg, *.jpeg, *.bmp)'}, 'Select an Image');
image = imread(fullfile(pathname, filename));
imshow(image, 'Parent', app.ImageAxes);
end
๋๊ธ ์: 2
Anton Kogios
2024๋
2์ 6์ผ
The code you are using should work (see attached app). Are you sure app.ImageAxes.Visible is set to 'on'?
You could also try this instead of imshow:
imagesc(app.UIAxes,image);
์ฑํ๋ ๋ต๋ณ
Anton Kogios
2024๋
2์ 7์ผ
I'm glad it worked out for you! Just adding my comment as an answer so you can accept it ๐
The code you are using should work (see attached app in above comment). Are you sure app.ImageAxes.Visible is set to 'on'?
You could also try this instead of imshow:
imagesc(app.UIAxes,image);
๋๊ธ ์: 0
์ถ๊ฐ ๋ต๋ณ (0๊ฐ)
์ฐธ๊ณ ํญ๋ชฉ
์นดํ ๊ณ ๋ฆฌ
Help Center ๋ฐ File Exchange์์ Migrate GUIDE Apps์ ๋ํด ์์ธํ ์์๋ณด๊ธฐ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!