0 Introduction
Image engineering has been widely used in many fields such as national defense, education, finance, medical treatment, printing, intelligent transportation, industrial automation, consumer electronics, etc., and has developed rapidly. As we all know, image sensors, as important components of image systems, are basically divided into two categories: CCD sensor or CMOS sensor. Both use photodiodes for photoelectric conversion to convert images into digital data, and the main difference is the different ways of data transmission.
The sensor3 color digital camera needs three monochrome sensors to obtain the R, G, and B components of the color image, which is relatively expensive. The method of obtaining a color image with a single CCD is to cover the surface of the CCD with a mosaic filter containing only red, green, and blue colors, and to implement its output signal through a certain processing algorithm. This design concept was originally proposed by Bayer, so this filter is also called the Bayer pattern.
LatticeECP FPGAs combine efficient FPGA architecture with high-speed application-specific functions. LatticeECP-DSP (EConomy plusDSP) is the first product family, which integrates dedicated high-performance DSP blocks on the chip. LatticeECP-DSP devices are best suited for cost-effective DSP functional application systems, such as software-defined radio, wireless communications, military, image and video processing systems, etc.
1 Bayer interpolation method
The arrangement format of the Bayer Pattern is shown in Figure 1.
Although the original image captured by a single sensor camera with a Bayer filter contains the three primary color components of R, G, and B, it is not possible to simply separate the three components without any algorithm processing. This not only results in poor image resolution, but also serious distortion of the three primary color components of each pixel compared to the object being photographed. In Figure 2, Figure 2(a) is the original color image; Figure 2(b) is an image that only takes the red component and is displayed in grayscale mode; Figure 2(c) is an image that only takes the green component and is displayed in grayscale mode; Figure 2(d) is an image that only takes the blue component and is displayed in grayscale mode. After simply superimposing the images of Figures 2(b) to (d), the original image Figure 2(a) can be obtained. However, the original Bayer image captured by the CCD or CMOS sensor does not conform to this separation principle and must be implemented through a certain image algorithm.
There are many Bayer interpolation methods widely used in the field of image processing, including M. C. Poilpre's processing of JPEG images; H. S. Malvar, etc.'s linear interpolation method; Remi Jean's pixel double interpolation method and T. Guseo's low-resolution image processing. There are three representative methods: bilinear interpolation method, Ron Kimmel method and OptimalRecovery method. Each of these three methods has its own advantages and disadvantages. [page]
1.1 Bilinear interpolation
As shown in Figure 3, each pixel position originally has only one color component, and the missing two color components are obtained by the average value of pixels with the same color components in the 3×3 neighborhood. The R, G, and B components of the pixels at B7 and G3 in Figure 3 are calculated by the following formula:
Bilinear interpolation has the advantages of simple operation and easy implementation. Its essence is a low-pass filter, and its disadvantage is that it ignores the relevant information between different color components and the edges of the image. In this way, erroneous data will cause blurring or even color aliasing at the edges of the restored image.
1.2 Ron Kimmel Method
Ron Kimmel's method calculates the gradient of the green pixel in all directions, and then weights and averages the gradient values; for red and blue pixel components, the ratio of the red and blue components to the green component is taken as the weighted average. This method can significantly improve the color aliasing of the edges of objects in the image.
1.3 Optimal Recovery Method
The Optimal Recovery method has a high computational complexity, but it is also the algorithm with the best image quality that has been published publicly. It is difficult for general embedded systems to complete it in real time. The image processing system in this paper uses Lattice's FPGA chip LFECPIIM50, making full use of the natural parallel structure of FPGA to implement the Bayer conversion algorithm in real time (1208×1024 images, 12 frames/s), and has achieved good results. The Optimal Recovery algorithm is as follows:
(1) As shown in FIG4 , the green pixel interpolation at P5 shown in the figure is completed by using the fine scale mode as much as possible.
(2) Calculating the blue component requires two steps:
① Retrieve the blue component lost in the red space:
②Recover the blue component lost in the green space:
(3) The red component is processed in the same way as the blue component.
(4) Repeat the following calibration steps 3 times:
① Correct the green component to obtain a suitable G/B ratio:
② Correct the green component to obtain a suitable G/R ratio:
③ Average blue and red interpolation results:
④Correct the blue and red component values:
⑤The algorithm ends, where R5, G5, and B5 are the three-color component values at pixel P5.
1.4 Peak Signal-to-Noise Ratio (PSNR)
The calculation formulas for peak signal-to-noise ratio PSNR and normalized color difference NCD are:
Where: MSE is the mean square error between the original image and the processed image; I represents the nth pixel value of the original image; P represents the nth pixel value of the processed image; Framesize represents the image size, such as 1 280×1 024; the larger the PSNR value, the less distortion. [page]
2 Results Analysis
The images acquired by the real-time image acquisition system are shown in Figure 5, where Figure 5 (a1), (b1), and (c1) are interpolated images with bright colors and good subjective feeling. Figure 5 (a2), (b2), and (c2) are the acquired original Bayer images. After partial magnification, the original mosaic effect can be seen, as shown in Figure 5 (a3), (b3), and (c3). The peak signal-to-noise ratio calculation results are shown in Table 1, where PSNR1 is the bilinear interpolation method and PSNR2 is the OptimalRecovery method.
3 Conclusion
At present, FPGA technology is developing rapidly, internal resources are becoming more and more abundant, and the cost performance is constantly improving. Fully exploring the potential of FPGA resources and completing the image preprocessing algorithm at the front end of the system as much as possible will greatly improve the real-time characteristics of the system and expand the application field of embedded systems. Although the focus is on the Bayer interpolation transform of color images, it also has positive reference significance for other embedded system design methods using FPGA devices.
Previous article:RGB to YCrCb color space conversion based on FPGA
Next article:Design of embedded data logging device for near field wireless communication
Recommended ReadingLatest update time:2024-11-16 16:46
- Popular Resources
- Popular amplifiers
- Analysis and Implementation of MAC Protocol for Wireless Sensor Networks (by Yang Zhijun, Xie Xianjie, and Ding Hongwei)
- MATLAB and FPGA implementation of wireless communication
- Intelligent computing systems (Chen Yunji, Li Ling, Li Wei, Guo Qi, Du Zidong)
- Summary of non-synthesizable statements in FPGA
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- My creative plan and functional implementation plan
- The more I read, the more I like these sentences. Each sentence is more philosophical than the last, and each sentence is very inspiring.
- 【Want to buy】College students want to buy ATmega16 development board
- AC-DC controllers, gate drivers, digital isolators
- kernel make zImage compilation failed
- Importance of CMTI parameter for isolation driver selection
- May I ask, what is the difference between ICP programming, JTAG programming and SWD programming?
- 2019 Tektronix OPEN-DAY opens: Hold your DUT and test thoroughly
- The relationship between FPGA memories
- Show off the Sony headphones I got from EEWORLD