Target image real-time Transmission and tracking and device thereof based on DSP
Technical field
The invention belongs to a kind of image handles and image transmission technology, particularly a kind of target image real-time Transmission and tracking and device thereof based on DSP.
Background technology
General image tracking system is to be imaging sensor with the camera, produces a kind of photoelectronic tracking device of tracking error signal with the image tracker.Image tracking system mainly is made up of four parts such as camera, image tracker, servo system and monitor.Camera is the key component of image tracking system, is used for absorbing the scenery image of (comprising target), and optical imagery is converted to the vision signal that meets television system, generally uses CCD camera, infrared thermoviewer, laser camera etc.The image tracker is the core of entire image tracking system, its major function is that the image that collects is handled, and comprises the preliminary treatment of image, the identification of image (image is cut apart, target recognition and tracking), the processing of output image signal synchronously (stack of ripple door, tracking mark arrange etc.).The image tracking cell provides the tracing deviation value on target bearing and the pitch position, with this servo system that drives the back to the real-time tracking of realization of goal.Servo system is the enforcement parts of following the tracks of, and mainly comprises orientation, pitching, roll three-axle steady platform and phase control unit.Monitor is used for display system to the Video signal processing result.
Image tracking system is to realize by the image of following the tracks of intended target to the tracking of target, yet because factors such as the complexity of the motion of target, background and intensity variations make tracking often can not carry out under desirable condition.At the influence of some objective factors to target following, people have designed multiple track algorithm.Some common algorithms have: methods such as connected domain algorithm, edge tracking, peak time tracking and template matching algorithm.Using in image tracking system at present is connected domain algorithm and template matching algorithm more widely.
Prior art systems generally can only be selected tracking target automatically, can't manually select tracking target; Single connected domain algorithm or the template matching algorithm of general employing merges two algorithms; System does not generally have the Ethernet transfer function.
Summary of the invention
The object of the present invention is to provide a kind of visible images that can utilize that moving target is followed the tracks of, and tracking image can be transmitted by Ethernet, and the computer on the network can be monitored tracing process, and the integrated management computer can also change the target that will follow the tracks of and target image real-time Transmission and tracking and the device thereof based on DSP that switches tracking mode.
The technical solution that realizes the object of the invention is:
A kind of target image real-time Transmission and tracking based on DSP may further comprise the steps:
Step 1: video monitoring signal is connected to the video inputs of graphics processing unit by the output of video camera, finishes the input of vision signal, and the signal of input is the video standard signal of Phase Alternation Line system or TSC-system;
Step 2: the vision signal through the graphics processing unit video inputs is converted into data image signal by Video Decoder, and the Phase Alternation Line system or the TSC-system vision signal that are about to standard are converted to digital difference signal, and its output format is ITU-R BT.656;
Step 3: carry out carrying out image threshold segmentation and binaryzation, target and background is separated, namely adopt maximum variance between clusters to choose the threshold value that image is cut apart automatically according to the luminance signal in every frame of digital color difference signal, brightness value is set to 255 greater than the brightness of the pixel of threshold value, is set to 0 less than the brightness of the pixel of threshold value;
Step 4: utilize the connected domain algorithm, the target in the binary image is divided into a plurality of zones, extract the target that to follow the tracks of according to the criterion of the setting in the algorithm;
Step 5: the To Template of setting up images match with the luminance signal of tracked target, at the Bo Mennei ferret out, calculate the similarity when front template and To Template, with the position of the highest point of similarity as tracked target, if highest similarity is greater than the value of setting, then carry out template renewal, be about to the highest template of similarity as To Template;
Step 6: according to the track of target travel, utilize the position that a bit may occur under the least square method target of prediction, centered by this point, and with fixing ripple door size, the search gate of next frame is set, and send the cradle head control order by serial ports, make The Cloud Terrace move under the target position of a bit;
Step 7: if do not search target at the Bo Mennei of present frame, then in next frame, expand and be twice ripple door size and come ferret out, if next frame does not also search target, then from following frame, adopt the search of connected domain algorithm full screen scanning, up to regaining target;
Step 8: treated image by the Fast Ethernet physical layer, is adopted H.264 standard code compression, transmit the computer decoding vision signal on the network, remote monitoring target following process with the UDP host-host protocol at Ethernet;
Step 9: the integrated management computer sends related command by Ethernet to graphics processing unit, and the target that change will be followed the tracks of and switching tracking mode namely adopt from motion tracking and still manually follow the tracks of.
A kind of target image real-time Transmission and tracking means based on DSP, comprise graphics processing unit, take aim at tool, hunting gear, switch, remote terminal and integrated management PC, wherein, graphics processing unit is respectively with switch, hunting gear with take aim at tool and be connected, switch also is connected with remote terminal with integrated management PC, takes aim at tool and also is connected with hunting gear; Take aim at the visible light vision signal that the camera handle in the tool is gathered, pass to graphics processing unit by the AV video transmission line, graphics processing unit carries out target image and follows the tracks of processing, extract target information, control command is sent to hunting gear by serial ports, hunting gear control is taken aim at tool and is rotated the pursuit movement target, and the processed video image is transferred to switch, switch carries out remote transmission, and the remote terminal on the Ethernet and integrated management PC can monitor tracing process behind the decoded video signal.
The present invention compared with prior art, its remarkable advantage is:
(1) system of the present invention can select tracking target automatically, also can change the target that will follow the tracks of by the integrated management computer;
(2) tracking mode of the present invention can freely changed automatically or manually by the integrated management computer;
(3) system of the present invention adopts the mode that connected domain algorithm and template matching algorithm combine, and realizes the tracking to moving target.With respect to single connected domain algorithm or template matching algorithm, the mode of both combinations can effectively improve the success rate of tracking;
(4) there is Ethernet real-time Transmission function in system of the present invention, can allow real-time monitoring of computer target following process on the network, has novelty and practicality.
Below in conjunction with accompanying drawing the present invention is described in further detail.
Description of drawings
Fig. 1 the present invention is based on the target image real-time Transmission of DSP and the structural representation of tracking means.
Fig. 2 is the composition schematic diagram that the present invention is based on the graphics processing unit of the target image real-time Transmission of DSP and tracking means.
Fig. 3 the present invention is based on the target image real-time Transmission of DSP and the flow chart of tracking.
Embodiment
Referring to Fig. 1, the present invention a kind of target image real-time Transmission and tracking and device thereof based on DSP, its device comprises graphics processing unit, takes aim at tool, hunting gear, switch, remote terminal and integrated management PC, wherein, graphics processing unit is respectively with switch, hunting gear with take aim at tool and be connected, switch also is connected with remote terminal with integrated management PC, takes aim at tool and also is connected with hunting gear; Take aim at the visible light vision signal that the camera handle in the tool is gathered, pass to graphics processing unit by the AV video transmission line, graphics processing unit carries out target image and follows the tracks of processing, extract target information, control command is sent to hunting gear by serial ports, hunting gear control is taken aim at tool and is rotated the pursuit movement target, and the processed video image is transferred to switch, switch carries out remote transmission, and the remote terminal on the Ethernet and integrated management PC can monitor tracing process behind the decoded video signal.
Referring to Fig. 2, graphics processing unit comprises dsp processor, power circuit, reset circuit, clock circuit, debugging interface, serial ports, Fast Ethernet mouth, data memory Flash, synchronous dynamic storage SDRAM and decoder, wherein, dsp processor is connected with Video Decoder with power circuit, reset circuit, clock circuit, debugging interface, serial ports, Fast Ethernet mouth, data memory Flash, synchronous dynamic storage SDRAM respectively.Graphics processing unit is the core component of whole system, it is converted to digital signal gathering the visible light vision signal through Video Decoder, sending into little dsp processor then handles, extract target information on the one hand, the information of gathering is carried out target image follow the tracks of processing, the digital signal after by the Fast Ethernet interface coding being compressed uploads to Ethernet.It is real-time streaming protocol that RTSP is adopted in the Ethernet transmission, UDP is the real time video image transmission technology of bottom host-host protocol, RTSP can provide temporal information and realize that stream synchronously, provide reliable transfer mechanism for transmitting packet in order, flow control or congested control are provided, can make the efficiency of transmission optimization with effective feedback and minimum expense, adopt H.264 video image compression standard, save the network bandwidth.By certain algorithm process, calculate the target location on the other hand, take aim at tool by servomechanism control and rotate the pursuit movement target.Dsp processor is selected high-performance DM642 chip for use, the TVP515O video decoding chip that decoder adopts TI company to produce.
Referring to Fig. 3, a kind of target image real-time Transmission and tracking based on DSP may further comprise the steps:
1.1 video monitoring signal is connected to the video inputs of graphics processing unit by the output of video camera, finishes the input of vision signal, the signal of input is the video standard signal of Phase Alternation Line system or TSC-system.
1.2 the vision signal through the graphics processing unit video inputs is converted into data image signal by Video Decoder, the Phase Alternation Line system or the TSC-system vision signal that are about to standard are converted to digital difference signal, and its output format is ITU-R BT.656.
1.3 carry out carrying out image threshold segmentation and binaryzation, target and background is separated, namely adopt maximum variance between clusters to choose the threshold value that image is cut apart automatically according to the luminance signal in every frame of digital color difference signal, brightness value is set to 255 greater than the brightness of the pixel of threshold value, is set to 0 less than the brightness of the pixel of threshold value.
1.4 utilize the connected domain algorithm based on pixel, the target in the binary image is divided into a plurality of zones, follow the criterion according to the setting in the algorithm to extract the target that will follow the tracks of.
1.5 set up the To Template of images match with the luminance signal of tracked target, the To Template size is got the 20*20 pixel; At the Bo Mennei ferret out, calculate the similarity of real-time subarea image and To Template, calculating formula of similarity is as follows:
Wherein (i j) is reference template image to t, is of a size of M * N.(i j) is real-time subarea image to f;
Similarity satisfies | and r (u, v) | (u, maximum v) is best matched position to≤1, r.In the images match tracing process, the To Template image is sliding in the early pulse, and makes related operation with real-time subarea image, seeks best match point, with the match point of the best position as tracked target.When the similarity of the match point of the best greater than the value of setting, then carry out template renewal, the value of setting is got the number greater than 0.9; The template that adopts refreshes strategy and is:
Wherein, T is new template,
Be the subgraph at current optimal match point place,
For working as front template, α is the confidence level of current optimal match point virgin figure, 0<α<1.
1.6 according to the track of target travel, utilize under the least square method target of prediction position that a bit may occur, with preceding 3 positions of target, come under the target of prediction position of any in the algorithm.The trajectory predictions equation is:
X(k+1)=(4x(k)+x(k-1)?-2x(k-2))/3
Y(k+1)=(4y(k)+y(k-1)?-2y(k-2))/3
Wherein x (t) be target in the position of X direction, y (t) be target in the position of y direction, k is the integer more than or equal to 2;
Centered by this future position, and with the ripple door of 60*60 pixel size, the search gate of next frame is set, and sends the cradle head control order by serial ports, make The Cloud Terrace move under the target position of a bit.
If 1.7 do not search target at the Bo Mennei of present frame, then enlarge ripple door size and come ferret out in next frame, the ripple door size of expansion is 80*80; If next frame does not also search target, then from following frame, adopt the search of connected domain algorithm full screen scanning, up to regaining target.
1.8 treated image by the Fast Ethernet physical layer, is adopted H.264 standard code compression, transmits the computer decoding vision signal on the network, remote monitoring target following process with the UDP host-host protocol at Ethernet.
1.9 integrated management computer monitoring target following process, by the system synthesis administration interface, the tracking mode that system can be set is to adopt from motion tracking or manually tracking, being camera from motion tracking realizes tracking to target according to the tracking control in the algorithm, manually following the tracks of is that the monitor staff is according to video image, send camera by Ethernet to graphics processing unit at the integrated management interface and rotate order, thus control camera tracking target; The monitor staff also can double-click in video window and want the target of following the tracks of, thereby changes the target that will follow the tracks of.