-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mapping of exposure time to register exposure value is wrong for ov5647. #20
Comments
I am quite confused. picamera and https://github.com/GustavEngdahl/raspiraw seem to behave differently: RaspiRaw: Probing sensor ov5647 on addr 36 picamera: 11710447-11710447 I²C: Address/Data: Start I think its especially weird that raspiraw writes the same data to 3500/3501/3502 than to 380E/380F. |
I did some testing. The correction above is not included in Gustav Engdahls raspiraw. When I patch Gustavs fork of raspiraw with his suggestion the results are better but I encountered 2 problems:
Edit: 6 s work. I do not now why not in the first place. More than 6s does not lead to longer exposures. Maybe 0x380A<<8+0x380B has a maximum of 0x7FFF? |
The following lines in raspiraw.c:
if (cfg.exposure_us != -1)
{
cfg.exposure = ((int64_t)cfg.exposure_us * 1000) / sensor_mode->line_time_ns;
vcos_log_error("Setting exposure to %d from time %dus", cfg.exposure, cfg.exposure_us);
}
Does not work well for the ov5647 since the register need scanlines of 1/16.
The following works ok.
if (cfg.exposure_us != -1)
{
cfg.exposure = 16*((int64_t)cfg.exposure_us * 1000) / sensor_mode->line_time_ns;
vcos_log_error("Setting exposure to %d from time %dus", cfg.exposure, cfg.exposure_us);
}
The documentation of the ov5647 does not clearly state so, but ov5648 does and when testing the ov5647 it was clear that the set exposure time was not correct.
I'm not sure how the other supported camera-modules work but I guess the configuration structs need some sort of new factor integer to enable a correct time-to-scanline conversion.
Any thoughts on this?
/Gustav
The text was updated successfully, but these errors were encountered: