11

I am taking pictures in very dark environment, and I would like to obtain a brighter image. How do I increase the exposure time? I've tried the following:

  • different exposure mode, like night, verylong, etc
  • set the shutter speed to different values
  • tried different framerate (from 1 to 80)
  • different exposure_compensation (0 to 24)

No matter what settings I use, I still get 33158 as the shutter speed when the images are being taken (yes, even if I set the shutter speed manually to a much higher value, it is still 33158). How to solve this problem? If I set the shutter speed to a lower value like 10000 or even 1000, then it works, but in that case the image is even darker (not what I want).

I also tried different brightness, but since I would like my image to cover the full range of pixels (from 0 to 255), I found brightness=50 the best (with brightness=60, even the darkest part of the image has a pixel value of about 40).

So, what else can I do to increase the exposure or change other settings of the camera so I can obtain a brighter image in a very dark environment?

thanks

Physicist
  • 211
  • 1
  • 2
  • 3
  • 1
    what software are you using? This page may be useful: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=61445 it seems the exposure is software limited to 2 seconds – Darth Vader Jun 10 '15 at 10:53
  • how do I check which software I'm using? I'm just using the webcam for raspberry pi and the picamera module for the code. – Physicist Jun 11 '15 at 08:54
  • so are using the LX terminal, or are you using python code? – Darth Vader Jun 11 '15 at 10:59
  • I use LX terminal to open the python editor (I type 'sudo spe' and spe is the python editor) to write the codes – Physicist Jun 11 '15 at 15:36
  • so you are coding in python, try using the shutter_speed attribute and set it to a really large value like 2000000000 – Darth Vader Jun 11 '15 at 16:27
  • the problem is that no matter how large the shutter_speed value is, the output shutter_speed (I use print shutter_speed before the capture() to check the shutter_speed) is STILL 33158. Yes, ALWAYS 33158, unless I set the shutter_speed to a value LOWER than 33158 then I end up with a lower shutter_speed – Physicist Jun 12 '15 at 12:15
  • check out the second link in my answer, seems someone got an exposure time of 6 seconds, and there is a lot of useful information there which should explain some of your problems – Darth Vader Jun 12 '15 at 17:33

3 Answers3

5

Although raspberry camera has lot of limitations it is possible to take pictures in very dark environment.

My best night mode for raspberry pi camera is with this settings:

raspistill -w 2592 -h 1944 -ISO 800 -ss 6000000 -br 80 -co 100 -o out.jpeg

where:

  • -w and -h are forced size (it is for cam v1.3 - 5Mpix)
  • -ISO 800 is best ISO value, camera also support ISO 1600 but only in sport mode where the shutter time is limited only to 1/60s
  • -ss 6000000 it is shutter time in microseconds (6s) it is the maximum what is possible to set for this camera module
  • additionally it is possible to configure brightness and contrast with -br and -co parameters, where best values are for brightness 80 and for contrast 100 (contrast increase noise)

Optionally for noise reduction is best to make more pictures and calculate average or median using imagemagic tools:

convert out_*.jpeg -average avg.jpeg
convert out_*.jpeg -evaluate-sequence median avg.jpeg

From my experience is resonably reduced noise with median from 5 pictures

Btw, if shutter speed is set to 6 seconds, then raspistill will run about 40s, probably it make more pictures before to calculate white balance or noise reduction process or don't know what exactly.

vlk
  • 291
  • 5
  • 6
0

These webpages may be useful to you:

https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=61445

https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=85856

It seems currently the exposure is software limited to 2 seconds, the problem being shutter speed is controlled in nanoseconds. For long exposures it would result in ridiculously big numbers. So your alternative would be increasing the ISO, but that is going to reduce the quality of the image.

Darth Vader
  • 4,206
  • 24
  • 45
  • 69
0

I had a lot of trouble with this as well. Even for stills the framerate must be adjusted to adjust for long camera shutter times. The manuals all say framerate 1/10 but 1/9 was the best I could get it to do.

# set camera
camera.framerate = 1/9
camera.shutter_speed = 33000     # 150 ... to .... 9000000


# check camera exposure on last capture
test_shutter_speed = camera.exposure_speed

shutter_speed is what you want, exposure_speed is what you actually happened

if you capture the image you can use PIL and numpy to check the brightness of the last image to help adjust the next shutter speed

from PIL import Image
import numpy as np

camera.capture('filename.jpg')

im = Image.open('filename.jpg')

brightness = np.mean(im)