Azzera filtri
Azzera filtri

How to read a raw image URL directly from a GitHub public repository via the imread function?

13 visualizzazioni (ultimi 30 giorni)
As far as I know, imread built-in function supports to read the image address file of a URL directly, but for a certain URL image address in public repository on Github, I can't read it by MATLAB, instead I can read it by using linux command `wget`, may I know how to read the image correctly by imread function?
Example:
imgPath = "https://github.com/Experience-Monks/360-image-viewer/blob/master/demo/pano_2048.jpg";
img = imread(imgPath);
Error using imread>get_format_info (line 554)
Unable to determine the file format.

Error in imread (line 395)
fmt_s = get_format_info(fullname);

Risposta accettata

cui,xingxing
cui,xingxing il 20 Lug 2024 alle 5:37
Modificato: cui,xingxing il 20 Lug 2024 alle 5:47
Incorrect use of html-wrapped address.
I use raw data to read now, the correct URL address to read is as follows:
imgPath = "https://raw.githubusercontent.com/Experience-Monks/360-image-viewer/master/demo/pano_2048.jpg";
img = imread(imgPath);
imshow(img)
For github raw data file address generally refer to the following:

Più risposte (0)

Categorie

Scopri di più su Images in Help Center e File Exchange

Prodotti


Release

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by