1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>Camera Library: Overview</TITLE>
8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">Camera Library: Overview</H1>
12<P>
13The TWL system includes two cameras. Although cameras can be controlled separately, it is not possible to obtain images from both cameras simultaneously.<BR><BR> The camera library cannot be used in CODEC-DS mode. Always use CODEC-TWL mode.<BR><br> Use the API to control camera operations.
14</P>
15<H2>Basic Camera Specifications</H2>
16<P>
17The basic camera specifications are listed below.
18</P>
19<ul>
20<li>Aperture: F2.8 (Fixed)</li>
21<li>Focal length: 20 cm&ndash;infinity</li>
22<li>Maximum resolution: VGA (variable)</li>
23<li>Maximum frame rate: 30 fps (fps: frames per second)</li>
24<li>Output format: YCrCb422 (RGB conversion circuit available)</li>
25<li>Effect processing</li>
26<li>Flipping</li>
27<li>Capture mode setting</li>
28<li>White balance setting</li>
29<li>Exposure (illumination time) setting</li>
30<li>Sharpness setting</li>
31</ul>
32<P>
33Of these, the resolution, effect, and flipping are handled in two contexts for each camera. It can be faster to switch contexts than to set these separately.<BR> The library automatically puts the cameras in standby mode when the hardware is reset or put to sleep. To enable the camera after recovering from sleep, the application must implement the process.
34</P>
35
36<P><h2>Default Camera Settings</h2></P>
37<p>
38Contexts handle the following default values when the cameras are started (when the <code><A href="CAMERA_Init.html">CAMERA_Init</A></code> function is called).
39</p>
40<p>Inner Camera: Context A
41<table>
42<tr><td>Resolution</td><td><A href="CAMERASize.html">CAMERA_SIZE_DS_LCD</A></td></tr>
43<tr><td>Effect</td><td><A href="CAMERAEffect.html">CAMERA_EFFECT_NONE</A></td></tr>
44<tr><td>Flipping</td><td><A href="CAMERAFlip.html">CAMERA_FLIP_HORIZONTAL</A></td></tr>
45</table></p>
46<p>Inner Camera: Context B
47<table>
48<tr><td>Resolution</td><td><A href="CAMERASize.html">CAMERA_SIZE_VGA</A></td></tr>
49<tr><td>Effect</td><td><A href="CAMERAEffect.html">CAMERA_EFFECT_NONE</A></td></tr>
50<tr><td>Flipping</td><td><A href="CAMERAFlip.html">CAMERA_FLIP_HORIZONTAL</A></td></tr>
51</table></p>
52<p>Outer Camera: Context A
53<table>
54<tr><td>Resolution</td><td><A href="CAMERASize.html">CAMERA_SIZE_DS_LCD</A></td></tr>
55<tr><td>Effect</td><td><A href="CAMERAEffect.html">CAMERA_EFFECT_NONE</A></td></tr>
56<tr><td>Flipping</td><td><A href="CAMERAFlip.html">CAMERA_FLIP_NONE</A></td></tr>
57</table></p>
58<p>Outer Camera: Context B
59<table>
60<tr><td>Resolution</td><td><A href="CAMERASize.html">CAMERA_SIZE_VGA</A></td></tr>
61<tr><td>Effect</td><td><A href="CAMERAEffect.html">CAMERA_EFFECT_NONE</A></td></tr>
62<tr><td>Flipping</td><td><A href="CAMERAFlip.html">CAMERA_FLIP_NONE</A></td></tr>
63</table></p>
64<p>By default, both the inner and outer cameras are in context A.<BR><BR>Contexts do not handle the following default values.
65<p>Inner Camera
66<table>
67<tr><td>Frame rate</td><td><A href="CAMERAFrameRate.html">CAMERA_FRAME_RATE_15</A></td></tr>
68<tr><td>Photo mode</td><td><A href="CAMERAPhotoMode.html">CAMERA_PHOTO_MODE_PORTRAIT</A></td></tr>
69</table></p>
70<p>Outer Camera
71<table>
72<tr><td>Frame rate</td><td><A href="CAMERAFrameRate.html">CAMERA_FRAME_RATE_15</A></td></tr>
73<tr><td>Photo mode</td><td><A href="CAMERAPhotoMode.html">CAMERA_PHOTO_MODE_NORMAL</A></td></tr>
74</table></p>
75<BR>Common settings for the inner and outer cameras take the following default values.
76<p>
77<table>
78<tr><td>Output Format</td><td><A href="CAMERAOutput.html">CAMERA_OUTPUT_YUV</A></td></tr>
79<tr><td>Number of Lines to Transfer</td><td>1 line</td></tr>
80</table></p>
81<p>See the links for specific descriptions of the parameter meanings.</p>
82</p>
83
84<P><h2>RGB Conversion</h2></P>
85<p>
86The camera gets image data in the YCrYCb (YUV4:2:2) format or the RGB (RGB5:5:5) format.<BR><BR>YUV422 is converted into RGB8:8:8 as follows.
87
88<PRE>
89R = 1.000 x Y                     + 1.402 x (V - 128)
90G = 1.000 x Y - 0.344 x (U - 128) - 0.714 x (V - 128)
91B = 1.000 x Y + 1.772 x (U - 128)
92</PRE>
93</p>
94<p>
95The results of the calculation will be rounded off if they are less than 0 or exceed 255. Then they will be scaled to the range [0&ndash;31], after which they will be in RGB555 format.<BR><BR>The formulas for the reverse conversion (i.e., converting RGB555 to YUV422) are shown below:
96
97<PRE>
98Y =  0.299 x R + 0.587 x G + 0.114 x B
99U = -0.169 x R - 0.331 x G + 0.500 x B + 128
100V =  0.500 x R - 0.419 x G - 0.081 x B + 128
101</PRE>
102</p>
103<H2>See Also</H2>
104<P><CODE><A href="list_camera.html">CAMERA Function List</A><BR></CODE></P>
105<H2>Revision History</H2>
106<P>
1072008/10/06 Described camera library CODEC mode restrictions.<br> 2008/09/11 Added a description of initial values of the camera.<br> 2008/04/21 Added shooting mode for initial values of camera settings.<BR> 2008/03/17 Added a description of operations during hardware reset and during sleep mode.<BR> 2007/11/14 Initial version.
108</P>
109<hr><p>CONFIDENTIAL</p></body>
110</HTML>