Borrar filtros
Borrar filtros

HOW TO CONVERT GRAY IMAGE TO HUE IMAGE?

1 visualización (últimos 30 días)
tashu Dabariya
tashu Dabariya el 13 de Jun. de 2019
Comentada: Image Analyst el 15 de Jun. de 2019
i am trying to find psnr value of hue image and gray image
i need to know how to convert gray image to hue

Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 13 de Jun. de 2019
Editada: KALYAN ACHARJYA el 13 de Jun. de 2019
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 comentarios
tashu Dabariya
tashu Dabariya el 14 de Jun. de 2019
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 el 14 de Jun. de 2019
Editada: tashu Dabariya el 14 de Jun. de 2019
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?

Iniciar sesión para comentar.

Más respuestas (1)

Image Analyst
Image Analyst el 14 de Jun. de 2019
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 comentarios
tashu Dabariya
tashu Dabariya el 15 de Jun. de 2019
i want accuracy of identification of greenness
how to find accuracy of identification?
Image Analyst
Image Analyst el 15 de Jun. de 2019
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).

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by