Generate histogram of HSV quantized image

5 次查看(过去 30 天)
Hello,
I have tried to quantize the HSV color space but I can not, can anyone help me please?
I want to Quantization HSV Space by assigning 8 level each to hue, saturation and value to give a quantized HSV space with 8x8x8=512 histogram bins.
I have used the following code for that but I am getting an error in rescale function. Can anyone help me to sort out this problem?
rgbImage = imread('1.jpg');
hsvImage = rgb2hsv(rgbImage);
montage(hsvImage,'Size', [1, 3]); title('Before Quantization'); colorbar;
threshRGB = multithresh(hsvImage, 8);
threshForPlanes = zeros(3, 8);
for i = 1:3
threshForPlanes(i, :) = multithresh(hsvImage(:, :, i), 8);
end
quantPlane = zeros(size(hsvImage));
for i = 1:3
value = [0 threshForPlanes(i, 2:end) 1];
quantPlane(:, :, i) = imquantize(hsvImage(:, :, i), threshForPlanes(i, :), value);
end
quantPlane = double(rescale(quantPlane, 0, 1));
figure; montage(quantPlane, 'Size', [1,3]); title('After Quantization');
colormap(parula(8)); colorbar;
% Error: Undefined function 'rescale' for input arguments of type 'double'.
quantPlane = double(rescale(quantPlane, 0, 1));
Thank you.

采纳的回答

Image Analyst
Image Analyst 2020-8-8
Why are you calling multithresh() and imquantize() to quantize it. Just call histogram() if you want the histogram. Your subject line says you want to "Generate histogram of HSV quantized image". Quantizing it will not create a histogram. The histogram() function will.
  4 个评论
Priyanka Mehta
Priyanka Mehta 2020-8-11
As an input I will give one image. its matching images should be retrived from the dataset. this should be done using histogram of HSV image.
Image Analyst
Image Analyst 2020-8-11
You should Google "CBIR" and see what algorithms people are using.

请先登录,再进行评论。

更多回答(0 个)

产品


版本

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by