Friday, May 13, 2016

debayering raspberry pi camera (monochrome mod)

A monochrome camera can have better sensitivity and useful spatial resolution because every pixel responds to the available light instead of being divided into red, green and blue pixels by a Bayer color filter.

For example, a typical Bayer pattern has approximately 25 percent red pixels, 25 percent blue pixels and 50 percent green pixels. When photographing something that is mainly green, most of the useful signal comes from only half of the sensor pixels.

I wanted to try removing the Bayer filter because Raspberry Pi did not offer a monochrome camera module at the time. I had upgraded my cameras to the newer version, so I used the old modules for the experiment.

The Pi NoIR camera is not monochrome. It only lacks the infrared blocking filter. It still has the Bayer color filter on the sensor.

Removing the filter was neither quick nor easy. The lens holder is attached with a thin layer of epoxy. The safest method I found was to release one corner carefully and use that opening to separate the board from the holder.

Four cameras died during the first attempts. Two were damaged while opening the lens holder and two during the actual filter removal.

There are extremely fine bond wires around the edge of the sensor. Touching or shorting them will kill the camera. I did the early attempts without a microscope because I was too lazy to drive to TAMI. The later close up photos were taken through a Mantis microscope that I bought afterward.

The fifth camera was scraped while it was operating so I could see exactly when something went wrong, and that attempt worked. Very little pressure is needed. Too much force can move the sensor die and tear the bond wires.

There also appeared to be another coating below the Bayer layer, possibly an antireflection coating, although I was not certain.

I later killed that camera while adjusting the focus. The hot glue holding the lens socket came loose, moved the sensor and tore more bond wires, bringing the casualty count to five.

I tried several solvents in an ultrasonic cleaner without success. Later, photoresist remover followed by cleaning solvent removed the filter without damaging the sensor, which was a much better method than scraping it with a knife.

The first finished image had the focus slightly off, but the monochrome conversion worked.

TAMI:

http://telavivmakers.org/

Videos:

https://www.youtube.com/watch?v=KisS9qxq3-4

https://www.youtube.com/watch?v=k3NDk3Tzz4M

Process and result photos below.

Photos and videos

raspberry pi camera monochrome conversion, photograph 1
raspberry pi camera monochrome conversion, photograph 2
raspberry pi camera monochrome conversion, photograph 3
raspberry pi camera monochrome conversion, photograph 4
raspberry pi camera monochrome conversion, photograph 5
raspberry pi camera monochrome conversion, photograph 6
raspberry pi camera monochrome conversion, photograph 7
raspberry pi camera monochrome conversion, photograph 8
raspberry pi camera monochrome conversion, photograph 9
raspberry pi camera monochrome conversion, photograph 10

7 comments:

  1. Hi Elad,
    I have been searching for information on how to debayer the Pi camera and your blog post is one of the few sources I have found. Thanks for posting!

    I have just a few questions:
    1) what type of tool did you use to remove the filter?
    2) what solvent(s) worked best for you?
    3) Do you know of any more links about removing the Pi camera's bayer filter?

    Thanks!
    Kyle

    ReplyDelete
  2. Hello,

    I am interested too in Kyle's questions. I need to debayer a RaspberryPi Camera V2 NoIR for my master thesis.

    Many thanks!
    Abbas

    ReplyDelete
  3. Hi Abbas,
    Which solvent did you eventuelly use? I have to do the same.

    ReplyDelete
    Replies
    1. most kinds and brands of photoresist remover should work
      afterwards you need to clean the residues for best result use heat, patient, and good microscope to monitor the process.

      Delete
  4. Hi Elad,
    I am trying to solve the same problem and I found your blog really useful.
    Can you explain which brand of photoresist remover used and the method (how to heat specially).
    I have been trying to remove the color filter array by scratching, but my cameras always broke. Also, I wonder if there are three layers of the filter array before reach to the CMOS sensor.
    Thank you very much.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. Hi Moso,

      As Elad replied above, you need patience, it's a very thorough process if you're etching the pi cam sensors.

      The photoresist remover in general is an aggressive solution, different solutions may destroy the small board (<1sqcm sensor board, not the 2.5sqcm connected to the pi).

      You need to check if the sensor is has a positive or negative photoresists and get the convenient remover. If you can't know that, then you have to try both seperately. For the Pi Cam 1.3 sensor, Wilkes et al. used a positive photoresist remover. Moreover, some removers target both kinds of resists.

      If you get this to work then you will end up with a much more delicate sensor.

      Good luck!

      Delete