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