OBTENTION OF AN ABSORBANCE SPECTRA FROM AN IMAGE

9 views (last 30 days)
I want to process images from light spectra to obtain an absorbance vs wavelength plot. However, the ligth spectra is only a small part of the image, and i do not understand how to set the wavelengths at the pixels they correspond. That is to say, only the light spectra is half of the image (for example), how do i know when wavelengths start to count in the visible spectra.
  4 Comments
Jorge Trapiella Fernández
The pics look like this, the problem is that obviously the first pixel does not correspond to 0 nm wavelength and i have no clue on how to interpolate to obtain the relation pic-wavelength.
Thank you for your responses
DGM
DGM on 2 Jun 2024
You need to know two relationships:
  1. The spatial position within the image versus wavelength
  2. The camera's sensitivity versus wavelength
We still don't know how this image was created. Consequently, we don't know if either of these two things are repeatable. The physical staging and camera behavior will need to be repeatable in order to calibrate.
From appearances alone, the fact that the image is so heavily biased toward the primaries tells me that something unhelpful is happening in the acquisition. I could guess that this might possibly mean that:
  • There is some sort of color vibrancy filter applied?
  • Sensor saturation? Some sort of internal compensation?
  • The image didn't come from a grating or prism?
If you're trying to do some sort of rudimentary thing with a camera and a grating, just do a web search for "theremino calibration".

Sign in to comment.

Answers (1)

Star Strider
Star Strider on 2 Jun 2024
Edited: Star Strider on 2 Jun 2024
Without some sort of calibration, what you want to do might not be possible, especially if the resolution is only integers on the range of .
With that in mind, try this —
I = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1708001/image.jpeg');
SzI = size(I)
SzI = 1x3
102 282 3
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
imshow(I)
Irow = I(51,:,:);
sqIrow = squeeze(Irow);
cc = 'rgb';
dn = ["Red" "Green" "Blue"];
figure
hold on
for k = 1:size(I,3)
plot(sqIrow(:,k), cc(k), 'DisplayName',dn(k)+" Channel")
end
hold off
grid
xlabel('Row Index')
ylabel('Channel Value')
title('Centre Row')
legend('Location','best')
Irow = mean(I,1);
sqIrow = squeeze(Irow);
cc = 'rgb';
dn = ["Red" "Green" "Blue"];
figure
hold on
for k = 1:size(I,3)
plot(sqIrow(:,k), cc(k), 'DisplayName',dn(k)+" Channel")
end
hold off
grid
xlabel('Row Index')
ylabel('Channel Value')
title('Mean Over Rows')
legend('Location','best')
SEM = squeeze(std(double(I),[],1)/sqrt(size(I,1)));
t95 = tinv([0.025 0.975], size(I,2)-1);
for k = 1:size(I,3)
CI95{k} = sqIrow(:,k) + SEM(:,k) .* t95;
end
cc = 'rgb';
dn = ["Red" "Green" "Blue"];
xv = [(0:size(I,2)-1) flip(0:size(I,2)-1)].';
figure
hold on
for k = 1:size(I,3)
hp(k) = plot(sqIrow(:,k), cc(k), 'DisplayName',dn(k)+" Channel");
yv = [CI95{k}(:,1); flip(CI95{k}(:,2))];
patch(xv, yv, cc(k), 'FaceAlpha',0.2, 'EdgeColor','none')
end
hold off
grid
xlabel('Row Index')
ylabel('Channel Value')
title('Mean Over Rows With 95% Confidence Intervals')
legend(hp, 'Location','best')
EDIT — (2 Jun 2024 at 19:03)
Changed confidence interval plots from dashed line plots to patch objects.
.
  2 Comments
Image Analyst
Image Analyst on 2 Jun 2024
Yes but to then turn the 3 channel absorbances into an overall absorbance spectra vs wavements (which is a single plot of absorbance vs. wavelength), you'll need to know the spectral sensitivities of the imaging sensor as a function of wavelength, and what wavelengths are at the ends of the colored image.
Star Strider
Star Strider on 2 Jun 2024
Certainly. Much information remains missing.
My objective is to demonstrate how to get the information from the spectrum figure, and calculate some basic dispersion statistics on it.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!