Generate histogram of HSV quantized image

2 visualizaciones (últimos 30 días)
Priyanka Mehta
Priyanka Mehta el 8 de Ag. de 2020
Comentada: Image Analyst el 11 de Ag. de 2020
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.

Respuesta aceptada

Image Analyst
Image Analyst el 8 de Ag. de 2020
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 comentarios
Priyanka Mehta
Priyanka Mehta el 11 de Ag. de 2020
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 el 11 de Ag. de 2020
You should Google "CBIR" and see what algorithms people are using.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Image Filtering and Enhancement en Help Center y File Exchange.

Productos


Versión

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by