laparpi
Posts: 12
Joined: Wed Dec 02, 2015 7:08 pm

How do I set a costum white balance of the NoIR modulo cam?

Thu Dec 03, 2015 9:18 pm

Hi! I'm going to take same IR pictures by NoIR modulo cam and blue filter (Roscolux #2007: Storaro Blue) in order to measure the health of plants. To take a Picture I'm using "Raspistill". According to this information https://publiclab.org/notes/warren/08-1 ... hotography I need to set white balance pointing a deep blue surface before take a IR picture of the plants.
I didn't find any custom white balance command in the list of commands of Raspistill.
How do I set a custom white balance?

May I use something different instead of Raspistill?

Thanks in advance

best regards

gordon77
Posts: 3865
Joined: Sun Aug 05, 2012 3:12 pm

Re: How do I set a costum white balance of the NoIR modulo c

Thu Dec 03, 2015 9:35 pm

In raspistill add

-awb off -awbg 1.1,1.3

Which are red and blue settings

laparpi
Posts: 12
Joined: Wed Dec 02, 2015 7:08 pm

Re: How do I set a costum white balance of the NoIR modulo c

Thu Dec 03, 2015 10:14 pm

But I have just a blue filter

which have I to write?

1) -awb off -awbg 1.1,1.3
2) -awb off -awbg 1.1
3) -awb off -awbg 1.3

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6526
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How do I set a costum white balance of the NoIR modulo c

Thu Dec 03, 2015 10:37 pm

laparpi wrote:But I have just a blue filter

which have I to write?

1) -awb off -awbg 1.1,1.3
2) -awb off -awbg 1.1
3) -awb off -awbg 1.3
You MUST specify both values.
The camera has red, green, and blue detectors. What you're trying to do is desensitise it to blue due to your blue filter. So you'll want a high gain for red, and a low gain for blue. Green is always treated as being at x1.0.
(What the article is really talking about is locking the AWB algorithm once it has adapted so that the blue reference image is seen as grey. It is possible to lock AWB after it has run for a number of frames, but I don't know whether it will adapt far enough to make the blue into grey - the Pi algorithm is more advanced than the "gray world" algorithm that I suspect the Canon is adopting when in manual mode. With the Pi camera, you're probably better off going for a full manual white balance, although that does really require controlled lighting.)
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

laparpi
Posts: 12
Joined: Wed Dec 02, 2015 7:08 pm

Re: How do I set a costum white balance of the NoIR modulo c

Thu Dec 03, 2015 10:59 pm

Sorry I am a beginner ...
so I point the camera board with blue filter forward a deep blue surface in sunlight and then press enter at this command: raspistill -awb off -awbg 1.1,1.3 .

After this, if I take a picture of the blue surface, in the picture the surface seems gray. Is it correct?

laparpi
Posts: 12
Joined: Wed Dec 02, 2015 7:08 pm

Re: How do I set a costum white balance of the NoIR modulo c

Thu Dec 03, 2015 11:27 pm

With the Pi camera, you're probably better off going for a full manual white balance, although that does really require controlled lighting.
How to do full manual white balance of NoIR modulo cam?

gordon77
Posts: 3865
Joined: Sun Aug 05, 2012 3:12 pm

Re: How do I set a costum white balance of the NoIR modulo c

Fri Dec 04, 2015 8:55 am

the 1.1 and 1.3 figures probably aren't the ones you need for your purpose. I was just specifying the format.

Try varying the numbers to suit.

gordon77
Posts: 3865
Joined: Sun Aug 05, 2012 3:12 pm

Re: How do I set a costum white balance of the NoIR modulo c

Fri Dec 04, 2015 12:56 pm

I did a bit of experimenting with adjust the colour.

Firstly the normal camera (not noir). I used daylight (sadly not very bright here today!) and adjusted the white part of my test card to have equal R,G and B. This required red to be 1.22, Blue to be 1.43 (green is always 1)
Norm_scr_pic.jpg
Norm_scr_pic.jpg (41 KiB) Viewed 2821 times
Then I swapped to a Noir camera (no filtering) (sorry about the focus) and set that to give equal R,G and B again, this time red = 0.88 and Blue 1.45
noir_scr_pic1.jpg
noir_scr_pic1.jpg (47.14 KiB) Viewed 2821 times
Then I tried the blue filter, which came with the noir camera, in front of the noir camera.. This time red = 0.88, Blue = 0.97.
Not a very good picture though !
noir_scr_pic.jpg
noir_scr_pic.jpg (39.04 KiB) Viewed 2821 times
Gordon

laparpi
Posts: 12
Joined: Wed Dec 02, 2015 7:08 pm

Re: How do I set a costum white balance of the NoIR modulo c

Sat Dec 05, 2015 4:17 pm

ok I'm going to follow your way so I wrote in the terminal "raspistill -awb off -awbg 0.88,0.97" and I took a picture of the tester and a two plants. That is the result. The light was natural cloudy.

http://postimg.org/image/c1t2nw9hv/

laparpi
Posts: 12
Joined: Wed Dec 02, 2015 7:08 pm

Re: How do I set a costum white balance of the NoIR modulo c

Sun Dec 06, 2015 7:39 am

It seems that it is the right direction!

https://publiclab.org/notes/LaPa/12-03- ... modulo-cam

Where can I read more about the command -awbg to set better the parameters of colour?

gordon77
Posts: 3865
Joined: Sun Aug 05, 2012 3:12 pm

Re: How do I set a costum white balance of the NoIR modulo c

Sun Dec 06, 2015 9:44 am

I am not sure there is more to know, you can only adjust the red and blue values.

For more orange you need more Red, and maybe less Blue (you can't change green it's always 1)

laparpi
Posts: 12
Joined: Wed Dec 02, 2015 7:08 pm

Re: How do I set a costum white balance of the NoIR modulo c

Sun Dec 06, 2015 12:14 pm

so the first parameter after -awbg is red, the second is blue. If i write -awbg 1,1 is it means no gain? If it is true to get more orange I must to increase the first and decrease the second? I ask you for confirmation.


laparpi
Posts: 12
Joined: Wed Dec 02, 2015 7:08 pm

Re: How do I set a costum white balance of the NoIR modulo c

Mon Jan 25, 2016 10:07 pm

it seems that awbg 0.88,0.58 is a quite good combination in order to evaluate the plants health by NoIR modulo cam+ blue filter

See https://publiclab.org/notes/LaPa/12-03- ... modulo-cam for more details

Return to “Camera board”