marsokod
Posts: 4
Joined: Fri Aug 10, 2012 1:51 pm

NoIR camera without a Bayer filter

Sat Jun 02, 2018 12:38 pm

Hello,

Has anyone used/knows a camera similar to the NoIR V2 but without the Bayer filter? I have seen post from people who removed it themselves and it looks ugly.

This is for a low light application and I do not care about the colour so having no IR filter and no Bayer filter would help a lot.

Thanks

User avatar
HermannSW
Posts: 1249
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: NoIR camera without a Bayer filter

Sat Jun 02, 2018 2:57 pm

Hi,

> Has anyone used/knows a camera similar to the NoIR V2 but without the Bayer filter?
>
I cannot help with that.

> This is for a low light application and I do not care about the colour so having no IR filter and no Bayer filter would help a lot.
>
The best you can do with a Raspberry camera is to take only bottom left green pixels of an image:
https://en.wikipedia.org/wiki/Bayer_filter
Image

Both green pixels are brighter than red or blue pixels, and bottom left green pixel is brighter than top right.
So with v2 camera you have to take any mode without binning (1-3), see v2 table:
https://www.raspberrypi.org/documentati ... /camera.md

And then in post processing you have to just take bottom left pixels of 2x2 sub images.
You cannot get this done by v2 camera itself since you only have choice of odd row/column increments 1 and 3.


I used this technique for automatic caterpillar robot camera tilt calibration, did conversion of all green images to b&w based on a threshhold:
viewtopic.php?f=43&t=189661&p=1231151#p1231151
Image


If you would use a v1 camera you can get your bottom left green picture directly from camera with horizontal and vertical 22 increments. That halves the resolution as well compared to 11 increments, but no post processing is needed.

You can do this 22 increments with either raspiraw (-vinc and -hinc options), or with raspivid from my userland fork since that allows to inject I2C commands after GPU has initialized camera, very early in recording. This has the advantage that you will get full GPU processing (of bright green image).

P.S:
You can do interesting stuff with that (raspivid) userland fork besides 22 increments horizontally and vertically, like changing shutter speed for every single frame of a video:
viewtopic.php?f=43&t=212694&p=1313054#p1313054
bookmark list: https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/fork-raspiraw
https://github.com/Hermann-SW/userland
https://twitter.com/HermannSW

PiGraham
Posts: 3558
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: NoIR camera without a Bayer filter

Sat Jun 02, 2018 3:23 pm

I assume you have probaby seen this blog post

https://www.google.co.uk/url?sa=t&rct=j ... 57-DTcS45J

that reports eventual success using photoresist remover. It is undoubtedly a difficult and risky process. I think you need a microscope and a steady hand.

I doubt that the Pi camera sensor exists at all without a Beyer filter except where someone has removed it. AIUI it is a phone camera and there is no market for monochrome phone cameras.

This topic on the forum cover the same ground:
viewtopic.php?t=142196

You could use a mono CTV camera which exist for the improved light sensitivity. Low resolution though. You can interface them using an USB video capture card (Easy Cap). Quality may disappoint.

You could use an industrial / scientific USB mono camera. You can get good quality high res images but you may not like the prices!
Go for something that conforms to UVC standard so that you don't need special drivers because you aren't likely to find drivers for Pi.

You might find a monochrome camera chip with CSI that could be made to work but it's likely to be a difficult task.

This is a mono sensor with CSI
https://sincerefirst.en.alibaba.com/pro ... odule.html
But you can't just plug it into a Pi. I think it will be quicker, cheaper and easier to scrape the beyer filter off than to get this working.

PiGraham
Posts: 3558
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: NoIR camera without a Bayer filter

Sat Jun 02, 2018 3:27 pm

HermannSW wrote:
Sat Jun 02, 2018 2:57 pm

The best you can do with a Raspberry camera is to take only bottom left green pixels of an image:
The problem with that is that you lose 3/4 of the light that hits the sensor. If the objective is to maximise sensitivity you can do much better if the bayer filter is removed and you add up each 2x2 group of pixels. Next best would be to sum the RGBG filtered 2x2, but obviously the filters attenuate the signal and may block some wavelengths you want to detect.

marsokod
Posts: 4
Joined: Fri Aug 10, 2012 1:51 pm

Re: NoIR camera without a Bayer filter

Sat Jun 02, 2018 6:23 pm

Thanks, yes that is the blog post I saw. I am tempted to try it but even if I succeed I am not sure how this operation done by someone like me will affect the life expectancy of the sensor.

The current solution is just to use the luminance value for each pixel and I read there are some ways to recover more accurately the light from a Bayer filter. It is working but the problem remains that it filters a portion of the light. @HermannSW, why is it 3/4? I though it would be 2/3. Removing that limit would give me more margins but it looks like there is no easy solution existing so there will be a trade off at some point.

I am trying to stick to MIPI and stay away from USB in order to relieve a bit the CPU. And 5+MPxl is what I am looking for.

PiGraham
Posts: 3558
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: NoIR camera without a Bayer filter

Sat Jun 02, 2018 8:24 pm

marsokod wrote:
Sat Jun 02, 2018 6:23 pm
@HermannSW, why is it 3/4? I though it would be 2/3.
I mentioned 3/4. Are you asking me? I quoted HermanSW.
Herman suggested using one of the grren pixels, which is just one of four sensitive areas of a beyer cell, so 1/4 of the photo sensitive area, losing 3/4.

If you add up both greens you have 1/2

marsokod
Posts: 4
Joined: Fri Aug 10, 2012 1:51 pm

Re: NoIR camera without a Bayer filter

Sat Jun 02, 2018 11:29 pm

Yes sorry I was quoting you.

Actually, thinking about it it may be even more that 2/3 or 3/4: the Bayer filter would be pretty restrictive and will end up blocking/attenuating a huge part of the visible light spectrum that is not perfectly RGB.

Removing the Bayer filter might be worth it.

User avatar
HermannSW
Posts: 1249
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: NoIR camera without a Bayer filter

Sun Jun 03, 2018 8:40 am

marsokod wrote:
Sat Jun 02, 2018 11:29 pm
Removing the Bayer filter might be worth it.
Can you take a photo in low light environment with v2 NoIR camera? Put it here, even if it looks nearly black. Opening it with gimp would allow to apply several color tools in order to see whether more details can be made visible.If that is the case, I would prefer post processing instead of removing Bayer filter. Even if you remove Bayer filter, GPU will not help much anymore because it has no idea that the Bayer filter was removed and process the image incorrectly.

PiGraham wrote:
Sat Jun 02, 2018 3:27 pm
HermannSW wrote:
Sat Jun 02, 2018 2:57 pm

The best you can do with a Raspberry camera is to take only bottom left green pixels of an image:
The problem with that is that you lose 3/4 of the light that hits the sensor. If the objective is to maximise sensitivity you can do much better if the bayer filter is removed and you add up each 2x2 group of pixels. Next best would be to sum the RGBG filtered 2x2, but obviously the filters attenuate the signal and may block some wavelengths you want to detect.
This is only true if low light picture marsokod wants to take does not show nicely in green only. Summing up 2x2 area is similar to taking the average of 2x2 area, which is worse than just taking the maximum of the 4 pixels. marsokod will have to provide more details on his low light scene in order to decide.

P.S:
Just found this from 640x480 images taken with Raspberry camera:
"... left 320x240 displays the blue pixel of each 2x2 BG/GR bayer block, right 320x240 displays the top green pixel of each 2x2 BG/GR bayer block ..."
viewtopic.php?f=43&t=189661&p=1231151#p1218763
Image
bookmark list: https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/fork-raspiraw
https://github.com/Hermann-SW/userland
https://twitter.com/HermannSW

PiGraham
Posts: 3558
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: NoIR camera without a Bayer filter

Sun Jun 03, 2018 11:09 am

HermannSW wrote:
Sun Jun 03, 2018 8:40 am

PiGraham wrote:
Sat Jun 02, 2018 3:27 pm
HermannSW wrote:
Sat Jun 02, 2018 2:57 pm

The best you can do with a Raspberry camera is to take only bottom left green pixels of an image:
The problem with that is that you lose 3/4 of the light that hits the sensor. If the objective is to maximise sensitivity you can do much better if the bayer filter is removed and you add up each 2x2 group of pixels. Next best would be to sum the RGBG filtered 2x2, but obviously the filters attenuate the signal and may block some wavelengths you want to detect.
This is only true if low light picture marsokod wants to take does not show nicely in green only. Summing up 2x2 area is similar to taking the average of 2x2 area, which is worse than just taking the maximum of the 4 pixels. marsokod will have to provide more details on his low light scene in order to decide.
That is only true is some special circumstances, and there is no indication that such circumstances apply here.

It is a sensible assumption that illumination is 'white light' unless otherwise specified, which means that all four photosensitive areas will receive signal even if the beyer filter is present. In general you will do better summing all four channels than taking the maximum 1/4 channel. You will do much better if there is no beyer filter. It is best to take the maximum and discard the other three if those three contribute more noise than signal. But that won't typically be the case.

User avatar
Gavinmc42
Posts: 3178
Joined: Wed Aug 28, 2013 3:31 am

Re: NoIR camera without a Bayer filter

Mon Jun 04, 2018 6:10 am

Found this last week while looking for UV sensors

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5087437/
http://www.volcano-blog.com/blog/low-co ... spberry-pi

EKC830 is a photo resist remover.
http://www.dupont.com/products-and-serv ... overs.html

I have heard of Acetone being used to remove the Bayer pattern.

It would be nice if there was an official Pi monochrome sensor, then all sorts of filters could be used UV to IR.
Diffraction grating (CDROM) turns Pi camera into a spectrometer.

RAW mode in theory should work with other CSI sensors now.
The 400x400 sensor monochrome sensor would be useful for lots of things.
search.php?keywords=400x400&t=109137&sf=msgonly
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Camera board”