qzroadqqx
Posts: 22
Joined: Sat Jan 19, 2013 5:08 pm

CSI Camera, Car and Raspistill . Problems

Fri Jun 28, 2013 9:19 am

I did a test in a car with Raspistill Time Lapse driving to 20-30 Km / h., with the camera pointing to the side, with two major problems:
A) Exposure Time Control
B) geometric image degradation

The problem A is detected by finding multiple images very poorly focused "moved". Exif information displayed exposure times between 1/33 and 1/80 in blurred photos, in the same series most have exposure times less than 1/600 resulting images of acceptable sharpness.
Reading the Raspistill documentation I understand there is no a parameter that forces the exposure time, there are only modes.
Anybody can explain FIXEDFPS and that is used or intended?

Testing with different modes in poorly lit interiors get these exposures
antishake 1/30 not good for car in motion
sports 1/60 not good for car in motion
spotlight 1/6173 Too much speed, almost black unusable image

Any method to force speeds between 1/300 and 1/600?

The problem B is explained by the attached picture, of course the lampost is straight!.
Maybe a problem due to sensor reading system?
ctest123.jpg
Straight lampost from camera in car 20 Km./h.
ctest123.jpg (47.84 KiB) Viewed 4901 times

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24129
Joined: Sat Jul 30, 2011 7:41 pm

Re: CSI Camera, Car and Raspistill . Problems

Fri Jun 28, 2013 9:24 am

You are not really going to fix the problem with the non-straight lamppost. The sensor uses a rolling shutter, so this sort of effect is pretty inevitable. - its the time difference in the top to bottom scan that causes the problem.

Hopefully I'll be able to take a look at the various exposure issues in the nearish future.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

fastmapper
Posts: 27
Joined: Wed Mar 27, 2013 3:54 am

Re: CSI Camera, Car and Raspistill . Problems

Fri Jun 28, 2013 4:25 pm

jamesh wrote:You are not really going to fix the problem with the non-straight lamppost. The sensor uses a rolling shutter, so this sort of effect is pretty inevitable. - its the time difference in the top to bottom scan that causes the problem.

Hopefully I'll be able to take a look at the various exposure issues in the nearish future.
The way to mitigate this problem is to increase the rate at which the imagery is acquired. This means decreasing the time per line and this can be accomplished by increasing the frequency of the pixel clock or decreasing the time between the active portions of sequential lines.

I'm not sure how close the current configuration is to the hardware limits, so there may not be much room for improvement.

qzroadqqx
Posts: 22
Joined: Sat Jan 19, 2013 5:08 pm

Re: CSI Camera, Car and Raspistill . Problems

Sat Jun 29, 2013 6:14 am

The correction of the geometric degradation of the image may be approached from the attitude parameter information of an inertial system as is commonly done with the pushbroom type cameras. The solution :lol: I think is beyond the concept of this cheap camera and also because it has a design "propietary and undisclosed ".

More important in my opinion is the lack of control of exposure time in situations where sharpness is essential even if you get underexposed shots.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24129
Joined: Sat Jul 30, 2011 7:41 pm

Re: CSI Camera, Car and Raspistill . Problems

Sat Jun 29, 2013 7:46 am

fastmapper wrote:
jamesh wrote:You are not really going to fix the problem with the non-straight lamppost. The sensor uses a rolling shutter, so this sort of effect is pretty inevitable. - its the time difference in the top to bottom scan that causes the problem.

Hopefully I'll be able to take a look at the various exposure issues in the nearish future.
The way to mitigate this problem is to increase the rate at which the imagery is acquired. This means decreasing the time per line and this can be accomplished by increasing the frequency of the pixel clock or decreasing the time between the active portions of sequential lines.

I'm not sure how close the current configuration is to the hardware limits, so there may not be much room for improvement.
There may be some leeway of the line length (It's how we change exposure times), but I think the pixel clock is pretty close to max.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

User avatar
rew
Posts: 425
Joined: Fri Aug 26, 2011 3:25 pm

Re: CSI Camera, Car and Raspistill . Problems

Sun Jun 30, 2013 5:49 am

Apparently the max listed clock rate is 92 MHz for 1280x720 @60FPS.
Check out our raspberry pi addons: https://www.bitwizard.nl/shop/

User avatar
jbeale
Posts: 3515
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: CSI Camera, Car and Raspistill . Problems

Sun Jun 30, 2013 7:16 am

According to my datasheet, the OV5647 camera has something called "frame exposure (FREX) mode". Not sure if this really means a global shutter, or it relies on momentary illumination from xenon strobe (essentially an external shutter). Also not sure if this mode is something the R-Pi camera in particular could support.

Code: Select all

page 43
 4.10.1 FREX control
In FREX mode, whole frame pixels start integration at the same time, rather than integrating row by row. After the user-defined exposure time (registers 0x3B01, 0x3B04, 0x3B05), the shutter closes, preventing further integration and the image begins to read out.  After the readout finishes, the shutter opens again and the sensor resumes normal mode, waiting for the next FREX request.

The OV5647 supports two modes of FREX (see figure 4-13):
* mode 1: Frame exposure and shutter control requests come from the external system via the FREX pin. The sensor will send a strobe output signal to control the flash light.
* mode 2: Frame exposure request comes from the external system via the SCCB register 0x3B08[0]. The sensor will output two signals, shutter control signal through the FREX pin and strobe signal through the STROBE pin.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24129
Joined: Sat Jul 30, 2011 7:41 pm

Re: CSI Camera, Car and Raspistill . Problems

Sun Jun 30, 2013 9:50 am

jbeale wrote:According to my datasheet, the OV5647 camera has something called "frame exposure (FREX) mode". Not sure if this really means a global shutter, or it relies on momentary illumination from xenon strobe (essentially an external shutter). Also not sure if this mode is something the R-Pi camera in particular could support.

Code: Select all

page 43
 4.10.1 FREX control
In FREX mode, whole frame pixels start integration at the same time, rather than integrating row by row. After the user-defined exposure time (registers 0x3B01, 0x3B04, 0x3B05), the shutter closes, preventing further integration and the image begins to read out.  After the readout finishes, the shutter opens again and the sensor resumes normal mode, waiting for the next FREX request.

The OV5647 supports two modes of FREX (see figure 4-13):
* mode 1: Frame exposure and shutter control requests come from the external system via the FREX pin. The sensor will send a strobe output signal to control the flash light.
* mode 2: Frame exposure request comes from the external system via the SCCB register 0x3B08[0]. The sensor will output two signals, shutter control signal through the FREX pin and strobe signal through the STROBE pin.
It may be that the datasheet refers to the version that actually has a shutter. I've never heard of that mode tbh. I'll see if I can find out more.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

User avatar
jbeale
Posts: 3515
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: CSI Camera, Car and Raspistill . Problems

Sun Jun 30, 2013 3:40 pm

If you have access to these registers, you could see what happens. But probably there is some involved setup required, if indeed the R-Pi camera module implements it.

I note the existing R-Pi control does set 0x3B07 (STROBE_FREX_MODE_SEL) to 0x0C (0000 1100). But 0x3B06 (FREX CTRL) and 0x3B08 (STROBE_FREX_EXP_REQ) is never touched. Not sure what that means; the data sheet doesn't tell the full story.

Code: Select all

 seconds: pnum: addr:dat R/W
------------------------------------
0.227646: 0062: 3b07:0c Write
0.228036: 0063: 3b07:0c Read
5.414733: 0321: 3b07:0c Write
5.415123: 0322: 3b07:0c Read
5.869362: 0540: 3b07:0c Write
5.869752: 0541: 3b07:0c Read

youngshik
Posts: 1
Joined: Fri Oct 04, 2013 4:29 pm

Re: CSI Camera, Car and Raspistill . Problems

Fri Oct 04, 2013 5:29 pm

'FREX' I do not know what to where the settings.
How to set up the need to give more specific.
'0x3B07 (STROBE_FREX_MODE_SEL) to 0x0C (0000 1100) '
Where would that setting?
What is the name of the file?
Translator will translate into one if he do not know the syntax.

User avatar
jbeale
Posts: 3515
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: CSI Camera, Car and Raspistill . Problems

Fri Oct 04, 2013 6:22 pm

Please ignore this thread, it was only for JamesH. As far as I know you cannot set those registers yourself; camera control is done from GPU only which is closed, there is no direct user access. It is done by the GPU driver.

arcanon
Posts: 36
Joined: Wed Nov 14, 2012 9:18 am

Re: CSI Camera, Car and Raspistill . Problems

Sat Oct 26, 2013 12:00 pm

@james

which code controls the "line length"? can we try alter this without firmware/driver updates?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24129
Joined: Sat Jul 30, 2011 7:41 pm

Re: CSI Camera, Car and Raspistill . Problems

Sat Oct 26, 2013 2:12 pm

arcanon wrote:@james

which code controls the "line length"? can we try alter this without firmware/driver updates?
No, its hardwired in to the GPU binary. And you cannot just change the line length arbitrarily as that will change the exposure time - the AWB system needs to knows what is going on.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

Return to “Camera board”