Answer the question
In order to leave comments, you need to log in
How to download an image from github?
I want to access the url of the image and write it down for download and display by matlab
clc;
clear;
imageUrl='https://github.com/Beginerok/Tropic-Island/blob/master/Tropic-Island/Gamedev/Demo2/Demo2/content/atlas.png';
rgb = webread(imageUrl);
tree = htmlTree(rgb);
selector = "img";
subtrees = findElement(tree,selector)
tmpr='https://github.com';
strp = string(subtrees(5));
ch=strp.char()
for j=11:1:length(ch)
if ch(j)~='?'
tmpr=strcat(tmpr,ch(j));
else
break;
end
end
tmpr
rgb = webread(tmpr)
whos rgb
rgb = imresize(rgb, 0.6);
imshow(rgb)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question