How to display image from internet on axes?

조회 수: 5 (최근 30일)
Wasp Hamberg
Wasp Hamberg 2019년 4월 22일
댓글: Andreas Bernatzky 2019년 4월 22일
I know URL of this image and I need to display it in guide from internet .

답변 (1개)

Andreas Bernatzky
Andreas Bernatzky 2019년 4월 22일
Hi have a look at following code:
filename = 'https://www.terra-hd.de/hochfelln/img/current/1400.jpg';
% Read it in to a variable in my m-file.
rgbImage = imread(filename);
imshow(rgbImage,'Parent',app.UIAxes);
  댓글 수: 2
Wasp Hamberg
Wasp Hamberg 2019년 4월 22일
No( imread doesn't work here.
Error using getFileFromURL (line 19)
Can't read URL "https://www.terra-hd.de/hochfelln/img/current/1400.jpg".
Error in imread (line 327)
[isUrl, filename] = getFileFromURL(filename);
Error in inversefilter>inversefilter_OpeningFcn (line 60)
rgbImage = imread(filename);
Error in gui_mainfcn (line 220)
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});
Error in inversefilter (line 42)
gui_mainfcn(gui_State, varargin{:});
Andreas Bernatzky
Andreas Bernatzky 2019년 4월 22일
Have you tried a different url?
thats really strange. I use exact this code in a program of mine. The only difference is that I use appDesigner and no guide. Have you tried it in a stand alone script? I don't know if there are any toolboxes needed (but I am pretty sure it is not so).
For running it in a script try this:
% Specify the filename (URL).
filename = 'http://satelite.cptec.inpe.br/repositorio7/goes13_met10/goes13_met10_web/ams_afc_alta_jpg/2014/10/S11185873_201410150000.jpg';
% Read it in to a variable in my m-file.
rgbImage = imread(filename);
% Display the image.
imshow(rgbImage);

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

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by