フィルターのクリア

How to read and resize and change color image from URL link in our MATLAB commands?

12 ビュー (過去 30 日間)
How to read and resize and change color image from URL link in our MATLAB commands?
  1 件のコメント
Gopichandh Danala
Gopichandh Danala 2017 年 6 月 9 日
Can you explain it little clearly, your question can be assumed in many possible ways?

サインインしてコメントする。

採用された回答

Gopichandh Danala
Gopichandh Danala 2017 年 6 月 9 日
I am assuming a few things here and you can modify it to suit your requirement
% read image from url (I took a random image on internet)..
[url_img, map] = imread('https://static.pexels.com/photos/14621/Warsaw-at-night-free-license-CC0.jpg');
figure, imshow(url_img), title('Image from url')
% resize it..
resized_img1 = imresize(url_img, 0.2); % resize by a factor here 0.2
resized_img2 = imresize(url_img, [600 500]); % resize to a specifiv dimensions
% there are many ways of interpolation to perform resizing
resized_img3 = imresize(url_img, 0.2,'method','nearest'); % rsize by a specific interpolation method
figure, imshow(resized_img1), title('Resized image')
% change color did you mean from RGB to grayscale
gray_img = rgb2gray(resized_img1);
figure, imshow(gray_img), title ('Grayscale image')
  3 件のコメント
Gopichandh Danala
Gopichandh Danala 2017 年 6 月 13 日
編集済み: Gopichandh Danala 2017 年 6 月 13 日
Are u asking for choosing filename/url_link on runtime even without knowing which URL you want to find or do you just want to check if a URL exists or not?
In the first case, I don't think it's possible for Matlab to go and randomly work as a Google to browse an HTML link.
In the second case, If you have a URL and want to check if its exists or not, this is more practical by try and catch block..
[str,status] = urlread('https://static.pexels.com/photos/14621/Warsaw-at-night-free-license-CC0.jpg');
try
IMG = imread('https://static.pexels.com/photos/14621/Warsaw-at-night-free-license-CC0.jpg');
catch
disp('URL link not available or broken')
end
If you have an idea of what you are looking for like some parameters you can construct the URL like this LINK
Selva Karna
Selva Karna 2017 年 7 月 4 日
Thank you Gopichandh Danala , how to read dll API from our MATLAB script ? can you explain?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRead, Write, and Modify Image についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by