HOW TO CONVERT GRAY IMAGE TO HUE IMAGE?

조회 수: 1 (최근 30일)
tashu Dabariya
tashu Dabariya 2019년 6월 13일
댓글: Image Analyst 2019년 6월 15일
i am trying to find psnr value of hue image and gray image
i need to know how to convert gray image to hue

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 6월 13일
편집: KALYAN ACHARJYA 2019년 6월 13일
Have you read about Hue? Read here in wiki
I dont think there is any conversiotion way, if you do somehow, all gray pixels=0 in hue space (color appearance parameters).
Must read thread here
  댓글 수: 5
tashu Dabariya
tashu Dabariya 2019년 6월 14일
img=imread('.jpg');
% imresize for resize image
img=imresize(img,[256 256]);
img=im2double(img);
figure,imshow(img),title('original image');
% convert rgb to hsv
img1=rgb2hsv(img);
H=img1(:,:,1);
S=img1(:,:,2);
V=img1(:,:,3);
H(:,:,1) = H(:,:,1) * 2.5; %increase hue image
figure(), subplot(2, 2, 1), imshow(img), title('Original')
subplot(2, 2, 2), imshow(H), title('Hue'), colorbar
subplot(2, 2, 3), imshow(S), title('Saturation'), colorbar
subplot(2, 2, 4), imshow(V), title('Value of Brightness'), colorbar
% otsu thresholding
fim=rgb2gray(img);
level=graythresh(fim);
bwfim=im2bw(fim,level);
figure(),imshow(bwfim),title('Otsu')
sir, I want to find accuracy through psnr and mse or any option to find the accuracy of hue image and binary image (Otsu)
I don't understand how to find the accuracy of hue and binary image
tashu Dabariya
tashu Dabariya 2019년 6월 14일
편집: tashu Dabariya 2019년 6월 14일
H = (H);
bwfim =double (bwfim);
% Find the mean squared error
mse = sum((H(:)-bwfim(:)).^2) / numel(H)
% now find the psnr, as peak=255
psnr = 10*log10(255*255/mse)
want to know is it right code to find mse and psnr?

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

추가 답변 (1개)

Image Analyst
Image Analyst 2019년 6월 14일
The code you gave is irrelevant. It will produce bogus results. To compare colors you need to use Delta E. Plus, it's meaningless to compare the hue channel of a color image to a binary image. You need to describe what you want better so I know how to answer you. I do color image analysis every day (for decades), so I might know a little about it.
  댓글 수: 6
tashu Dabariya
tashu Dabariya 2019년 6월 15일
i want accuracy of identification of greenness
how to find accuracy of identification?
Image Analyst
Image Analyst 2019년 6월 15일
None of what you said about PSNR makes sense.
To find accuracy of identification, you might use your binary image of what your algorithm found for "green" and compare it to what you hand drew with imfreehand(). Then use the Sorensen Dice coefficient (see Wikipedia).

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

Community Treasure Hunt

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

Start Hunting!

Translated by