How to compare one H,S and V histogram with another H,S and V histogram

5 ビュー (過去 30 日間)
Priyanka Mehta
Priyanka Mehta 2020 年 8 月 9 日
編集済み: Priyanka Mehta 2020 年 8 月 9 日
Hello,
I have genereted H, S and V histograms of two images. Anyone can give me suggestion for how to compare them for similarity. I have used the below code
rgbImage = imread('0.JPG');
rgbImage2 = imread('1.JPG');
hsvImage = rgb2hsv(rgbImage);
hImage = hsvImage(:, :, 1);
sImage = hsvImage(:, :, 2);
vImage = hsvImage(:, :, 3);
hsvImage2 = rgb2hsv(rgbImage2);
hImage2 = hsvImage2(:, :, 1);
sImage2= hsvImage2(:, :, 2);
vImage2 = hsvImage2(:, :, 3);
figure;
subplot(2,2,1);
hHist = histogram(hImage);
grid on;
title('Hue Histogram');
subplot(2,2,2);
sHist = histogram(sImage);
grid on;
title('Saturation Histogram');
subplot(2,2,3);
vHist = histogram(vImage);
grid on;
title('Value Histogram');
subplot(2,2,2);
imshow(rgbImage);
subplot(2,2,3);
hHist = histogram(hImage2);
grid on;
title('Hue Histogram');
subplot(2,2,2);
sHist = histogram(sImage2);
grid on;
title('Saturation Histogram');
subplot(2,2,3);
vHist = histogram(vImage2);
title('Value Histogram');
subplot(2,2,4);
imshow(rgbImage2);
Thank you.
  1 件のコメント
Sudheer Bhimireddy
Sudheer Bhimireddy 2020 年 8 月 9 日
missing the code.
If your image sizes are equal, then you can compare them directly. Example, img_1 == img_2. If not you may want to scale.

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

回答 (1 件)

Image Analyst
Image Analyst 2020 年 8 月 9 日
Perhaps you just want to take the mean and standard deviation of each histogram. Why don't you look into CBIR papers to see how they do it?

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by