Color normalization algorithm under various lighting conditions
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
LANG Wu
el 24 de Abr. de 2020
Comentada: LANG Wu
el 28 de Abr. de 2020
I am trying to take pictures using cellphones under various lighting conditions which would cause color distortions. Hence some kind of white balance algorithm is needed to correct the lighting of those photos so we get the standardized color. This can be commonly done if you have a "gray card" which many photographers use to tell their cameras what is the true white color under any light. With the "gray card", a person can take a picture with a standard color item by the side. With the item's color as a reference, we hope we can standardize the picture's color. We are doing this for an excellent color normalization.
Does anybody know any readily available algorithms (or something we can modify) for the above purpose? I really appreciate it if you can offer any suggestions.
4 comentarios
Respuesta aceptada
Image Analyst
el 24 de Abr. de 2020
There is a whole family of functions to do this. In the Image Processing Toolbox, check out illumgray(), illumpca(), illumwhite(), and chromadapt().
6 comentarios
Image Analyst
el 28 de Abr. de 2020
Actually you can do steps 1 and 2 using rgb2gray()
grayImage = rgb2gray(rgbImage);
mask = grayImage > 180; % or whatever gray level your white card is.
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
meanR = mean(redChannel(mask))
meanG = mean(greenChannel(mask))
meanB = mean(blueChannel(mask))
maxR = max(redChannel(mask))
maxG = max(greenChannel(mask))
maxB = max(blueChannel(mask))
deltaR = uint8(maxR - meanR)
deltaG = uint8(maxG - meanG)
deltaB = uint8(maxB - meanB)
newR = redChannel + deltaR;
newG = greenChannel + deltaG;
newB = blueChannel + deltaB;
newRGB = cat(3, newR, newG, newB);
imshow(newRGB);
See attached color standardization and calibration tutorial from my course I teach.
Más respuestas (1)
darova
el 25 de Abr. de 2020
Try this trick
I = imread('peppers.png');
imshow(I)
p = round(ginput(1));
for i = 1:3
I(:,:,i) = I(:,:,i) + (255 - I(p(2),p(1),i));
end
imshow(I)
Ver también
Categorías
Más información sobre Orange en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!