Public Lab Research note


How can you use computer vision to reduce spectral overlap?

by MaggPi | June 17, 2018 19:34 17 Jun 19:34 | #16513 | #16513

Research question: Can image processing /computer vision be used to increase the free spectral range (or reduce spectral overlap) of spectrometer designs?

Background:Many spectrometer designs are limited by the ‘spectral overlap’ problem which occurs when light spills over from one order to another. The general approach to solve the spectral overlap problem is to use an order sorting filter that blocks unwanted light but also reduces the overall spectral range. My research question is whether a software version of a blocking filter could quantify and compensate the spectral overlap. Please see http://www.vikdhillon.staff.shef.ac.uk/teaching/phy217/instruments/phy217_inst_fsr.htmlfor more info.

Spectral overlap demonstration: In order to demonstrate spectral overlap impact, a slitless boxless imaging spectrograph was created using a Raspberry PI NoIR V2 camera. Schematic below shows the camera setup consisting of a NoIR camera with a 500 line/mm transmission grating that receives light from a vertical row of different color Light Emitting Diodes (LEDs).

Slide1.JPG

This goal of the design is to create a spectrum staircase effect that permits observations of multiple light orders diffracted across the NoIR camera. List of light sources (from top to bottom) and significant spectral features are listed below: -1)Red Laser diode (~650nm) - Spectral marker with narrow output. -2)IR LED (~940 nm) –Marks edge of NoIR camera spectral range -3)IR LED (~850nm) – Center Near Infrared Band -4)White light LED – High intensity to observe second order spectrum -5)RED Laser Diode – Laser diode (used primarily to keep the staircase jumps even) -6)UV/Blue LED/White paper – Same LED as #7 but with white paper that creates green florescence spectra. -7)UV/Blue LED –Marks edge of NoIR camera spectral range The pictures below shows typical images from the spectrograph and demonstrate several types of spectral overlap. For example, blue LED second order overlaps with first order of IR LEDs, bright white LED overlaps with IR LEDs and blue/UV LED overlaps with paper fluorescence spectra.

Slide2.JPG

Slide3.JPG

Initial review:

The following pictures display 3d intensity profiles for the RGB components of the spectral staircase spectrograph example above. The goal of the 3D intensity profiles is to provide insight into how computer vision ‘sees’ the spectral images. The hope is that the profiles will help develop algorithms for a software order sorting filter.

Slide4.JPG

Since the full array 3d profiles are quite complex, the white light 2nd order spectrum was extracted. The picture below shows the Blue/Green/Red ‘rolling hill’ pattern typical of white light spectrum.

Slide5.JPG

Code used for image/ capture display and staircase example spectrograph is available at: https://github.com/MargaretAN9/Peggy

Related posts:

https://publiclab.org/notes/MaggPi/05-14-2018/is-there-a-way-to-use-the-rgb-spectral-overlap-to-make-better-spectral-measurements

@warren, @icarito, @amirberAgain


3 Comments

@maggpi, this is definitely a relevant parameter to explore, what I'm missing here are a few equations which describe the relation between the line density, illuminated area, and wavelength. Take a look here as a starting point: http://hyperphysics.phy-astr.gsu.edu/hbase/phyopt/grating.html I'm not sure I got exactly how you set up your system, how sure are you that all LEDs are aligned? The 850, 950nm LEDs appear to be saturated. When saturation occurs photo-electrons can spill to pixels along the same line/column known as Blooming (I'm not sure it's relevant for the Rpi camera thou). Possibly try to capture an image of a CFL lamp, while it doesn't have many features in the IR, you should be able to extract a clear calibration, and if you can set the exposure time to calibrate the second order as well you could get some real understanding on that overlap. Another interesting approach would be to look at the RGB values: keep in mind that IR is hardly discernable between the RGB, while the second order will be most visible in the B channel. try looking there!

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


You probably noticed by now that even a thing as simple as RGB2GRAY cand be made in different ways, look for rpi camera debayer to read more on this topic!

Reply to this comment...


The comment tries to answer questions above but some still need work:

---The free spectral range equation is
“Free spectral range” = λ2 – λ1 = λ2/(|m| + 1)

If λ1 is the shortest wavelength and λ2 is the longest wavelength in this wavelength interval.
So for the spectral staircase, if 950 nm (the edge of 940nm diode) is the highest wavelength, the spectral overlap should be about 475nm for the first order. Pictures below show seem to agree with 47nm but it could be less.

One way to look at line density is to look at the 3D profile below. The center bright spot covers about 150 lines. Since each pixel is 1.12 x 1.12 microns, the illumined area is about 165 microns.

  • I'm not sure I got exactly how you set up your system, how sure are you that all LEDs are aligned? ----The chart below shows the zero (and -1,+1) order which is probably the best way to look at the alignment. The LED’s are stapled against a wooden block but there is some LEDs that are slightly off center. My view on this at the time was that it was good enough since the spectral staircase steps are about 100nm and any difference left or right would be a small shift (~5nm). I plan to use a pegboard for future setups and hopefully that will permit better alignment.
    ----What's also interesting is that -1 order is stronger then the +1. I did not notice this before.

Slide1.JPG

  • The 850, 950nm LEDs appear to be saturated. When saturation occurs photo-electrons can spill to pixels along the same line/column known as Blooming (I'm not sure it's relevant for the Rpi camera thou).

----The IR LEDs were set high in order to see the second orders for the June 17 post. I reduced the output slightly for the -1,0,1 picture above.
----I haven’t been able to track down any real data on saturation. The Raspberry Pi https://www.raspberrypi.org/documentation/hardware/camera/ doesn’t list any sensitivity parameters for the V2. The Sony data I found describes saturation as ‘excellent’ but doesn’t describe why: https://github.com/rellimmot/Sony-IMX219-Raspberry-Pi-V2-CMOS/blob/master/RASPBERRY%20PI%20CAMERA%20V2%20DATASHEET%20IMX219PQH5_7.0.0_Datasheet_XXX.PDF
Saturation probably deserves a separate study. The next chart below show the LEDs without the grating and provides different colorspace perspectives. My real concern about saturation is whether it changes camera settings and makes it harder to see weak signals. (I can mask saturated pixels from the image by a computer vision filter).

Slide2.JPG

  • Possibly try to capture an image of a CFL lamp, while it doesn't have many features in the IR, you should be able to extract a clear calibration, ----Ok, Just prefer LEDs since they are battery powered,

  • and if you can set the exposure time to calibrate the second order as well you could get some real understanding on that overlap. ---- Yes, working this now.

  • Another interesting approach would be to look at the RGB values: ----See pictures above, -keep in mind that IR is hardly discernable between the RGB,

----Yes, one way to look it that the camera has an equal color response above 800nm but below the color ratio is always mixed. Take a look at the great chart below that uses Sony IMX219 data for below 700nm but also estimate the IR response. From this chart, you can see why the IR LEDS are always white. Chart from https ://github.com/khufkens/pi-camera-response-curves/commits?author=khufkens. It’s a great site since both graphs and chart data are available.

Slide3.JPG

  • while the second order will be most visible in the B channel. try looking there! ----Not sure if I see any real difference in the B channel. One thing that is noticeable is that there is less noise in the G channel. This can be observed both in the G channel picture and the RGB histogram.

Slide4.JPG

  • You probably noticed by now that even a thing as simple as RGB2GRAY cand be made in different ways, look for rpi camera debayer to read more on this topic!

--- yes, not only are there different ways to capture an image but there are also may tools to analyze the image. I am still searching for the best options for spectrographs.

----New comment. One reason for the spectral staircase is to visualize the spectral overlap concept. Another reason is to see whether reference row(s) with calibrated LEDs could be added to a spectrometer design. The concept is that the reference would provide info on how to unmix /subtract the spectral overlap. I know I can’t change diffraction laws but I also know I have computer vision tools and a couple million pixels that aren’t used when I take line spectrographs.

@warren, @icarito, @amirberAgain

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


Login to comment.