how to process the 400 matrices to get the true color image
Ältere Kommentare anzeigen
Hi, Now I got four hundred matrices (2D) at each wavelength with spectrometer. The wavelength range is about 500-600nm. Now I want to combine these 400 matrices to get true color of my sample. Since in Matlab, true color image is get with RGB. So the wavelength should transfer to RGB, then combine the 400 matrices. Does anyone know how to realize it?
Thank you very much
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 11 Mai 2013
What you have to do is to multiply each image by the spectral responsivity of the sensor at each wavelength and then sum them up. Do this for each color sensor (R, G, and B). One way to do it is to use the equations in the upper left cell of the table on the "Math" tab of Bruce Lindbloom's site: http://www.brucelindbloom.com/ But that's a perceptual way, involving the human visual system. For best results, just get the spectral responsivities from your camera manufacturer (or the camera that you want to predict took this RGB image you're trying to create), and multiply and sum over all wavelengths. So you have 3 spectral responsivities, one for red, one for green, and one for blue that you get from your camera manufacturer (or make some up).
% Initialize newRed, newGreen, newBlue with zeros() function.
% Then sum up weighted images at each wavelength.
for wavelength = 1:numberOfWavelengths
responsivityR = sr_R(wavelength); % Get weighting for red sensor.
responsivityG = sr_G(wavelength); % Get weighting for green sensor.
responsivityB = sr_B(wavelength); % Get weighting for blue sensor.
% Now weight your image at that wavelength by the weighting factors and sum
newRed = newRed + myImage(wavelength) * responsivityR;
newGreen = newGreen + myImage(wavelength) * responsivityG;
newBlue = newBlue + myImage(wavelength) * responsivityB;
end
newRGB = cat(3, newRed, newGreen, newBlue);
% Then normalize to 0-255.
1 Kommentar
Xiaolei
am 13 Mai 2013
Kategorien
Mehr zu 3-D Scene Control finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!