gschwiersch
Posts: 6
Joined: Fri Jun 02, 2017 3:17 pm

PiCamera as Luminosity Sensor?

Tue Dec 05, 2017 1:53 pm

Hi,

I have a team of students who would like to use the PiCamera as a luminosity sensor for Mission Space Lab. Does anyone have any resources on how to do this? (They're investigating light pollution.)

Thanks,
Gail

User avatar
bensimmo
Posts: 2752
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: PiCamera as Luminosity Sensor?

Tue Dec 05, 2017 3:54 pm

I would be looking through here to get ideas
https://picamera.readthedocs.io/

Disable automatic adjusting parts (if possible)

Collect a reading, do some maths.
Collect another reading, do some maths.
Compare reading.

Deciding what to record is probably the hard part ?

IR only, Blue only etc ?
Last edited by bensimmo on Tue Dec 05, 2017 4:56 pm, edited 1 time in total.

gschwiersch
Posts: 6
Joined: Fri Jun 02, 2017 3:17 pm

Re: PiCamera as Luminosity Sensor?

Tue Dec 05, 2017 4:31 pm

That's great, thanks!!!

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

Re: PiCamera as Luminosity Sensor?

Tue Dec 05, 2017 5:01 pm

Not sure exactly what you need but you get some ideas from my auto-guider python script. https://github.com/Gordon999/Pi-AutoGuider

Ignore the auto-guider parts, but is does allow you to set the pi camera and show a graph of luminance of a star, you can also filter as R, G, or B.

Maybe give you some ideas.

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1661
Joined: Fri Oct 14, 2011 8:06 pm
Location: London, United Kingdom
Contact: Website Twitter

Re: PiCamera as Luminosity Sensor?

Wed Dec 06, 2017 8:43 am

If you're happy with decoding some binary you could take pictures in raw YUV format, where Y is luminance.
More info here (including how the binary data is represented): http://picamera.readthedocs.io/en/relea ... yuv-format

sparkie777
Posts: 118
Joined: Tue Nov 27, 2012 4:37 am

Re: PiCamera as Luminosity Sensor?

Wed Dec 06, 2017 9:04 am

I'm running raspberries with the camera modules configured as network cameras suitable for motion detect (on remote machines) like this:

Code: Select all

/usr/bin/mjpg_streamer -o output_http.so -w ./www -i input_raspicam.so -x 1920 -y 1440 -fps 3
to evaluate the brightness remotely I simply issue:

Code: Select all

wget -q http://<ip-address>:8080/?action=snapshot -O - | convert - -colorspace Gray -format \"%[fx:quantumrange*image.mean]\" info:
this throws a single number dependent on the brightness detected. There are many more options supported by 'convert'.

<ip-address> is the ip address of the camera. You can do all locally on your raspberry as well of course.

gschwiersch
Posts: 6
Joined: Fri Jun 02, 2017 3:17 pm

Re: PiCamera as Luminosity Sensor?

Wed Dec 06, 2017 12:27 pm

Thanks Davespice :) !

Bensimmo kindly pointed me in this direction too. Funny thing is... when I went to tell the students about this, they had actually just found it, entirely on their own. (This kind of resourcefulness and independence makes teachers really, really happy :D )
Davespice wrote:
Wed Dec 06, 2017 8:43 am
If you're happy with decoding some binary you could take pictures in raw YUV format, where Y is luminance.
More info here (including how the binary data is represented): http://picamera.readthedocs.io/en/relea ... yuv-format

gschwiersch
Posts: 6
Joined: Fri Jun 02, 2017 3:17 pm

Re: PiCamera as Luminosity Sensor?

Wed Dec 06, 2017 12:29 pm

Thanks for all of your replies :)

Return to “Astro Pi”

Who is online

Users browsing this forum: No registered users and 2 guests