Background technology
High definition camera is applied in the various intelligent transportation solutions gradually at present, and the high pixel of its shooting, high accuracy, high-quality view data make that the illegal evidence of capturing data is abundant more, effective, have therefore obtained numerous users' favor.But its huge data volume makes the operational efficiency of capturing algorithm face serious test, has caused processing high-definition image resource occupation excessive.High-definition camera with 2,000,000 is an example, captured image resolution ratio is 1600*1200, data volume is about 5.5M, if directly handle, be configured to CPU double-core 2.20 as use, in save as 2G, operating system is the industrial computer of WindowsXP, only handle one road video, resources occupation rate just can be up to 20%, can't satisfy at all and move four the road or above actual demand simultaneously.
Summary of the invention
The present invention proposes a kind of too high method of high-definition image resource occupation of handling that solves, this method can be described as: set up a kind of caching mechanism in high definition camera inside, be that high definition camera can obtain two kinds of data formats---the little view data (as 2CIF, CIF) after high definition raw image data and the compression, utilize computer program that high-definition image and little image are set up corresponding relation, the high definition raw image data of while buffer memory some, and a corresponding little image data transmission supplies to grab to be afraid of to hold and handles to capturing end.When the candid photograph end detects needed information, then can be according to corresponding frame number, the corresponding high-definition image of taking-up is further handled altogether and is used from buffer queue.Only handle little image owing to capture end, so just greatly reduce the resources occupation rate of algorithm, realized the target of multidiameter delay, guaranteed to capture simultaneously high-definition image accurately again.
Embodiment
The present invention sets up a kind of caching mechanism in video camera inside, utilizes computer program to hold the little image of handling to set up corresponding relation to the high-definition image of buffer memory with being transferred to capture, and reaches the purpose that reduces resource occupation.
Specific practice is as follows:
1, require video camera can export the view data of two kinds of forms, the little image of promptly original high definition data and the certain compression factor of process can be forms such as CIF or 2CIF.
2, set up the high definition data that buffer queue is used to deposit some in camera inside, queue length can be set as required.With 1,400,000 high-definition images (resolution is 1360*1024) JPG form is example, and every two field picture accounts for about 5k, and buffer memory 100 frames account for 500k, as long as therefore reserve corresponding memory headroom.
3, little image and the former high-definition image after the compression set up the corresponding relation between frame number, because a series of absolute frame numbers can be set up automatically in high definition camera inside when pickup image at first, little image also has identical absolute frame number.During processing, when obtaining first frame of video flowing, can write down the absolute frame number of present image, in follow-up processing procedure, we sort the frame of video that obtains by the time, can obtain their relative frame number, just can obtain the absolute frame number of camera inside via following calculating, and then obtain corresponding high-definition image by relative frame number.If FrameNum is the absolute frame number of high definition, FrameCorrespond is the relative frame number (frame number when the subsequent detection algorithm is captured) of routine processes, FrameNumBegin is for starting the absolute frame number of first I frame of decoding back, and then FrameCorrespond and FrameNum corresponding relation are as follows:
FrameNum=FrameCorrespond+FrameNumBegin
4, the little image after video camera will compress is transferred to industrial computer and handles, and can reduce resource occupation greatly like this, realizes handling simultaneously the purpose of multichannel.
5, when industrial computer sends the candid photograph instruction, can obtain corresponding high-definition image data, preserve by the mode of step 3.
6, regularly empty buffer queue.