How can I correction hue values of image

조회 수: 3 (최근 30일)
Fu-An Nung
Fu-An Nung 2016년 10월 17일
댓글: Image Analyst 2016년 10월 17일
How can I correction hue values of image
  댓글 수: 2
Adam
Adam 2016년 10월 17일
Correct them from what to what?
Fu-An Nung
Fu-An Nung 2016년 10월 17일
I have a wrong tonal image.I want to make it have correct tonal.

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

채택된 답변

Image Analyst
Image Analyst 2016년 10월 17일
You need to snap an image of a color standard with known color values. The usual standard is the x-rite Color Checker Chart. Then you have known XYZ values. You can use least squares to derive a transform to convert your RGB values, of the color chips on a picture of that chart that you have taken, into XYZ values. Then you can use analytical formulas to convert XYZ into LAB or other calibrated color spaces.
  댓글 수: 4
Fu-An Nung
Fu-An Nung 2016년 10월 17일
편집: Image Analyst 2016년 10월 17일
Excuse me I have run this code . but I only got a all black image. Did I do something wrong?
clc, clear;
fi = imread('sofa_1.jpg');
hsvImage = rgb2hsv(fi);
someFactor = 0.77; % or whatever.
hsvImage(:,:,1) = hsvImage(:,:,1)*someFactor ;
rgbImage = uint8(hsv2rgb(hsvImage));
imshow(rgbImage);
Image Analyst
Image Analyst 2016년 10월 17일
Try this:
clc;
clearvars;
close all;
workspace;
fontSize = 15;
format compact
format short g;
rgbImage = imread('peppers.png');
subplot(2, 4, 1);
imshow(rgbImage);
axis on;
title('Original Image', 'FontSize', fontSize);
% Set up figure properties:
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Get rid of tool bar and pulldown menus that are along top of figure.
set(gcf, 'Toolbar', 'none', 'Menu', 'none');
% Give a name to the title bar.
set(gcf, 'Name', 'Demo by ImageAnalyst', 'NumberTitle', 'Off')
hsvImage = rgb2hsv(rgbImage);
hImage = hsvImage(:, :, 1);
sImage = hsvImage(:, :, 2);
vImage = hsvImage(:, :, 3);
subplot(2, 4, 2);
imshow(hImage, [0, 1]);
title('Hue Image', 'FontSize', fontSize);
subplot(2, 4, 3);
imshow(sImage, []);
title('Saturation Image', 'FontSize', fontSize);
subplot(2, 4, 4);
imshow(vImage, []);
title('Value Image', 'FontSize', fontSize);
someFactor = 1.6; % or whatever.
% Use mod to "wrap around" values more than 1.
hImageNew = mod(hImage * someFactor, 1);
subplot(2, 4, 6);
imshow(hImageNew, [0, 1]);
title('New Hue Image', 'FontSize', fontSize);
% Create new image
hsvImage = cat(3, hImageNew, sImage, vImage);
% Convert back to RGB color space.
rgbImageNew = hsv2rgb(hsvImage); % It's double in the range of 0-1 here.
% Convert to uint8 in the range 0-255
rgbImageNew = uint8(255 * mat2gray(rgbImageNew));
subplot(2, 4, 5);
imshow(rgbImageNew);
title('Changed Image', 'FontSize', fontSize);

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by