ashokb
Posts: 2
Joined: Tue Aug 19, 2014 9:05 am

Camera module: set exposure to off not working

Tue Aug 19, 2014 9:56 am

Hi, i am using raspberry camera module and
https://github.com/robidouille/robidoui ... aspicam_cv
this library.
When camera parameters are set to default especially awb mode and exposure mode
(default is MMAL_PARAM_AWBMODE_AUTO and MMAL_PARAM_EXPOSUREMODE_AUTO) everything works great.

But when i set exposure to off mode ( MMAL_PARAM_EXPOSUREMODE_OFF) camera shows nothing but a blank screen.
If i set modes other than this it works fine.
I have checked by varying shutter speed from auto to some fixed value(from 1 ms to 100 ms) but still camera shows blank.

I am using this library in qt.
Bellow are the changes i have made in "RaspiCamCv.c" file of above library.

Code: Select all

 
// Set up the camera_parameters to default
   raspicamcontrol_set_defaults(&state->camera_parameters);
   state->camera_parameters.ISO = 400;                    // 0 = auto
   state->camera_parameters.exposureMode = MMAL_PARAM_EXPOSUREMODE_OFF;
   state->camera_parameters.awbMode = MMAL_PARAM_AWBMODE_OFF;
   state->camera_parameters.shutter_speed = 100;
Basically i want to turn off the exposure and awb mode.
Is there anything i am missing ?
Which other parameter i need to set/change in order to work camera in exposure off mode.

User avatar
Redrobes
Posts: 80
Joined: Mon Dec 26, 2011 9:19 pm
Location: S.W. UK
Contact: Website

Re: Camera module: set exposure to off not working

Tue Aug 19, 2014 5:42 pm

Shutter speed of 100 sounds low. Is that 100 uS or does the api specify it as a fraction of a sec. The command line raspistill is in uS and I use something like 10,000 or 100,000 kind of range. Maybe with exposure not on auto its using the too short shutter speed and giving a black image.

ashokb
Posts: 2
Joined: Tue Aug 19, 2014 9:05 am

Re: Camera module: set exposure to off not working

Wed Aug 20, 2014 10:21 am

Hi,
Yes, i was wrong, the speed is in microseconds and i am thinking its in milliseconds. As given in
https://github.com/raspberrypi/userland ... mControl.h
this file its in ms(milliseconds) which is not.

Code: Select all

/// struct contain camera settings
typedef struct
{
int sharpness; /// -100 to 100
int contrast; /// -100 to 100
int brightness; /// 0 to 100
int saturation; /// -100 to 100
int ISO; /// TODO : what range?
int videoStabilisation; /// 0 or 1 (false or true)
int exposureCompensation; /// -10 to +10 ?
MMAL_PARAM_EXPOSUREMODE_T exposureMode;
MMAL_PARAM_EXPOSUREMETERINGMODE_T exposureMeterMode;
MMAL_PARAM_AWBMODE_T awbMode;
MMAL_PARAM_IMAGEFX_T imageEffect;
MMAL_PARAMETER_IMAGEFX_PARAMETERS_T imageEffectsParameters;
MMAL_PARAM_COLOURFX_T colourEffects;
int rotation; /// 0-359
int hflip; /// 0 or 1
int vflip; /// 0 or 1
PARAM_FLOAT_RECT_T roi; /// region of interest to use on the sensor. Normalised [0,1] values in the rect
int shutter_speed; /// 0 = auto, otherwise the shutter speed in ms
float awb_gains_r; /// AWB red gain
float awb_gains_b; /// AWB blue gain
MMAL_PARAMETER_DRC_STRENGTH_T drc_level; // Strength of Dynamic Range compression to apply
} RASPICAM_CAMERA_PARAMETERS;
Thanks... :oops:

User avatar
Redrobes
Posts: 80
Joined: Mon Dec 26, 2011 9:19 pm
Location: S.W. UK
Contact: Website

Re: Camera module: set exposure to off not working

Fri Aug 22, 2014 10:20 pm

No probs. When I code I have gotten into the habit of naming vars with units now. So I would have named that shutter_speed_in_uS or something. Hopefully someone will file that bug and get that fixed.

Return to “C/C++”