Working method and device of CMOS camera
The FPGA processing chip configures the working timing and registers of the CMOS image sensor and performs data processing, which solves the problem of insufficient sensitivity and resolution of the CMOS image sensor in the field of aerospace remote sensing imaging, reduces system power consumption, and improves image quality and dynamic range. , expanding the scope of application.
Patent Information
- Application Number
- CN202411244584.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-10-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The application of CMOS image sensors in the field of aerospace remote sensing imaging is limited by insufficient detection sensitivity and resolution, polarization azimuth angle deviation caused by exposure time, and imaging quality problems. The system power consumption is high and the cost is high.
The FPGA processing chip configures the working timing and registers of the CMOS image sensor, performs data delay alignment, serial-to-parallel conversion, clock domain conversion, and performs image data correction, denoising and gain control, and outputs it to the double-rate synchronous dynamic random access memory. Implement the Camera_Link interface driver protocol to reduce serial processing delays and improve image quality and dynamic range.
It improves the sensitivity and resolution of CMOS cameras, solves the problem of polarization azimuth deviation caused by changes in exposure time, reduces system power consumption, expands the scope of applications, improves image quality and dynamic range, and reduces costs.
Smart Images

Figure CN118764729A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of visual telemetry, and in particular to a working method of a CMOS camera and a working device of a CMOS camera. Background Art
[0002] CMOS (Complementary Metal-Oxide-Semiconductor) image sensors are widely used in the field of remote sensing imaging due to their low power consumption, small size, and high reliability. They have shutter technology and are mainly used to perform high-precision imaging of transient processes of high-speed moving target objects. In the past, CCD (Charge Coupled Device) camera technology was used, which was processed and produced based on special processes. It was costly, had low integration, and could only output a complete frame of images at a time, and could not record and observe the areas of interest in a targeted manner. CCD cameras require voltage to move charges, which will undoubtedly increase the power consumption of the system. CMOS image sensors have active amplifiers inside, which is an active image acquisition method that reduces the overall power consumption of the system. They are manufactured using standard processes and integrate pixel arrays, signal readout circuits, processing circuits, and control circuits on a silicon chip, greatly reducing system costs and making them easier to be used in more fields and platforms.
[0003] Due to the structural reasons of CMOS image sensors, the detection sensitivity and resolution cannot be improved, which once limited the scope of aerospace remote sensing imaging. The exposure time of CMOS image sensors will cause polarization azimuth deviation; there will be vertical stripes, black noise, and image quality problems under extremely bright and extremely dark light intensities. Summary of the invention
[0004] In order to overcome the defects of the prior art, the technical problem to be solved by the present invention is to provide a working method for a CMOS camera, which can avoid the huge delay caused by the serial processing method to the data delay, improve the sensitivity and resolution of the CMOS camera, expand its application range, solve the problem of polarization azimuth deviation of CMOS due to the change of exposure time, improve image quality and dynamic range, diversify functions, reduce power consumption, and have low cost.
[0005] The technical solution of the present invention is: the working method of the CMOS camera comprises the following steps: (1) The PC sends serial camera start, stop, and working mode commands via RS422; (2) The FPGA processing chip uses the SPI protocol to configure the internal registers of the CMOS image sensor, so that the CMOS image sensor can reset, collect, delay, and output the collected raw image data; (3) The camera control timing module inside the FPGA processing chip configures the working timing of the CMOS image sensor, so that the CMOS image sensor starts to collect image data according to the set working mode; (4) Use io_delay and ISERDES to adjust the delay alignment between bits and serial-to-parallel conversion inside the FPGA processing chip, and send it to the cross-clock domain fifo for clock domain conversion; (5) Write the parallel data after delay alignment, serial-to-parallel conversion, and clock domain conversion into the double-rate synchronous dynamic random access memory DDR for cache and read; (6) Digital image processing, including image data correction, denoising, and gain control; (7) Implement the Camera_Link interface driver protocol on the FPGA processing chip and output the image data to the PC host computer for display.
[0006] The FPGA processing chip of the present invention uses the SPI protocol to configure the internal register of the CMOS image sensor, so that the CMOS image sensor is reset, collected, delayed and outputs the collected original image data; the camera control timing module inside the FPGA processing chip configures the working timing of the CMOS image sensor, so that the CMOS image sensor starts to collect image data according to the set working mode; the io_delay and ISERDES are used inside the FPGA processing chip to adjust the delay alignment between bits and the serial-to-parallel conversion, and the data is sent to the cross-clock domain fifo for clock domain conversion; the parallel data after the delay alignment, serial-to-parallel conversion and clock domain conversion is written into a double rate synchronous dynamic random access memory DDR for cache and read; image data correction, denoising and gain control are performed; thereby, the huge delay caused by the serial processing mode to the data delay can be avoided, the sensitivity and resolution of the CMOS camera can be improved, the application range thereof can be expanded, the polarization azimuth deviation problem caused by the exposure time change of the CMOS can be solved, the image quality and dynamic range can be improved, the functions can be diversified, the power consumption can be reduced, and the cost is low.
[0007] A working device of a CMOS camera is also provided, which uses an FPGA processing chip and a CMOS image sensor to build a CMOS camera, and includes: (1) The PC sends serial camera start, stop, and working mode commands via RS422; (2) The FPGA processing chip uses the SPI protocol to configure the internal registers of the CMOS image sensor, so that the CMOS image sensor can reset, collect, delay, and output the collected raw image data; (3) The camera control timing module inside the FPGA processing chip configures the working timing of the CMOS image sensor, so that the CMOS image sensor starts to collect image data according to the set working mode; (4) Use io_delay and ISERDES to adjust the delay alignment between bits and serial-to-parallel conversion inside the FPGA processing chip, and send it to the cross-clock domain fifo for clock domain conversion; (5) Write the parallel data after delay alignment, serial-to-parallel conversion, and clock domain conversion into the double-rate synchronous dynamic random access memory DDR for cache and read; (6) Digital image processing, including image data correction, denoising, and gain control; (7) Implement the Camera_Link interface driver protocol on the FPGA processing chip and output the image data to the PC host computer for display. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 FIG. 4 shows a working block diagram of a CMOS camera according to the present invention.
[0009] Figure 2 A flow chart showing step (6) of the working method of the CMOS camera according to the present invention.
[0010] Figure 3 A schematic diagram of the two-point correction is shown.
[0011] Figure 4 A flow chart showing the median filtering of the working method of the CMOS camera according to the present invention.
[0012] Figure 5 Shows Figure 4 An embodiment of median filtering.
[0013] Figure 6 A flow chart showing the gain shutter control of the working method of the CMOS camera according to the present invention is shown. DETAILED DESCRIPTION
[0014] like Figure 1 As shown, the working method of this CMOS camera includes the following steps: (1) The PC sends serial camera start, stop, and working mode commands via RS422; (2) The FPGA processing chip uses the SPI protocol to configure the internal registers of the CMOS image sensor, so that the CMOS image sensor can reset, collect, delay, and output the collected raw image data; (3) The camera control timing module inside the FPGA processing chip configures the working timing of the CMOS image sensor, so that the CMOS image sensor starts to collect image data according to the set working mode; (4) Use io_delay and ISERDES to adjust the delay alignment between bits and serial-to-parallel conversion inside the FPGA processing chip, and send it to the cross-clock domain fifo for clock domain conversion; (5) Write the parallel data after delay alignment, serial-to-parallel conversion, and clock domain conversion into the double-rate synchronous dynamic random access memory DDR for cache and read; (6) Digital image processing, including image data correction, denoising, gain control (such as Figure 2 shown); (7) Implement the Camera_Link interface driver protocol on the FPGA processing chip and output the image data to the PC host computer for display.
[0015] The FPGA processing chip of the present invention uses the SPI protocol to configure the internal register of the CMOS image sensor, so that the CMOS image sensor is reset, collected, delayed and outputs the collected original image data; the camera control timing module inside the FPGA processing chip configures the working timing of the CMOS image sensor, so that the CMOS image sensor starts to collect image data according to the set working mode; the io_delay and ISERDES are used inside the FPGA processing chip to adjust the delay alignment between bits and the serial-to-parallel conversion, and the data is sent to the cross-clock domain fifo for clock domain conversion; the parallel data after the delay alignment, serial-to-parallel conversion and clock domain conversion is written into a double rate synchronous dynamic random access memory DDR for cache and read; image data correction, denoising and gain control are performed; thereby, the huge delay caused by the serial processing mode to the data delay can be avoided, the sensitivity and resolution of the CMOS camera can be improved, the application range thereof can be expanded, the polarization azimuth deviation problem caused by the exposure time change of the CMOS can be solved, the image quality and dynamic range can be improved, the functions can be diversified, the power consumption can be reduced, and the cost is low.
[0016] Preferably, in step (4), the alignment includes: bit correction and word correction; Bit correction is to determine the stable area of a bit and use the middle position of the stable area as the sampling point. The steps are as follows: (4a.1) Find the starting position of a bit; (4a.2) controlling the processor to move the position of the sampling point in the same direction; (4a.3) Determine whether the current sampling value is consistent with the previous sampling value; (4a.4) If they are consistent, then the point is determined to be the starting position of the sampling point and also the starting point of data stability, and the current sampling position is recorded; (4a.5) Use steps (4a.1) to (4a.4) to find the location of the unstable point of the data and record the location of the current point; (4a.6) Subtract the position of point (4a.6) from the position of point (4a.5) and take the middle position as the position of the best sampling point; Word correction method: (4b.1) Find the first bit of a byte; (4b.2) Send a unique byte to the image sensor via the FPGA; (4b.3) Determine the first bit by sampling the byte; (4b.4) If the first bit of the acquired byte does not match the first bit of the transmitted byte, the first bit of the byte is shifted one bit in the same direction until the acquired byte completely matches the transmitted byte, thus completing the word alignment correction.
[0017] Preferably, in step (6), the image data correction adopts a two-point correction method: the camera is placed under high and low light intensities for data acquisition; then the bias is adjusted so that the mean of the output image is the same; the gain coefficient is calculated from the mean and stored in the flash memory; loaded at startup, and then the corrected image data is calculated using the two-point correction method.
[0018] Figure 3 The schematic diagram of the two-point correction is shown. Preferably, in step (6), a two-point method is used to perform non-uniform correction, which includes: (6a.1) After the collected image sensor output is stable, multiply each pixel data by a gain factor of the coordinates (x, y) after two-point correction , plus a bias coefficient for the coordinates (x,y) of the two-point correction , thus obtaining the corrected pixel data: , is the original corresponding coordinate (x, y) pixel data output, It is the output pixel data of the corresponding coordinates (x, y) after two-point correction; (6a.2) Gain correction factor and bias coefficient The algorithm is as follows: The first illumination condition is set to a, and the second illumination condition is set to b. Under two different illumination conditions a and b, the image pixel values output at the same point are , , and the mean of n pixels and : , ; (6a.3) The formula for calculating the gain coefficient at the coordinate (x, y) is: , The calculation formula for the bias coefficient at the coordinate (x, y) is: .
[0019] Preferably, in step (6), denoising adopts median filtering, uses an optimized median search, and after finding the median, replaces the value in the middle position with the median.
[0020] Preferably, if Figure 4 , Figure 5 As shown, in step (6), median filtering is used, which includes: (6b.1) Take n×n (usually 5×5 or 3×3) window data and set the current median to B2; (6b.2) Find the maximum values max1, max2, max3, the minimum values min1, min2, min3 and the median values med1, med2, med3 of each row respectively; (6b.3) Take the minimum value min4 among all max1, max2, max3 in b, take the max4 among all min1, min2, min3 in b, take the med4 among all med1, med2, med3 in b; (6b.4) Then take max4, min4 and med4 in c; (6b.5) Take the median med0 among max4, min4 and med4, and replace it with the median B2 in the original image window.
[0021] The advantages of the optimized median filtering algorithm are: it can retain the target's contour information relatively completely, which is of great value for subsequent target recognition.
[0022] Preferably, in step (6), the gain control adopts gain shutter control, and the value of the relevant register in the image sensor is reconfigured to change the gain.
[0023] Preferably, if Figure 6 As shown, in step (6), the gain shutter control includes: Record pixel data of consecutive n frames, calculate its root mean square value m, and determine the relationship between the root mean square value m and the set value N; When m is greater than N, the shutter exposure time is reduced to reduce the pixel value of the image data output; when m is less than N, the shutter exposure time is increased to increase the pixel value of the image output.
[0024] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes the steps of the above-mentioned embodiment method, and the storage medium can be: ROM / RAM, disk, CD, memory card, etc. Therefore, corresponding to the method of the present invention, the present invention also includes a CMOS camera working device, which is usually represented in the form of functional modules corresponding to the steps of the method. The device uses an FPGA processing chip and a CMOS image sensor to build a CMOS camera, which includes: (1) The PC sends serial camera start, stop, and working mode commands via RS422; (2) The FPGA processing chip uses the SPI protocol to configure the internal registers of the CMOS image sensor, so that the CMOS image sensor can reset, collect, delay, and output the collected raw image data; (3) The camera control timing module inside the FPGA processing chip configures the working timing of the CMOS image sensor, so that the CMOS image sensor starts to collect image data according to the set working mode; (4) Use io_delay and ISERDES to adjust the delay alignment between bits and serial-to-parallel conversion inside the FPGA processing chip, and send it to the cross-clock domain fifo for clock domain conversion; (5) Write the parallel data after delay alignment, serial-to-parallel conversion, and clock domain conversion into the double-rate synchronous dynamic random access memory DDR for cache and read; (6) Digital image processing, including image data correction, denoising, and gain control; (7) Implement the Camera_Link interface driver protocol on the FPGA processing chip and output the image data to the PC host computer for display.
[0025] Preferably, the alignment of the FPGA processing chip includes: bit correction and word correction; Bit correction is to determine the stable area of a bit and use the middle position of the stable area as the sampling point. The steps are as follows: (4a.1) Find the starting position of a bit; (4a.2) controlling the processor to move the position of the sampling point in the same direction; (4a.3) Determine whether the current sampling value is consistent with the previous sampling value; (4a.4) If they are consistent, then the point is determined to be the starting position of the sampling point and also the starting point of data stability, and the current sampling position is recorded; (4a.5) Use steps (4a.1) to (4a.4) to find the location of the unstable point of the data and record the location of the current point; (4a.6) Subtract the position of point (4a.6) from the position of point (4a.5) and take the middle position as the position of the best sampling point; Word correction method: (4b.1) Find the first bit of a byte; (4b.2) Send a unique byte to the image sensor via the FPGA; (4b.3) Determine the first bit by sampling the byte; (4b.4) If the first bit of the acquired byte does not match the first bit of the transmitted byte, the first bit of the byte is shifted one bit in the same direction until the acquired byte completely matches the transmitted byte, thus completing the word alignment correction.
[0026] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention are still within the protection scope of the technical solution of the present invention.
Claims
1. A method for operating a CMOS camera, characterized in that: It includes the following steps: (1) The PC sends serial camera start, stop, and working mode commands via RS422; (2) The FPGA processing chip uses the SPI protocol to configure the internal registers of the CMOS image sensor, so that the CMOS image sensor can reset, collect, delay, and output the collected raw image data; (3) The camera control timing module inside the FPGA processing chip configures the working timing of the CMOS image sensor, so that the CMOS image sensor starts to collect image data according to the set working mode; (4) Use io_delay and ISERDES to adjust the delay alignment between bits and serial-to-parallel conversion inside the FPGA processing chip, and send it to the cross-clock domain fifo for clock domain conversion; (5) Write the parallel data after delay alignment, serial-to-parallel conversion, and clock domain conversion into the double-rate synchronous dynamic random access memory DDR for cache and read; (6) Digital image processing, including image data correction, denoising, and gain control; (7) Implement the Camera_Link interface driver protocol on the FPGA processing chip and output the image data to the PC host computer for display.
2. The operating method of the CMOS camera according to claim 1, characterized in that: In the step (4), the alignment includes: bit correction and word correction; Bit correction is to determine the stable area of a bit and use the middle position of the stable area as the sampling point. The steps are as follows: (4a.1) Find the starting position of a bit; (4a.2) controlling the processor to move the position of the sampling point in the same direction; (4a.3) Determine whether the current sampling value is consistent with the previous sampling value; (4a.4) If they are consistent, then the point is determined to be the starting position of the sampling point and also the starting point of data stability, and the current sampling position is recorded; (4a.5) Use steps (4a.1) to (4a.4) to find the location of the unstable point of the data and record the location of the current point; (4a.6) Subtract the position of point (4a.6) from the position of point (4a.5) and take the middle position as the position of the best sampling point; Word correction method: (4b.1) Find the first bit of a byte; (4b.2) Send a unique byte to the image sensor via the FPGA; (4b.3) Determine the first bit by sampling the byte; (4b.4) If the first bit of the acquired byte does not match the first bit of the transmitted byte, the first bit of the byte is shifted one bit in the same direction until the acquired byte completely matches the transmitted byte, thus completing the word alignment correction.
3. The operating method of the CMOS camera according to claim 2, characterized in that: In step (6), the image data correction adopts a two-point correction method: the camera is placed under high and low light intensities to collect data; then the bias is adjusted so that the mean of the output images is the same; Calculate the average value to obtain the gain coefficient and store it in the flash memory; It is loaded when the computer is turned on, and then the corrected image data is calculated using the two-point correction method.
4. The operating method of the CMOS camera according to claim 3, characterized in that: In step (6), a two-point method is used to perform non-uniform correction, which includes: (6a.1) After the collected image sensor output is stable, multiply each pixel data by a gain factor of the coordinates (x, y) after two-point correction , plus a bias coefficient for the coordinates (x,y) of the two-point correction , thus obtaining the corrected pixel data: , is the original corresponding coordinate (x, y) pixel data output, It is the output pixel data of the corresponding coordinates (x, y) after two-point correction; (6a.2) Gain correction factor and bias coefficient The algorithm is as follows: The first illumination condition is set to a, and the second illumination condition is set to b. Under two different illumination conditions a and b, the image pixel values output at the same point are , , and the mean of n pixels and : , ; (6a.3) The formula for calculating the gain coefficient at the coordinate (x, y) is: , The calculation formula for the bias coefficient at the coordinate (x, y) is: 。 5. The operating method of the CMOS camera according to claim 4, characterized in that: In the step (6), denoising adopts median filtering, uses an optimized median search, and after finding the median, replaces the value in the middle position with the median.
6. The operating method of the CMOS camera according to claim 5, characterized in that: In the step (6), median filtering is used, which includes: (6b.1) Take the n×n window data and set the current median value to B2; (6b.2) Find the maximum values max1, max2, max3, the minimum values min1, min2, min3 and the median values med1, med2, med3 of each row respectively; (6b.3) Take the minimum value min4 among all max1, max2, max3 in b, take the max4 among all min1, min2, min3 in b, take the med4 among all med1, med2, med3 in b; (6b.4) Then take max4, min4 and med4 in c; (6b.5) Take the median med0 among max4, min4 and med4, and replace it with the median B2 in the original image window.
7. The operating method of a CMOS camera according to claim 6, characterized in that: In step (6), the gain control adopts gain shutter control, reconfigures the value of the relevant register in the image sensor, and changes the gain.
8. The operating method of a CMOS camera according to claim 6, characterized in that: In step (6), the gain shutter control includes: Record pixel data of consecutive n frames, calculate its root mean square value m, and determine the relationship between the root mean square value m and the set value N; When m is greater than N, the shutter exposure time is reduced to reduce the pixel value of the image data output; when m is less than N, the shutter exposure time is increased to increase the pixel value of the image output.
9. A working device of a CMOS camera, characterized in that: Using FPGA processing chip and CMOS image sensor to build a CMOS camera, which includes: (1) The PC sends serial camera start, stop, and working mode commands via RS422; (2) The FPGA processing chip uses the SPI protocol to configure the internal registers of the CMOS image sensor, so that the CMOS image sensor can reset, collect, delay, and output the collected raw image data; (3) The camera control timing module inside the FPGA processing chip configures the working timing of the CMOS image sensor, so that the CMOS image sensor starts to collect image data according to the set working mode; (4) Use io_delay and ISERDES to adjust the delay alignment between bits and serial-to-parallel conversion inside the FPGA processing chip, and send it to the cross-clock domain fifo for clock domain conversion; (5) Write the parallel data after delay alignment, serial-to-parallel conversion, and clock domain conversion into the double-rate synchronous dynamic random access memory DDR for cache and read; (6) Digital image processing, including image data correction, denoising, and gain control; (7) Implement the Camera_Link interface driver protocol on the FPGA processing chip and output the image data to the PC host computer for display.
10. The working device of the CMOS camera according to claim 9, characterized in that: The alignment of FPGA processing chips includes: bit correction and word correction; Bit correction is to determine the stable area of a bit and use the middle position of the stable area as the sampling point. The steps are as follows: (4a.1) Find the starting position of a bit; (4a.2) controlling the processor to move the position of the sampling point in the same direction; (4a.3) Determine whether the current sampling value is consistent with the previous sampling value; (4a.4) If they are consistent, then the point is determined to be the starting position of the sampling point and also the starting point of data stability, and the current sampling position is recorded; (4a.5) Use steps (4a.1) to (4a.4) to find the location of the unstable point of the data and record the location of the current point; (4a.6) Subtract the position of point (4a.6) from the position of point (4a.5) and take the middle position as the position of the best sampling point; Word correction method: (4b.1) Find the first bit of a byte; (4b.2) Send a unique byte to the image sensor via the FPGA; (4b.3) Determine the first bit by sampling the byte; (4b.4) If the first bit of the acquired byte does not match the first bit of the transmitted byte, the first bit of the byte is shifted one bit in the same direction until the acquired byte completely matches the transmitted byte, thus completing the word alignment correction.
Citation Information
Patent Citations
CMOS image data training system and image data serialization-deserialization simulation detection method
CN107454385A
Image correction method and system for high-speed camera
CN110418060A
FPGA (Field Programmable Gate Array)-based CMOS (Complementary Metal Oxide Semiconductor) image sensor data acquisition device and method
CN113315935A
Apparatus and method for stabilizing image sensor black level
US20080218615A1
