How to apply the same white balance to a series of images in matlab?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nicole Mehr
el 11 de Dic. de 2017
Respondida: Mahmoud Afifi
el 12 de Ag. de 2019
Hi, I have images taken every second of a fluid moving between two parallel plates. I am using RAW images from a canon 50d camera that I have converted to a .dng format, linearized, and demosaiced in matlab. However, my images have a greenish-tint to them after I view them in matlab after applying the code I have to demosaic them. I have been reading various blogs and other forums online and have noticed that other people typically have images with a greenish tint to them as well. They recommend white balancing the images to get rid of this greenish hue. However, I can't seem to really grasp how to apply a white balance to my images in matlab, I also cannot use an "auto" white balancing code because I need to control every step in the image processing for every image (I need to apply the same code to every image, since this is scientific work as opposed to just recreational work). I hope this makes sense, Thanks!
0 comentarios
Respuesta aceptada
Image Analyst
el 12 de Dic. de 2017
Editada: Image Analyst
el 12 de Dic. de 2017
You need to have something in your image that you know for a fact is defined to be white. For example, the X-rite Color Checker Chart is embedded in each snapshot. Then segment or extract the white region, and multiply each color channel by the appropriate factor such that all white region intensities (in each color channel) all have the same value. This simple method should probably be good enough for your situation, though there are more sophisticated methods.
0 comentarios
Más respuestas (1)
Mahmoud Afifi
el 12 de Ag. de 2019
You can use any simple algorithm to estimate the illuminant value instead of manually picking it. Here is an example of using gray-world algorithm to white balance your raw images.
I = reshape(image,[],3);
R = mean(I(:,1)); G = mean(I(:,2)); B = mean(I(:,3));
ill = [R G B];
I = I * diag(G./ill);
I(I>1) = 1; I(I<0) = 0;
outImage = reshape(I,size(image));
0 comentarios
Ver también
Categorías
Más información sobre Image Processing Toolbox 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!