Effacer les filtres
Effacer les filtres

How can I correction hue values of image

4 vues (au cours des 30 derniers jours)
Fu-An Nung
Fu-An Nung le 17 Oct 2016
Commenté : Image Analyst le 17 Oct 2016
How can I correction hue values of image
  2 commentaires
Adam
Adam le 17 Oct 2016
Correct them from what to what?
Fu-An Nung
Fu-An Nung le 17 Oct 2016
I have a wrong tonal image.I want to make it have correct tonal.

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 17 Oct 2016
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 commentaires
Fu-An Nung
Fu-An Nung le 17 Oct 2016
Modifié(e) : Image Analyst le 17 Oct 2016
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 le 17 Oct 2016
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);

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Lighting, Transparency, and Shading dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by