How to express color in terms of wavelength.

조회 수: 11 (최근 30일)
正義 金田
正義 金田 2023년 6월 26일
답변: Image Analyst 2023년 6월 27일
When extracting color data from image data, I want to extract the data as wavelength, not in RGB or LAB format.
For example, if the color of the image data is red, it is 700nm, and if it is blue, it is 450nm.
  댓글 수: 3
Stephen23
Stephen23 2023년 6월 26일
편집: Stephen23 2023년 6월 26일
"When extracting color data from image data, I want to extract the data as wavelength, not in RGB or LAB format."
In general this is not possible: there are infinite combinations of wavelengths that can combine to produce the same color:
DGM
DGM 2023년 6월 26일
Consider a pixel with value [255 255 255] in the center of this image.
Is that a uniform SPD across all visible wavelengths, or is that a combination of three discrete spectra corresponding to some arbitrarily chosen values for red, green, and blue? What if I told you that it wasn't even in the visible spectrum, but was instead actually a narrow peak at 850nm?
The act of projecting the SPD through an unknown, wavelength-dependent system and integrating the result is an irreversible reduction of information. A camera is not a spectrometer, though you could make a spectrometer out of a camera. Note that in order for those photographs to represent the whole SPD, they actually need a relatively large RGB image to represent a single sample point. That entire rainbow image represents one pixel.

댓글을 달려면 로그인하십시오.

답변 (2개)

Anamika
Anamika 2023년 6월 27일
To express color in terms of wavelength, you can use the concept of the electromagnetic spectrum. The visible spectrum ranges from approximately 400 nanometers (nm) to 700 nm, with shorter wavelengths corresponding to colors like blue and longer wavelengths corresponding to colors like red, here are some ways to convert colors to their corresponding wavelengths:
1)First, determine the color space of the image data you are working with if you have RGB values, convert them to the corresponding color space, such as CIE XYZ or CIE LAB
2)Once you have the color values in a suitable color space, you can map them to the visible spectrum. The exact mapping depends on the specific color space and the range of wavelengths you want to work with.
3)e.g in the CIE XYZ color space, you can use the CIE 1931 Standard Observer functions to calculate the tristimulus values for a given color.
4)To convert the tristimulus values to wavelength, you can use interpolation techniques.
5)Always remember while doing that this conversion is an approximation, as it assumes a linear relationship between color and wavelength. In reality, the perception of color is more complex
Hope it will help you
~Thanks
  댓글 수: 1
DGM
DGM 2023년 6월 27일
편집: DGM 2023년 6월 27일
You have a luminous object or a point on an illuminated surface. The light projected onto the camera's sensor from that point has a spectral power distribution that looks like this:
Your camera's sensor has a response curve that looks like the solid black line:
... but all the light that reaches the sensor passes through a combination of an IR filter and a color filter screen with the indicated response curves. Ignoring demosaicing and all in-camera processing (which we can assume are completely unknown anyway), the values of a given pixels elements are the integrals of the products of the source SPD, sensor response, and the respective filter responses. @Stephen23's comment about nonuniqueness should seem quite obvious now.
For sake of a simplified example, given the weighted sum Y = k1*X1 + k2*X2, can you find a unique numeric solution for X1,X2 if Y is known? What if k1,k2 are only approximately known? Could you even be certain if X1>X2?
So given an RGB tuple, show me how you would back-calculate an SPD and reduce it to a single representative wavelength -- all without knowledge of any of the above intormation. Again, feel free to use the prior example. Say our given tuple is [255 255 255] in sRGB. What is the wavelength represented by a white pixel?

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2023년 6월 27일
If you need a spectral image, then don't collect an RGB image. Collect an image with more wavelengths in the first place. You need an imaging spectrometer, https://en.wikipedia.org/wiki/Imaging_spectrometer , or hyperspectral camera. There are portable and desktop instruments available.

카테고리

Help CenterFile Exchange에서 Display Point Clouds에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by