How Camera works?

The higher the pixel of the mobile phone, the clearer the photos taken.

1. Camera structure

The first camera was the kind of manual focus, that is, turning the motor so that the photosensitive chip can receive the best signal, commonly known as focusing.

2. The most primitive Camera imaging principle

When it comes to imaging principles, we have to say that pinhole imaging, that is, with pinhole imaging, we have such a magical thing as a camera.

Pinhole imaging is a relatively old method. With the development of current technology, new methods have been used to replace pinhole imaging. Because the hole for pinhole imaging is very small, it also causes many limitations in shooting.

3. How the Modern Camera Works

The working principle of the camera is that after the external light passes through the lens, it is filtered by the color filter and then irradiated on the Sensor surface. The Sensor converts the light transmitted from the lens into an electrical signal, and then converts it into a digital signal through the internal AD. If the Sensor does not integrate DSP, it will be transmitted to the baseband by means of DVP, and the data format at this time is RAW DATA. If DSP is integrated, the RAW DATA data will be processed by AWB, then color matrix, lens shading, gamma, sharpness, AE and de-noise (the mobile phone usually does it on the cpu isp side), and then output the data in YUV or RGB format. Finally, the CPU will send it to the framebuffer for display, so that we can see the scene captured by the camera.

4. Camera hardware schematic

VDD_CAMA28 ---- analog voltage of 2.8v camera
VDD_CAMD28 ----1.5v camera working voltage
VDD_CAMIO28 ---- 2.8v camera's GPIO port digital voltage

CAM_DATA: The data pin of the camera. The output formats of this data pin are YUV, RGB, JPEG
CAM_VSYNC: The frame synchronization signal pin of the camera. The end of a VYSNC signal indicates that the data of one frame (ie, one picture) has been output.
CAM_HSYNC: camera line sync signal pin. The end of an HSYNC signal indicates that one line of data has been output.
CAM_PCLK: Pixel sync signal pin. The end of a PCLK signal indicates that a data has been output


CAM_PWDN: camera enable pin. When the camera is in PWDN mode, all operations on the camera are invalid. Therefore, before RST, the PWDN pin must be set to normal mode

CAM_RST: The reset pin of the camera. This mode is a hard reset mode. Generally, the pin is set to low, the camera is in a hard reset state, and each IO port of the camera is restored to the factory default state. Only after XCLK is turned on, set RESET to low, the hard reset will be valid, otherwise the reset will be invalid.

CAM_MCLK: camera working clock pin. This pin provides the working clock of the camera for the master

CAM_I2C: The communication pin between the camera and the main controller The main communication interface of the camera is i2c, and the data transmission is mipi

When we are debugging the software, the camera is roughly as follows:

The first step: power on the sensor and output the clock signal;

Step 2: Then communicate through i2c, by sending the address, the cpu finds the camera;

Step 3: When the camera is turned on, it is delivered through i2c to adapt and prepare the sensor registers;

The fourth step: camera data output, through mipi to the cpu side for collection;

5. Sensor type

5.1. There are two main types of common camera sensors

CCD (Chargre Couled Device), or Charge Coupled Device, is currently widely used in most digital cameras. It is a special semiconductor material that consists of a large number of independent photosensitive elements, which are usually arranged in a matrix. Light hits the CCD through the lens and is converted into electric charge, the amount of charge on each element depends on the intensity of the light it receives. When the photographer presses the shutter, the CCD can transmit the information of each element to the analog/digital converter, and then convert the analog electrical signal into a digital signal, and the digital signal is compressed in a certain format and stored in the buffer. The entire shooting of the digital photo is completed.

CMOS (Complementary Metal-Oxide-Semiconductor), that is, complementary metal-oxide semiconductor, plays an important role in semiconductor technologies such as microprocessors and flash memory, and is also a semiconductor that can be used to sense changes in light. Its constituent elements are mainly silicon. And germanium, the basic function is achieved by negatively and positively charged transistors on CMOS. The currents generated by these two complementary effects can be recorded and interpreted as images by the processing chip. Since the structure of CMOS is relatively simple, it is the same as the existing large-scale integrated circuit production process, so the production cost can be reduced. In comparison, the former is more sensitive, faster, and more power-efficient. At present, the development of CMOS technology is not mature, and this high-quality CMOS is only used in some professional digital cameras, while cheap and low-end CMOS are often used in some low-end digital cameras, and the image quality is generally poor. Therefore, if you want to buy a consumer-grade digital camera at present, it is recommended that users choose a product with CCD as the image sensor.

5.2. There are two modes of image acquisition data

Color Filter Array---CFA image sensors all use a certain mode to collect image data, commonly used are BGR mode and CFA mode.

BGR mode: BGR mode is an image data mode that can be directly displayed and compressed. It is determined by the three primary color values ​​of R (red), G (green), and B (blue) to determine a pixel, such as Fuji Digital The SUPER CCD image sensor used in the camera adopts this mode. The advantage is that the image data generated by the image sensor can be directly displayed without interpolation and other subsequent processing. The image effect is the best, but the cost is high, and it is often used in professional cameras.

CFA mode: In order to reduce the cost and reduce the volume, most of the digital cameras on the market use the CFA mode, that is, a layer of color filter array (CFA) is covered on the surface of the pixel array. There are many kinds of color filter arrays. Broad is the Bayer format filter array, which satisfies the GRBG law, with twice as many green pixels as red or blue pixels, because the peak of the human eye's sensitivity to the visible light spectrum is located in the mid-band, which corresponds to the green spectral component. In this mode, the image data only uses one of the three values ​​​​of R, G, and B to represent a pixel, and the other two color values ​​are missing. At this time, a mosaic image is obtained. In order to obtain a full-color image , it needs to use the color information of its surrounding pixels to estimate the other two missing colors, this process is called color interpolation.


Leave a comment