I have found that using raspistill
with the --timeout
option to significantly reduce the time before the camera takes a photo doesn't give the camera enough time to choose good exposure parameters (e.g. shutterspeed and iso).
My aim is to 'calibrate' the camera to the lighting conditions by taking a photo normally using raspistill
(without the --timeout
) and then use the values which raspistill
chose for the shutter speed and iso for all future photos.
I am doing this inside a C++ program, using system()
to call raspistill
. I thought I could use exiftool (or similar) to extract the shutterspeed and iso from the exif data attached to the initial 'calibration' photo. However, the shutter speed in the exif data is recorded as a string representation of a fraction, e.g. '1/8'.
I have found this patch for specifying shutterspeed as a fraction but it is quite old and doesn't seem to have been merged into the official code. I'm assuming there was a reason behind this. I am also hesitant about downloading and making userland because I read somewhere that you could end up with a dead pi.
Does anyone either
- know whether this patch is stable (and could you tell me how to integrate it?),
- know of a way to parse a cstring (
char*
) containing something like "1/8" to convert it to a value in microseconds (aninteger
,double
or as astring
), - know of any other way to accomplish what I want?
Thank you very much in advanced.