OV7725 Camera Module Software Application Notes
OV7725 Camera Module
Last Modified: Dec 12
th
, 2007
OmniVision Technologies, Inc. reserves the right to make changes without further notice to
any product herein to improve reliability, function or design. OmniVision does not assume
any liability arising out of the application or use of any project, circuit described herein;
neither does it convey any license under its patent nor the right of others.
Sensor datasheet is the official document of OmniVision. Software/hardware/dual camera
applicaton notes are application guide lines for reference. If there are any difference
between sensor datasheet and application notes, please follow sensor datasheet and
kindly report the difference to OVT FAE.
This document contains information of a proprietary nature. None of this information shall
be divulged to persons other than OmniVision Technologies, Inc. employee authorized by
the nature of their duties to receive such information, or individuals or organizations
authorized by OmniVision Technologies, Inc.
1
Company Confidential
O
VT
C
on
fid
Document Revision: 1.04
en
tia
lF
or
Su
nn
y
Software Application Note
OV7725 Camera Module Software Application Notes
Table of Contents
OV7725 Camera Module..................................................................................................................... 1
Software Application Note................................................................................................................... 1
1. Select Output format....................................................................................................................4
1.1 Backend with full ISP........................................................................................................... 4
1.2 Backend with YCbCr ISP..................................................................................................... 5
1.3 Backend without ISP.............................................................................................................5
1.4 Equations to Convert from One Format to Another............................................................. 5
2. Select Output Resolution............................................................................................................. 6
2.1 Backend with ISP..................................................................................................................6
2.2 Backend without ISP.............................................................................................................6
3. Adjust frame rate......................................................................................................................... 6
3.1 Frame Rate Adjustment for 24Mhz input clock....................................................................6
30 fps, PCLK = 24Mhz.......................................................................................................... 6
15 fps, PCLK = 12Mhz.......................................................................................................... 7
25fps, PCLK = 24Mhz........................................................................................................... 7
14.3fps, PCLK = 12Mhz........................................................................................................ 7
3.2 Frame Rate Adjustment for 26 Mhz input clock...................................................................7
30 fps, PCLK = 26Mhz.......................................................................................................... 7
15 fps, PCLK = 13Mhz.......................................................................................................... 8
25fps, PCLK = 26Mhz........................................................................................................... 8
14.3fps, PCLK = 13Mhz........................................................................................................ 8
3.3 Frame rate adjustment for 13 Mhz input clock..................................................................... 9
30 fps, PCLK = 26Mhz.......................................................................................................... 9
15 fps, PCLK = 13Mhz.......................................................................................................... 9
25fps, PCLK = 26Mhz........................................................................................................... 9
14.3fps, PCLK = 13Mhz........................................................................................................ 9
4. Night Mode................................................................................................................................ 10
4.1 Night Mode with Fixed Frame Rate................................................................................... 10
For 24Mhz/26Mhz Clock Input............................................................................................10
For 13Mhz Clock Input........................................................................................................ 10
4.2 Night Mode with Auto Frame Rate.....................................................................................10
For 24Mhz/26Mhz Clock Input............................................................................................10
For 13Mhz Clock Input........................................................................................................ 11
5. Remove Light Band................................................................................................................... 12
5.1 Light Band...........................................................................................................................12
5.2 Remove Light band............................................................................................................. 12
5.3 Select Banding Filter by Region Information..................................................................... 12
Banding Filter Setting for 24Mhz Input Clock.................................................................... 13
5.4 When Light Band can not be Removed.............................................................................. 14
6. White Balance............................................................................................................................14
6.1 Simple White Balance.........................................................................................................14
6.2 Advanced White Balance....................................................................................................14
6.3 How to select?..................................................................................................................... 15
7. Defect Pixel Correction............................................................................................................. 15
2
O
VT
C
on
fid
en
tia
lF
or
Su
nn
y
Company Confidential
OV7725 Camera Module Software Application Notes
8. BLC............................................................................................................................................15
9. Video Mode............................................................................................................................... 15
10. Digital zoom............................................................................................................................ 16
11. OV7725 Functions...................................................................................................................16
11.1 Light Mode........................................................................................................................16
11.2 Color Saturation................................................................................................................ 17
11.3 Brightness..........................................................................................................................18
11.4 Contrast............................................................................................................................. 19
11.5 Special effects................................................................................................................... 20
12. Deal with Lens......................................................................................................................... 21
12.1 Light fall off...................................................................................................................... 21
12.2 Dark corner....................................................................................................................... 21
12.3 Resolution......................................................................................................................... 21
12.4 Optical contrast................................................................................................................. 21
12.5 Lens Cover........................................................................................................................ 22
12.6 Lens Correction.................................................................................................................22
13. Reference Settings................................................................................................................... 22
13.1 YCbCr............................................................................................................................... 22
13.2 RGB raw........................................................................................................................... 24
13.3 RGB565............................................................................................................................ 24
3
O
VT
C
on
fid
en
tia
lF
Company Confidential
or
Su
nn
y
OV7725 Camera Module Software Application Notes
1. Select Output format
OV7725 support 4 output formats: YCbCr, RGB565/RGB555, Bayer raw RGB and Processed raw
RGB. How to choose the right output format for camera phone design or other applications? Let's
look at the backend chip first.
The general diagram of backend chip is as below:
Camera Interface
YCbCr
RGB
Bayer raw RGB
Processed raw RGB
X
LCD Driver
Memory Interface
This kind of backend has full ISP. It takes raw RGB input, doing interpolation to generate
RGB24 and doing translation to generate YCbCr. This kind of backend could take either Bayer raw
RGB or processed raw RGB.
The advantage of processed raw RGB over Bayer raw RGB is the output data are processed.
Sensor functions such as defect pixel correction, lens correction, gamma, color matrix, de-noise,
sharpness, BLC etc. could be applied. Since the life time of backend chip is longer than image
sensor, sometimes backend chips could not fix defects of new sensors if taken Bayer raw RGB. But
the defects of new sensors could be fixed in processed raw RGB output.
If backend take Bayer raw RGB format from sensor, all the image process operations such as
defect pixel correction, lens correction, gamma, color matrix, de-noise, sharpness, BCL etc should
be done by backend. If backend take processed raw RGB format from sensor, the image process
operations such as defect pixel correction, lens correction, gamma, color matrix, de-noise,
4
O
VT
1.1 Backend with full ISP
C
on
The data format at LCD driver are always RGB. For example, RGB444, RGB565, RGB555,
RGB888 etc. The data format and memory interface are always Compressed. The Compression data
is compressed from YCbCr data. So Both RGB and YCbCr data are needed inside the backend
chip. The “X” block is different for different backend chips.
fid
en
tia
lF
or
JPEG
Company Confidential
Su
nn
y
RGB
OV7725 Camera Module Software Application Notes
sharpness, BCL etc could be done either inside sensor or by backend chips. In other words, user
could select the image process operation be done by which side.
1.2 Backend with YCbCr ISP
This kind of backend has ISP, but could take only YCbCr format. The ISP could convert YCbCr
to RGB format for LCD display and compress YCbCr for storage.
1.3 Backend without ISP
This kind of backend doesn't have ISP built-in. It can not convert from one format to another by
hardware. Actually the format conversion is done by software. There are 3 possible solution for this
kind of backend chips.
a. Sensor output YCbCr. Backend convert YCbCr to RGB for display by software.
b. Sensor output RGB565. Backend convert RGB565 to YCbCR for compression.
c. Sensor output RGB565 for preview, output YCbCr for capture ( compression).
Solution a. provide the best picture quality. Since the input data is 24-bit RGB equivalent. It
could converted to RGB888 for LCD display. Solution b. provide the worst picture quality. Since
the input data is only 16-bit RGB565, even it is converted to YCbCr, the color depth is still 16-bit.
The solution c. provide similar picture quality as solution a. But since preview is RGB565, capture
is YCbCr, preview picture may looks a little different than capture picture.
1.4 Equations to Convert from One Format to Another
YCbCr to RGB24
Y = 0.299R + 0.587G + 0.114B
Cb = 0.568(B-Y) + 128 = –0.172R – 0.339G + 0.511B + 128
Cr = 0.713(R-Y) + 128 = 0.511R – 0.428G – 0.083B + 128
Y = ((77 * R + 150 * G + 29 * B) >> 8);
Cb = ((-43 * R - 85 * G + 128 * B) >> 8) + 128;
Cr = ((128 * R - 107 * G - 21 * B) >> 8) + 128;
RGB24 to YCbCr
R = Y + 1.371(Cr – 128)
G = Y – 0.698(Cr – 128) – 0.336(Cb – 128)
B = Y + 1.732(Cb – 128)
5
Company Confidential
O
VT
C
on
fid
en
tia
lF
or
Su
nn
y
评论