Abstract: This paper proposes a new design of an image acquisition card, which uses two memories to be used alternately, so that image acquisition and computer reading of image data can be carried out at the same time, improving image quality. The defects of general image capture cards are analyzed, and the design ideas and principles of new image capture cards are given.
Keywords: image acquisition, upper memory, computer
Digital image processing technology is increasingly widely used in many fields. Microcomputer image processing systems are widely used in medical, meteorological, industrial vision and other fields due to their flexible use and high cost performance. In industrial control, cameras are generally used to obtain on-site images, but now the signals output by cameras are mostly analog signals. In order to realize the interface between the camera and the computer, an image capture card must be used.
However, the image acquisition cards currently on the market often cannot collect data and read data at the same time, which brings great trouble to programming and real-time control. The image card provided in this article solves this problem. It uses two pieces of memory. The memory read by the computer and the memory used for image acquisition are used alternately, so that image acquisition and data reading by the computer can be carried out at the same time.
This article first analyzes the defects of general image capture cards, and then gives the principles and design ideas of new image capture cards. Since this frame grabber is based on the full TV signal, it is necessary to briefly introduce the black and white full TV signal.
1 Full TV signal and its principles
The black and white CCD camera converts the image (light signal) into an electrical signal through photoelectric conversion, and its final output signal is a black and white full TV signal. It mainly consists of image signal (video signal), composite blanking pulse and sync pulse.
The polarity of TV signals can be divided into positive polarity and negative polarity image signals. If the image is the brightest, the corresponding signal voltage has the largest amplitude, then the signal is called a positive polarity signal; otherwise, it is a negative polarity signal. Negative polarity signals are used here. The image signal is sent to the video amplifier for amplification and processing, and at the same time, the horizontal and vertical synchronization pulses and horizontal and vertical blanking pulses sent by the synchronizer are added to form a full TV signal.
The blanking pulse is mainly used to eliminate the retrace lines generated during the reverse path of horizontal and field scanning. The synchronization pulse ensures that the scanning points at the receiving end and the originating end should have a one-to-one corresponding geometric position.
Since there is no horizontal synchronization signal during field synchronization, this affects strict synchronization throughout the scanning process. In order to solve the entire problem, the method of slotting in the field synchronization pulse is used to replace the synchronization signal. The pulses twice the horizontal frequency before and after the field synchronization are called equalization pulses.
TV standards stipulate that the amplitude ratio of the entire TV signal is: if the peak white level to the sync level is taken as 100%, then the value from the peak white level to the blanking black level is 75%, and the peak white level is 0%, the image signal is between white and black levels.
The signal is shown in Figure 1. From a time perspective, 25 frames of images are transmitted per second, with 625 lines per frame; during interlaced scanning, there are 50 fields per second, and 312.5 lines per field. The period of each line is 64μs, of which the image takes up 52.2μs and the line blanking takes up 11.8μs. The horizontal synchronization pulse is 4.7μs, which is delayed by 1.3μs than the horizontal blanking. The period of each field is 312.5H=20ms, in which the field blanking signal accounts for 25H+1 line blanking signal, which is equal to 1600μs+11.8μs. The width of the equalization pulse is 2.35μs, and the period is half a line, with a total of 12 pulses (the first 6 and the last 6). The width of the field sync pulse is 2.5H time, which is 160μs. The field synchronization pulse has 6 groove pulses and its width is 4.7μs.
In the full TV signal, the leading edge of the odd-numbered field sync signal is used as the starting point of one field. Lines 1, 2, and 3 are field sync signals, lines 4, 5, and 6 are post-equalization pulses, and lines 7 to 22 are still field cancellations. The blanking signal of this field starts from line 623 of the previous field. Therefore, the entire blanking signal is 25 lines plus the blanking time of one line. The image signal appears from line 23 to line 309.5, a total of 287.5 lines. This is the first field or odd field. Starting from line 309.5 is the field blanking signal and pre-equalization pulse of the next field. The synchronization pulse of the next even field appears at line 312.5. The odd number ends here and the even field begins. An odd field plus an even field together is called a frame.
2 Principles of general image capture cards
The structure of a general image acquisition card is shown in Figure 2.
First, the video signal is preprocessed and synchronously separated. Preprocessing mainly includes amplification, brightness, contrast adjustment, and signal limiting (protecting A/D). The synchronization separation circuit mainly separates the horizontal synchronization and field synchronization signals in the signal for use by the timing circuit of the acquisition card. Then the processed video signal is converted into a digital signal by a high-speed A/D converter, and written into the memory under the control of the timing circuit.
But there is a problem with such a capture card. Data collection and data reading cannot be performed at the same time. It may be assumed that during the odd-numbered field scanning period, the A/D conversion result is stored in the memory every time a sample is taken. During the even-numbered field period, the computer reads the data in the memory into the computer. However, when the computer reads the memory, the results of the A/D conversion cannot be written to the memory at the same time, that is, the memory cannot perform both reading and writing operations at the same time, so the even field information will be lost.
3 Design of image capture card based on dual memory
In order to solve this problem, two pieces of memory are used to work alternately. When data is written to one piece of memory, the computer reads data from the other piece of memory, and vice versa. The block diagram of this capture card is shown in Figure 3. Each part of the circuit is introduced below.
(1) Preprocessing circuit: realizes the conversion of standard full TV signals into 0~5V analog signals, and has functions such as brightness adjustment and contrast adjustment. The operational amplifier used in the amplifier adopts wideband operational amplifier LM318.
(2) Synchronization separation circuit: In order to store the digitized image signal into the corresponding frame memory, the horizontal synchronization signal and the field synchronization signal must be obtained. Since the synchronization signal has the largest amplitude, accounting for 76% to 100% of the total TV signal amplitude, the amplitude separation method can be used to separate the composite synchronization signal based on this feature. And because the width of the field synchronization pulse is 160μs, which is much larger than the width of the horizontal synchronization pulse of 4.7μs, the row synchronization and field synchronization can be further separated from the separated horizontal and field composite synchronization signals.
(3) A/D converter: The A/D converter in the image capture card is completed with the 8-bit high-speed video conversion chip CA3318CE. Its maximum conversion rate can reach 15MHz. From the previous analysis of the black and white full TV signal, it can be seen that each line of image takes about 52.2μs. This card needs to sample 512 points during the line of each line of the TV signal, and the sampling clock is about 10MHz. Therefore, choosing CA3318CE fully meets the requirements, and only needs to select its sampling rate at 10MHz.
(4) Control circuit: The core device of the control circuit is a general logic gate array GAL20V8. This circuit generates the read signals MEMR1, MEMR2 and write signals MEMW1, MEMW2 of the frame memory as well as the working status signals PC/LOCAL and required by the image acquisition card! PC/LOCAL, the circuit principle is shown in Figure 4. U33 is a GAL20V8, it works in simple mode, pins 18~22 are configured as outputs, and the others are configured as inputs. Pins 1~6 are connected to the address lines PC_A4~PC_A9 of the PC, pins 7~10 are connected to the address lines PC_A16~PC_A19 of the PC, pin 11 is connected to the system clock CLK, pin 1 3 Connect to PC_IOW signal, pin 14 is connected to the PC/LOCAL signal, pins 15 and 16 are connected to the blanking and vertical blanking indication signals H_MR and V_MR respectively, pin 17 is connected to the PC's read memory signal PC_MEMR, pin 1 8, 19 Writing of output frame memory RAM1 The signal MEMW2 and the read signal MEMR2, pins 20 and 21 output the write signal MEMW1 and the read signal MEMR1 of the memory RAM1, and the pin 22 outputs the signal PC/LOCAL_CLK as The clock of flip-flop OP6B, pin 23 is connected to the PC_AEN signal of the PC.
The control circuit also generates PC/LOCAL signals. This signal must be controlled by PC. Here, the PC / LOCAL is the lowest as the PC I / O port. The mouth address is 220h to 22FH. The PC only needs to write 1 or 0 to 220h to 22FH. . The decoding of the I/O port address is completed by U33, which can be described in ABEL language as follows:
IOCS=! (!PC_A4&PC_A5&!PC_A6&PC_A7&!PC_A8&PC_A9&!PC_AEN
PC/LOCAL_CLK=IOCS#PC_IOW
IOCS is the strobe signal of the port and is active at low level. When the PC's address lines PC_A9 ~ PC_A4 are 100010, PC_AEN is low level. When PC_AEN is high level, it indicates that the PC is in the DMA state. IOCS is valid. PC/LOCAL_CLK is generated by the OR of IOCS and the I/O port write address PC_IOW of the PC. When the port is not selected, it is always high; when the port is selected, it is generated by PC_IO W generates a rising edge. The rising edge of PC/LOCAL_CLK will trigger OP6B, latch the lowest bit data line PC_D0 of the PC, and generate PCLOCAL sum! PCLOCAL.
When the address of the frame memory is generated by the PC, decoding logic is required. The memory space allocation for PCs below 1M is shown in Table 1. In order to avoid address conflicts, it can be seen from the table that the D0000H~DFFFFFH space can be used as the mapping address of the frame memory. This part of the decoding work is also completed by U33 and is described in ABEL language:
Table 1 Low-end memory space allocation of microcomputer
memory area | content |
A 0000~AFFFF | EGA display memory |
B 0000~B7FFF | Monochrome display memory |
B 8000~BFFFF | color display memory |
C 0000~C7FFF | Graphics BIOS |
C 8000~EFFFF | none |
F 0000~FFFFF | System BIOS |
MEMCS=! (PC_A19&PC_A18&!PC_A17&PC_A16
It can be seen from the formula that when PC_A19 ~ PC_A16 is 1101, MEMCS is active (low level).
The read signals MEMR1 and MEMR2 and the write signals MEMW1 and MEMW2 of the frame memory are also generated by the control circuit. When PC/LOCAL is 0, the PC reads the frame memory RAM1, and at the same time the AD conversion result is sent to the frame memory RAM2; vice versa. The read signal is generated by the PC's external memory read signal PC_MEMR and the decoding signal MEMCS; the write signal is generated by the system clock CLK, row and field blanking indication signals H_MR, V_MR. When either H_MR or V_MR is high level, it indicates that it is in the blanking state; only when H_MR and V_MR are both low level, it indicates that it is in field positive and row positive, and the result of A/D conversion is written into the frame memory.
(5) Memory: For real-time collection and display, a memory is set in the digital image capture card. Generally, the image frame memory has the following requirements: A. high-speed access, B. large storage capacity, and C. asynchronous input and output access. The storage capacity necessary to store one frame or field of television signal can be calculated by the following formula:
Storage capacity = number of scanning lines in one frame (or one field) × number of samples in one line × number of quantization bits
In this image acquisition card, the image collected in one field is 512×256 points, which requires a memory with a storage capacity of 128K×8bit. As discussed in the previous hardware block diagram, two pieces of frame memory need to work alternately, that is, two pieces of 128K×8bit frame memory need to be set up to store the data information of odd fields and even fields respectively, so two pieces of high-speed static storage are selected. ChipSRAM 628128.
The read signals MEMR1 and MEMR2 and the write signals MEMW1 and MEMW2 of the two frame memories are generated by the control circuit. The read signal is related to the PC's read memory signal PC_MEMR, while the write signal is related to the sampling clock of the image acquisition card! CLK related. The eight-bit data lines D0~D7 of the frame memory are connected to the data lines PC_D0~PC_D7 of the PC through the interface circuit.
As mentioned above, the frame memory is mapped to D0000H ~ DFFFFFH, so the addressing range is only 64K, and the image data of one field is 128K, so address segmentation is used to achieve this, which can be achieved by performing I/O operations on the frame memory address line A16 accomplish.
(6) Timing generation circuit: Mainly used to generate the scanning address signal of the frame memory required by the image acquisition card and the blanking signal to achieve synchronization and avoid row reversal.
(7) Address switching circuit: This circuit is used to switch the scanning address signal generated by the timing generating circuit and the address signal of the PC. It is necessary to use a data selector to switch the address signal of the PC and the address signal of the acquisition card. Only four-bit data selectors can be found in general integrated circuits. If it is selected, 34 address lines will require nine pieces, which will take up too much space on the acquisition card, so GAL devices are used to implement it. Each GAL16V8 can achieve 8-bit data selection, while GAL20V8 can achieve 10-bit data selection, so 34 address lines only require 3 GAL16V8 and 1 GAL20V8.
The image capture card has been produced and its tested performance fully meets the design requirements. This image capture card can be used in DOS operating system and Windows operating system. Due to the use of programmable logic devices, the number of chips is greatly reduced.
Using a camera and a capture card as a sensor can solve many situations that conventional sensors cannot achieve. For example, in order to measure the height of the molten iron level in the sand mold during the automatic pouring process in the foundry, conventional liquid level sensors cannot withstand the high temperature of 1400°C. Even if there is such a sensor, because after a sand mold is poured, a new sand mold is delivered, and it is impossible to insert a liquid level sensor in each sand mold. By using a camera to capture the image of the sand mold sprue cup, and using a computer to process the image, the height of the molten iron level in the sand mold sprue cup can be calculated, thus solving the real-time control problem in the automatic pouring system.
Previous article:Development of video character overlay technology and four implementation solutions
Next article:14-bit 10MHzCCD/CIS signal processor
- Popular Resources
- Popular amplifiers
- 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
- CCS6.0 creates a DSPc2000 series project operation steps
- Live FAQ: Renesas RA MCU family members are growing rapidly, helping to build safe and stable industrial control systems
- Bluetooth protocol analysis (5)_Technical analysis related to BLE broadcast communication
- [Voice and vision module based on ESP32S3] Software development progress - using openmvIDE, I can finally transfer pictures, the speed is...
- Check out the exclusive disassembly document! How do TWS earphones achieve hands-free and voice wake-up control?
- Shenmu Android Face Recognition SDK Compilation Instructions
- C6678 multi-core DSP development - several key issues of hello world
- For example, #35: #error directive "Not supported." What is the reason? Please give me some advice.
- First time drawing board, newbie help
- Heart rate and blood oximeter chips are welcome to be added! If you have sensors or chips for thermometers and blood pressure meters, please add them too.