Generate histogram of HSV quantized image
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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.
0 comentarios
Respuesta aceptada
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
Image Analyst
el 11 de Ag. de 2020
You should Google "CBIR" and see what algorithms people are using.
Más respuestas (0)
Ver también
Categorías
Más información sobre Image Filtering and Enhancement en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!