필터 지우기
필터 지우기

Quantization HSV Space by assigning 8 level each to hue, saturation and value to give a quantized HSV space with 8x8x8=512 histogram bins

조회 수: 1 (최근 30일)
Hello,
I will try 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.
Thanks

채택된 답변

Subhadeep Koley
Subhadeep Koley 2020년 2월 10일
편집: Subhadeep Koley 2020년 2월 14일
Here is an example of quantization of the HSV colorspace
clc; close all;
rgbImage = imread('peppers.png');
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;
Hope this helps!
  댓글 수: 12
shalaw faraj
shalaw faraj 2020년 3월 25일
Dear @Subhadeep,
According my question I want to quantize the image RGB from 256*256*256 to 4*4*4 which it give 64 bin of histogram can you help me please?
thanks

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Fowzi barznji
Fowzi barznji 2020년 2월 14일
Sir
Subhadeep Koley
which version of MATLAB u r using ?

카테고리

Help CenterFile Exchange에서 Colorbar에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by