how to read two specific data from a folder?

dear all,
I want to read two images from a folder and draw their histogram.
I wondered if you wouid help me

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 10 月 1 日
編集済み: KALYAN ACHARJYA 2020 年 10 月 1 日

0 投票

If both images are in current working directory, please mention the image names only(with extension like png,jpg)
im1=imread('Image 1 Path');
im2=imread('Image 2 Path');
figure,imhist(im1);
figure,imhist(im2);

4 件のコメント

Leila
Leila 2020 年 10 月 1 日
編集済み: Leila 2020 年 10 月 1 日
thank you for your answer
but imread make some error
how could I seperate the name of image and path?
KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 10 月 1 日
Pease share the code, which you have tried?
KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 10 月 1 日
No need of separation, complete path of the images folder
im1=imread('Image_1_location_Path');
im2=imread('Image_2_location_Path');
figure,imhist(im1);
figure,imhist(im2);
Leila
Leila 2020 年 10 月 1 日
Thank you for your attention
This is my code:
clc; clear; close all
filename = dir('C:\Users\Desktop\task\shined_grayScale');
filename = filename(3:end);
varH = filename(i).name;
i = 1;
im1=imread('SHINEd_AG\C:\Users\Desktop\task\shined_grayScale '\' varH'));
i = 2;
im2=imread('SHINEd_SO\C:\Users\LENOVO\task\shined_grayScale '\' varH');
figure,imhist(im1);
figure,imhist(im2);

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

カテゴリ

質問済み:

2020 年 10 月 1 日

コメント済み:

2020 年 10 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by