Embedded digital camera nighttime visibility measurement system based on DSP

Publisher:HeavenlyJoy444Latest update time:2013-05-15 Keywords:DSP Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: One of the key technologies of digital camera night visibility instrument is to process the image information of target light source and black body collected by CCD at high speed and in real time. A miniaturized and portable embedded visibility measurement system based on TMS320DM642 is designed, implemented in hardware and software, and applied to the night visibility measurement of digital camera. The PAL video stream of 25 frames/s is collected by CCD, digitized and sent to DSP processor, and the image segmentation and positioning algorithm of target light source and black body is realized by DSP to complete the measurement of digital camera night visibility. The experimental results show that the designed embedded system can well complete the night visibility measurement.

  Keywords: DSP; image processing; night visibility; embedded system

  0 Introduction

  Visibility is an important parameter in meteorological observation, and it has important application value in aviation, railways, highways, etc. Digital camera method is a relatively new method of detecting visibility, which automatically obtains visibility value based on the definition of visibility and the visual threshold effect of human eyes. Its basic idea is to directly process the image of the selected target object captured by the camera (CCD) and analyze the brightness information to obtain the visibility value. This article studies the night visibility measurement method of dual light source camera method, designs a miniaturized embedded system based on DSP, and designs a method for measuring night visibility from both hardware and software design aspects.

  The system is studied and the calculation of night visibility is realized. The experimental results show that the system can be used for observing night visibility.

  1 Principle of digital camera detection of night visibility

  The principle of using the dual light source method to carry out nighttime visibility detection is shown in Figure 1.

  Figure 1 Principle of nighttime visibility detection

  The dual light source method is based on the Beer-Lambert law. It uses the image grayscale information to obtain the brightness attenuation of the light source and the black body, and then inverts the atmospheric extinction coefficient to calculate visibility. The atmospheric extinction coefficient is:

  Where: are the apparent brightness of light sources 1, 2, and black bodies 1, 2 respectively; D1 and D2 are the distances from light sources 1, 2 to the camera respectively.

  According to the visual threshold effect of the human eye, the visibility value is D=ln(1/0.02)/σ.

  2 Embedded System Hardware Design

  2.1 Overall system design

  The system is mainly composed of a target light source and black body, a camera and a signal processing platform. The signal processing platform completes the image acquisition, segmentation and visibility calculation functions of the signal. This paper designs a real-time image acquisition and processing platform with TMS320DM642 as the core, combined with CY37064P100, TVP5150PBS, SAA7121, and DMT32240T035_01WN. The platform completes the image acquisition and segmentation and positioning processing, and calculates the brightness and visibility value of the target light source and target black body. Figure 2 is a system module structure diagram.

  Figure 2 System module structure diagram

  The PAL camera provides a video stream of 25 frames/s. The CCD captures images and converts the input video stream into 8-bit ITU-R BT.656 format video data through the video decoding chip, and obtains the visibility value through DSP image processing. Then, the DM642 extended serial communication circuit communicates with the LCD screen with a serial port, and the visibility value is displayed on the LCD screen. At the same time, the video encoding chip converts the BT.656 format video data processed by the DSP into a PAL format video signal, and displays the processed target light source and target black body images through the monitor.

  2.2 Embedded Signal Processing System Hardware Design

  2.2.1 Video Capture Module

  An 8-bit analog industrial camera is used to directly capture PAL video images and send them to the video decoder. After decoding, the data is output in ITU-R BT.656 format. The decoder uses the high-performance, small package (32-pin TQFP), low power consumption (less than 150 mW) TVP5150PBS to convert the PAL video signal into a digital color difference signal (YUV 4:2:2). Figure 3 is a diagram of the interface between the video decoding module and the DSP.

  Figure 3 Video decoding module and DSP interface diagram

A voltage divider resistor network is designed between the external video input (0~1 Vpp) and the TVP5150PBS video input to make the input level of the TVP5150PBS 0~0.75 Vpp.

  The system sets the A channel of the video port VP1 as the video input port. The I2C interface of TMS320DM642 realizes the initialization and configuration of the internal registers of the TVP5150 chip. The SCL and SDA pins of the TVP5150 chip are respectively connected to the clock and data address lines of the TMS320DM642. The timing of SCL and SDA is used to complete the writing and reading of data from the DSP to the video decoder chip register. TVP5150 receives the video information of the camera and outputs the decoded data serially. The digital video stream contains the odd and even field indicator signal FI, field synchronization signal, line synchronization signal, pixel clock, YUV data output and other elements, and the data rate is about 165 Mb/s.

  2.2.2 Image Processing Module

  The system uses TI's 32-bit fixed-point DSP chip TMS320DM642 for digital media applications to complete the signal processing process. The BT.656 video stream output by TVP5150 is stored in the 2 560 B VP1A channel FIFO after passing through the video port of TMS320DM 642. Due to the large amount of image data, an external off-chip memory is required to store image data information. The data in the FIFO is moved to the off-chip memory SDRAM through the EDMA channel. When the A channel of the video port VP1 has a video Y, U, V component data transfer request, the EDMA processing function will be triggered in the program to complete the transfer of FIFO data to SDRAM. VP1EVTYA, VP1EVTUA, and VP1EVTVA are events related to the video Y, U, and V components that occur on the VP1A channel, respectively, and are connected to the corresponding channels of DM642 EDMA. After the FIFO transfers data to SDRAM, the program running in FLASH starts to call the image data, perform algorithm processing, obtain the brightness values ​​of the light source and the black body, and complete the visibility calculation.

  2.2.3 Video display module

  The video display part converts the BT.656 format video data into a PAL format video signal through the video encoding chip, and then sends it to the monitor to display the processed target light source and target black body image. The SAA7121H encoder is used to set the VP0 A channel of the TMS320DM642 as the video output port. Figure 4 is a connection diagram between the video encoding module and the DSP, and CVBS_OUT is the composite video output by decoding. Like the TVP5150, the configuration of each register inside the SAA7121 chip is configured through the I2C interface of the TMS320DM642, and the I2C bus of the TMS320DM642 can be shared with the TVP5150.

  Figure 4 Connection diagram between video encoding module and DSP

  2.2.4 Serial communication module

  The system uses CY37064P100 and TL16C752B to expand the serial communication circuit outside the DSP to achieve communication between the main chip and the LCD screen with a serial port, and displays the night visibility value on the LCD screen. Figure 5 is the design diagram of the serial communication module. The serial port LCD screen is selected to display the visibility value and draw the historical curve.

  Figure 5 Serial communication module design

  3 Embedded System Software Design

  3.1 System software design based on DSP/BIOS and RF5

  DSP/BIOS is an embedded operating system based on CCS. Its multi-threading mechanism can facilitate the writing of multi-tasking applications. Compared with traditional DSP programs written in assembly language and C language, DSP/BIOS can effectively improve the efficiency of code execution and facilitate real-time monitoring of code execution. RF5 is an application design framework based on DSP/BIOS, which implements storage management, thread model and channel encapsulation. Using the RF5 reference framework can greatly reduce the difficulty and time of developers. According to system requirements, embedded software is written based on the RF5 reference framework. Figure 6 is a software program flow chart.

  Figure 6 is a software program flow chart

  Each processing task uses the SCOM message mechanism to communicate with each other. After the image acquisition task collects data, it transmits it to the processing task through the SCOM message; after the processing task performs relevant processing and visibility calculation on the image, it notifies the acquisition task to perform the next acquisition processing, and transmits the processing results to the output task for display. At the same time, the processing task coordinates the communication between this task and the other two tasks.

  3.2 Research on image processing algorithms for visibility calculation

  The visibility calculation task is the core of DSP embedded software, and its image processing method is the key to system reliability. The digital camera night visibility instrument calculates the brightness of the target light source after two light sources of the same brightness have been attenuated at different distances through image processing, and completes the measurement of visibility value by inverting the atmospheric extinction coefficient based on the brightness. Its image processing process is mainly divided into three parts: image preprocessing, image segmentation and positioning, and calculation of visibility value.

  3.2.1 Image Preprocessing

  Image preprocessing mainly involves image filtering of the collected light source image to remove the influence of background noise and stray light, so as to make the brightness of the target light source and black body image uniform. Since the visibility meter of this system is mainly installed on highways for visibility warning, the image clarity is not high under weather conditions such as low fog and rainy days. In addition, CCD will also generate corresponding noise pollution during the process of image acquisition and transmission. Therefore, it is necessary to preprocess the image.

  The frequency domain enhancement method is used to make the image clear. The image is Fourier transformed, filtered in the frequency domain, and then the filtered image is inversely transformed to the spatial domain to obtain an enhanced image. In addition, the wavelet threshold denoising method is used to utilize the good effect of wavelet transform in the field of signal denoising and data compression. Based on the different frequencies and amplitudes of signals and noise, the image is subjected to a two-dimensional wavelet transform. According to the difference between the original information of the image and the wavelet transform coefficients of the noise, a threshold is set to remove the noise elements in the wavelet coefficients. The processed wavelet coefficients are used to perform a two-dimensional wavelet inverse transform to obtain the denoised image.
3.2.2 Image segmentation and positioning

  The key to measuring nighttime visibility with digital camera is to accurately extract the brightness information of the image. In the process of brightness calculation, accurately segmenting the light source image is the key to the calculation process. Simple threshold segmentation is prone to misjudgment and affects the calculation of visibility. Image segmentation studies the segmentation algorithm suitable for two target light sources and black bodies, and takes the part of the light source with relatively uniform brightness as the brightness value of the light source and the black body.

  Select a suitable USAN area and use the SUSAN edge detection operator to perform edge detection on the image. Segment the image based on the obtained edge to obtain a binary image of the light source. Take a square template to search and calculate the brightness value in the light source part, and find the area with the highest brightness in the box, and use this area as the brightness value of the light source. Then, based on the relationship between the image size and the corresponding number of pixels, find the position of the black body and calculate the black body brightness value. Figure 7 shows the process from image segmentation to positioning.

  Figure 7 shows the process from image segmentation to positioning

  3.2.3 Calculation of visibility values

  Usually, the real-time requirements for visibility changes are not high. According to the efficiency of DSP calculation, 100 pictures can be superimposed to calculate the average brightness, and then the calculated brightness values ​​of the target light source and target black body are substituted into the extinction coefficient σ and visibility D calculation formula respectively to complete the visibility calculation.

  4 Experimental effect analysis

  The Dongpu Island observation site in Hefei was selected for the visibility experiment. In the experiment, 100 frames of images were averaged to obtain the brightness value. Figure 8 shows the display of the visibility value calculated by the embedded system through the serial port LCD screen.

  Figure 8 shows the visibility value calculated by the embedded system and displayed on the serial port LCD screen

  According to the weather conditions in Hefei in June, the experiment took the night from 19:30 to 5:00 the next day as the night to measure visibility. Figure 9 shows the measurement results from June 8 to June 12, 2012. From the measurement results, it can be seen that the digital camera night visibility meter has almost the same change trend as the forward scattering visibility meter, and the maximum relative standard error is 15%, which meets the World Meteorological Organization's regulations that the standard visibility meter error is less than 20%.

  Figure 9 shows the measurement results from June 8 to June 12, 2012

  5 Conclusion

  The design scheme of the digital image processing platform based on DSP and CPLD designed in this paper can be applied to the nighttime visibility measurement of digital cameras to obtain real-time display of images and calculation of visibility. The image segmentation and positioning algorithm used can obtain a smaller brightness error, and the visibility value is also very close to the manual observation value, with an error within an acceptable 20%. The system has the characteristics of high reliability, strong real-time performance, and high speed. It has been verified by experiments that it meets the requirements of nighttime visibility measurement of digital cameras. In theory, it can be applied to the observation of nighttime visibility, and can be used as a platform for later research and development to continue to carry out nighttime and daytime visibility detection of digital cameras.

Keywords:DSP Reference address:Embedded digital camera nighttime visibility measurement system based on DSP

Previous article:PCB through-hole rework tips: How to solder delicate PCB boards
Next article:Audio technology: Disintegration and MEMS microphones are the trend

Recommended ReadingLatest update time:2024-11-23 18:45

DSP chip selection
      When designing a DSP application system, the selection of DSP chips is a very important step. Only after the DSP chip is selected can the peripheral circuits and other circuits of the system be further designed. In general, the selection of DSP chips should be determined according to the actual needs of the appli
[Embedded]
Design of communication system between single chip microcomputer and digital signal processor based on CAN bus
0 Introduction As we all know, although 8-bit single-chip microcomputers are gradually being replaced by 16-bit or 32-bit microprocessors with high speed and strong performance, 8-bit single-chip microcomputers still occupy the mainstream position in the low-end application market with their low price, rich
[Microcontroller]
Design of communication system between single chip microcomputer and digital signal processor based on CAN bus
Fingerprint identification system based on TMS320VC5409 DSP
1 Introduction   With the continuous development of computers and information technology, research on biometric identification technology has received widespread attention. Biometric identification is a computer technology that uses the biological characteristics of the organism itself to distinguish biological indiv
[Embedded]
Design of frequency converter based on TMS320LF2407
1 Chip Introduction TMS320LF2407 A is a single-chip DSP controller designed by TI for motor control. It has a high-performance C2XLP core, adopts an improved Harvard structure, and has a four-stage pipeline operation. It not only has a powerful and high-speed computing capability, but also integrates a wealth of m
[Embedded]
Design of frequency converter based on TMS320LF2407
DNC Remote Diagnosis and Monitoring System Based on CAN Bus
0 Introduction DNC (Distributed Numerical Control) is a way to integrate CNC machine tools in the workshop with the upper control computer to realize centralized control and management of processing equipment. Although this method fully utilizes the potential of equipment and improves the production efficie
[Security Electronics]
DNC Remote Diagnosis and Monitoring System Based on CAN Bus
Power supply noise problem in DSP
High-speed DSP system designs with higher clock rates and speeds are becoming increasingly complex. As a result, the number of noise sources has increased. Today, high-end DSP clock rates (1GHz) and speeds (500MHZ) generate considerable harmonics due to the PCB traces acting as antennas. The resulting noise degrades
[Embedded]
Power supply noise problem in DSP
Digital Compressed Voice Recording and Playing System Based on TMS320C5402
System Introduction The main function of this system is to compress the voice signal to achieve high-efficiency digital recording, which can be used for telephone messages, voice answering and other occasions. Although the recording time is long when using tape recording to achieve telephone messages, it is
[Embedded]
RTOS video network detection system based on DSP and VxWorks
In remote measurement and control systems, embedded systems have developed rapidly because of their superior stability and real-time performance over traditional platforms. This paper proposes a new embedded system design method based on DSP chips and VxWorks as the operating system. 1. Working Principle of T
[Embedded]
Latest Analog Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号