Commit Graph

44 Commits

Author SHA1 Message Date
Kwabena W. Agyeman
30ecbdc4f8 Add white balance control.
You can now get white balance gains from the camera chip and set the
camera to then use these gains again in a new enviorment.
2017-12-31 19:56:02 -05:00
Kwabena W. Agyeman
139cdbdbc9 Add auto gain control ceiling value to be settable by the auto gain
method.

Things are in dB now too. Need to remove the previous settable method.
2017-12-30 23:54:19 -05:00
Kwabena W. Agyeman
b906c5f192 Add auto gain control setting support (#293)
You can now get the auto gain setting in dBs and set the value in dBs.
Example scripts are included. Code was tested on the OV7725.
2017-12-30 23:18:35 +02:00
Kwabena W. Agyeman
7be0a7a182 Add exposure control for all sensors (#292)
* Textual register cleanup.

No functional changes.

* Add exposure control support.

You can now set the exposure for the camera in microseconds (versus an
opaque unknown value previously). First, we have a new method called
get_exposure_us() which will get the expsoure time in microseconds. This
let's you determine what the auto exposure algorithm set the exposure
time to. Second, the previously implmented set_auto_exposure() method
which allows you to turn aec off and on accepts a exposure_us keyword
argument when you turn aec off to manually control the exposure.

The next commit will add support for other sensor types.

* Cleanup register formatting.

No functional changes.

* Add exposure control support for the OV2640.

Register access for this chip is a PITA.

* Formatting Cleanup.

No functional changes.

* Add exposure control for ov9650.

Just doing it for all sensors.

* Add missing 2 factor.

* Added exposure control for the MT9V034.

* Add exposure control example.

Works well on the OV7725.
2017-12-30 15:56:11 +02:00
Kwabena W. Agyeman
046a2e1825 Restore MAIN_FB() size on snapshot()
This fix allows "copy_to_fb" with a different resolution than the
current frame buffer to work. It also allows the frame buffer to be
resized, etc. In particular, the pooling methods I added for optical
flow work again... you'll also be able to scale the frame buffer too.
2017-12-25 18:00:58 -05:00
iabdalkader
8160e9120e Add MT9V034 initial support. 2017-10-24 03:07:17 +02:00
iabdalkader
20c8b66789 Implement sensor soft sleep. 2017-10-05 01:25:49 +02:00
iabdalkader
35ab0a26fc Remove invalid resolutions.
* Fix issue #261
2017-08-29 01:54:43 +02:00
Kwabena W. Agyeman
4d6612609e Add more resolution combinations.
With the new frame rate speed increase folks will be asking for smaller
resolutions to get 85 FPS or so when running an algorithm. This commit
adds all scaled modes of frame sizes we already support. We should be
good now on frame sizes for the present and future now.

Todo - skip frames does not run long enough anymore for auto white
balance and gain to stablize before they are turned off in some scripts.
This needs to be adjusted.
2017-05-26 20:09:59 -04:00
iabdalkader
666ee15992 Enable VSYNC output on IO pin for synchronization. 2017-05-21 22:23:53 +02:00
iabdalkader
b94182dce4 Add new RAW/BAYER pixel format to support 2BPP VGA. 2017-03-12 03:29:49 +02:00
iabdalkader
1b22a29612 Add set_gain/exposure/whitebalance functions.
* Add functions to disable auto functions control and set manual values.
2016-12-29 03:39:06 +02:00
iabdalkader
fd384bf1b0 Export OV7725's lens shading correction function. 2016-12-25 02:45:05 +02:00
iabdalkader
4211e37c53 Remove JPEG enable/disable USBDBG command. 2016-08-14 00:45:34 +02:00
iabdalkader
1cbcb7e434 Add M7 support 2016-08-12 22:43:50 +02:00
iabdalkader
02088a14e1 Rename set_binning to set_windowing. 2016-06-20 22:24:00 +02:00
iabdalkader
968bfde8f2 Add new smaller resolutions.
* Add 40x30, 64x32 and 64x64
2016-06-19 21:27:09 +02:00
iabdalkader
440c9dc8bc Implement binning. 2016-06-03 23:01:28 +02:00
iabdalkader
2e2c563227 Re-implement line filters with Python callbacks. 2016-05-16 14:22:30 +02:00
Kwabena W. Agyeman
80cb701d3b Add missing cam functionality
Added the ability to turn AGC off. Kinda will need the ability to restore
AGC settings back to user specified ones in the future... but, this will
do for now.

Added the ability to turn AEC off. Objectively this function probably
won't be used. But, in low light situations it can help.

Added get_fb() to allow you to get the last image snapshot returned.

There was some old exposure function in the code that was getting
optimized out. So, I deleted the used methods that didn't have any code
in them and commented out the only method that did.
2016-04-27 21:53:06 -04:00
Kwabena W. Agyeman
2fa8227c7b Add AWB/HMirror/VFlip
Added setters for these camera settings. AWB is necessary for color
tracking to work correctly. AGC still runs, which causes lighting
shifts. It may need to be disabled too. Not sure... if I want to do that
or not however, because without it lightning won't get normalized to
remain at a certain level. So, turning AGC off may cause issues in other
ways.
2016-03-25 16:36:10 -04:00
iabdalkader
a4ea3e0e20 Add filter functions
* Filter functions bypass the default line processing in sensor.c, and pre-process lines.
* Processing is done on the fly, i.e. filters are called from after each line is received.
2016-02-20 03:58:40 +02:00
iabdalkader
da15b6a915 * Allow fb compression to be enabled/disabled.
* This allows reading RGB images on PC if needed.
2016-02-18 04:01:41 +02:00
iabdalkader
8fd89db5fe Add Hardware/Software JPEG flags to sensor flags.
* Not used right now.
2016-02-18 03:26:41 +02:00
iabdalkader
d3d7e5dc39 Use typdef's for sensor enum and structs. 2016-02-17 19:46:45 +02:00
iabdalkader
d639df0bfe Cleanup sensor.h comments. 2016-02-17 19:08:56 +02:00
iabdalkader
f8bfbfabe9 Add sensor.get_id function to return PID. 2016-02-10 19:00:05 +02:00
iabdalkader
d4b13d21ce Add support for special effects. 2016-02-09 02:08:07 +02:00
iabdalkader
bcb72ef7ff Use a single resolution table. 2016-02-08 16:11:57 +02:00
iabdalkader
07e0385bf0 Add HQVGA resolution. 2016-02-07 02:32:16 +02:00
iabdalkader
14df7fc05f Add sensor_init0.
* This resets the framebuffer state.
2016-02-06 04:08:39 +02:00
iabdalkader
ec1de1c2eb Replace sensor struct clock polarities with flags. 2016-02-05 02:38:07 +02:00
iabdalkader
5203fd8434 Pass slave address to SCCB_Read/Write
* Add slave address to sensor struct.
* Pass slave address to every SCCB_Read/Write function.
* Pass a pointer to the sensor struct to sensor functions.
2016-01-28 14:09:12 +02:00
iabdalkader
86a141e51a Add set color bar function 2015-07-29 22:32:05 +02:00
iabdalkader
54ae5ff425 Add new resolution for LCD 2015-05-05 13:39:16 +03:00
iabdalkader
e4003e3e96 Enable UXGA 2014-10-06 17:37:51 +02:00
iabdalkader
65cd8a133a Update license
* Switch to MIT
* Add license notice to source files
2014-09-20 05:09:52 +02:00
iabdalkader
9e0136dbc8 Add proper fb locking 2014-08-20 21:17:27 +02:00
iabdalkader
78ad46dd34 Add set_quality for JPEG mode 2014-07-09 04:31:39 +02:00
iabdalkader
185ab2877c ADD JPEG support
* ADD higher resolutions
* Set GPIO to low speed
* Use frame_ready to sync snapshots
2014-06-25 19:47:23 +02:00
iabdalkader
b5587adc65 Add sensor controls 2014-06-21 09:41:27 +02:00
iabdalkader
64b883ceaf Update sensor drivers
* Add set_contrast
* Fix set_brightness
2014-06-19 23:19:11 +02:00
iabdalkader
1e4b6fa8fd Update sources to new HAL 2014-06-18 17:28:46 +02:00
iabdalkader
4df970b418 Move files to OMV 2014-06-14 12:28:45 +02:00