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

조회 수: 4 (최근 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 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