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

2 次查看(过去 30 天)
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
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 CenterFile Exchange 中查找有关 Histograms 的更多信息

产品


版本

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by