1

I am using "Raspicam" (https://www.raspberrypi.org/documentation/hardware/camera.md) for a robotics project, where I need to get as many images as possible in 1 seconds.

Camera works perfectly fine when I use it at stationary mode. However, everything appear quite dark when I switch it to 90fps, 320x240.

At the end, I will be processing the image, so low resolution is not a problem, its actually an advantage for me. However I can't compromise the quality of colors, since entire processing will depend on that.

I have following properties to adjust:

  • CV_CAP_PROP_BRIGHTNESS: [0,100]

left this at automatic mode -1

  • CV_CAP_PROP_CONTRAST: [0,100]

left this at automatic mode -1 as well

  • CV_CAP_PROP_SATURATION: [0,100]

used 100

  • CV_CAP_PROP_GAIN: (iso): [0,100]

used 100

  • CV_CAP_PROP_EXPOSURE: -1 auto. [1,100] shutter speed from 0 to 33ms

used 100

  • CV_CAP_PROP_WHITE_BALANCE_RED_V : [1,100] -1 auto whitebalance

left it at automatic mode (anything nonzero messed the image up for some reason)

  • CV_CAP_PROP_WHITE_BALANCE_BLUE_U : [1,100] -1 auto whitebalance

left it at automatic mode

Is there a way to improve the quality of the images I get at 90fps using those values? What might be causing the darkness of my image?

Here is the image I have at 90 fps:

enter image description here

Here is the image I have in stationary mode (resolution is higher in this one, I just uploaded it to show what actual colors were supposed to look like):

enter image description here

  • You list the settings, but do not specify what values you used for them when taking the images. What exact settings did you change between the two images that you posted? – null Feb 23 '16 at 15:19
  • Just added them. – ozgeneral Feb 23 '16 at 15:27
  • Does a CV_CAP_PROP_EXPOSURE value of 100 correspond to 33 ms shutter? Maybe I'm missing something, but 90 fps corresponds to an absolute max shutter speed of 1/90 = 0.011111 s = 11.1 ms. – scottbb Feb 23 '16 at 17:58
  • You are right, I have missed that. I just set the shutter speed to ~9ms but sadly that did not fix the problem. – ozgeneral Feb 23 '16 at 18:23
  • 2
    I'm voting to close this question as off-topic because it is about machine vision and image processing, not photography. – mattdm Feb 23 '16 at 23:03
2

TL;DR

Not much, really. A shutter speed of 11ms, indoor, with low light, is a difficult situation even for a professional camera.


Longer

Note: my English is limited, and I reply with just the information I could find about the Raspicam.

I suppose you are making the usual mistake of confounding frame rate (fps) with shutter speed; they are similar, yet unrelated.

Shutter speed is the length of time the camera sensor is exposed to light: the longer light is allowed to enter the camera and hit the sensor inside, the brighter the final image will be; e.g. a shutter speed of 10ms means that the shutter is open for 10ms and that the sensor receives light for that amount of time.

Frame rate is, instead, the rate at which the camera records the frames: without going too much into detail, 90fps means that every 1/90 of a second the camera takes whatever signal is on the sensor and generates a new frame. There is no duration here: what is there is there.

So, if you set your shutter speed to 11ms it means that your shutter opens, the sensor receives light for 11 ms, then the shutter closes, and so on. And sincerely, at 1/90 of shutter speed indoor in poor light condition without a flash you can't hope much even from good gear, much less from a toy camera like the Raspicam.

So what can you do, in the end?

Well...it depends.

The Raspi has separate settings for frame rate and shutter speed. So, you can keep the 90fps if you really need it and change the shutter speed to try to achieve something if the conditions allow for it. Theory states that your shutter speed should be twice the frame rate, so for a frame rate of 90fps (1/90) your shutter speed should be 5.5ms (1/180); this is a good rule of thumb, but you can ignore it if the results fit your needs and, for example, try to do the opposite. I seriously doubt you'll end up with something good, but yet, there's no harm in trying.

  • Why don't I encounter this darkness problem in stationary images then? I mean, for a stationary image, it catches more than enough light. I tried to reduce fps to 30, but quality did not improve at all which I did not expect. I started to doubt if this is not due to high fps, maybe some settings are done wrongly in camera mode. But since I am not aware of the concept, I have no idea what might be wrong. – ozgeneral Feb 23 '16 at 21:37
  • 1
    If by "stationary" you mean a still image via the raspistill command, maybe it's because the still image is produced in Auto mode with the camera choosing the right settings to get the proper illumination. By your comment, I have the feeling you are not that much into even basics of photograpy to understand how the entire thing works; if you plan to really use that camera, try to just do a quick search on the Internet for the terms "shutter speed". – motoDrizzt Feb 23 '16 at 22:37
  • Uh, and by the way...thank for the trust, but if my answer did not help you to solve the problem, don't mark it as accepted. This will encourage others to post new answers (hopefully more effective in solving the problem, then) :-) – motoDrizzt Feb 23 '16 at 22:40
  • Your answer was quite informative, I think it covers what this site can say about my problem. I was hoping people here could tell what was missing in the dark image by experience. All answers seem to be related with automatic settings and shutter speed but it seems like its not possible to say "..." is missing by just looking at the images. So I will start by converging on shutter speed and how automatic settings are done and see where it gets me. Thanks a lot again, you were quite helpful. :) – ozgeneral Feb 24 '16 at 6:54
1

If this problem can be resolved, this is likely what causes it:

left this at automatic mode -1

You left a lot of the settings on automatic mode. Automatic mode means that you give away a lot of control over what's going on.

Maybe the camera is not able to do all the calculations for all the automatic modes when the frame rate is raised.

Change all the settings to some value different from auto so that you get a decent result.

Then try if you still get the same results for different frame rates.

The best approach to prevent changing image results (from a static scenery) is to keep the camera settings constant.

This is pretty much as far as the scope of this site goes.


If the issue is still there, try to use the camera with other software.

Use the built-in software as described in the documentation and see if you have the same issue with that software.

The whole thing is likely a software or hardware issue, which is not within the scope of this site. Try to ask the question on http://raspberrypi.stackexchange.com, which has this question that appears to be related:

Raspicam C++ library — captured image requires several grab()s to be properly bright

1

Is it possible to improve the quality of images I grab at 90fps?

Sure. You need to add more light.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.