Background technology
At present high definition camera is the most gradually applied in various intelligent transportation solution, high pixel of its shooting, in high precision, high-quality
The view data of amount makes to capture the illegal evidence of data more fully, effectively, has therefore obtained the favor of numerous user.But its
Huge data volume makes the operational efficiency of candid photograph algorithm face serious test, causes process high-definition image resource occupation excessive.With
As a example by the high-definition camera of 2000000, captured image resolution ratio is 1600*1200, and data volume is about 5.5M, if directly
Processing, be configured to CPU double-core 2.20 as used, inside save as 2G, operating system is the industrial computer of WindowsXP, only locates
Managing a road video, resources occupation rate just may be up to 20%, cannot meet at all and run four roads or above actual demand simultaneously.
Summary of the invention
The present invention proposes a kind of method of solving over-high occupancy of high-resolution image resource, and the method can be described as: in high definition phase
After the internal foundation of machine a kind of caching mechanism, i.e. high definition camera can obtain two kinds of data format HD raw image datas and compression
Little view data (such as 2CIF, CIF), utilize computer program that high-definition image and little image are set up corresponding relation, cache simultaneously
A number of high definition raw image data, and corresponding little view data is transferred to capture end, process for grabbing fearness end.When grabbing
When bat end detects required information, then the high-definition image of correspondence according to corresponding frame number, can be taken out from buffer queue for entering
One step processes and uses.Only processing little image owing to capturing end, this method greatly reduces the resources occupation rate processing high-definition image,
Achieve the target of multidiameter delay, in turn ensure that candid photograph is to high-definition image accurately simultaneously.
Detailed description of the invention
The present invention is mainly a kind of caching mechanism of foundation inside video camera, utilizes the computer program high-definition image to caching and biography
The little image being defeated by candid photograph end process sets up corresponding relation, reduces the purpose of resource occupation.
Specific practice is as follows:
1, video camera can export the view data of two kinds of forms, the most original high-definition data and little through certain compression factor
Image, can be the forms such as CIF or 2CIF.
2, setting up buffer queue for depositing a number of high-definition data at camera internal, queue length can set as required
Fixed.As a example by 1,400,000 high-definition images (resolution is as 1360*1024) JPG form, every two field picture accounts for 5k
Left and right, caches 100 frames and accounts for 500k, as long as therefore reserving corresponding memory headroom.
3, compression after little image and former high-definition image set up the corresponding relation between frame number, due to inside high definition camera initially
During picked-up image, can automatically set up a series of absolute frame number, little image also has identical absolute frame number.Process
Time, when obtaining the first frame of video flowing, the absolute frame number of recordable present image, in follow-up processing procedure,
The frame of video obtained temporally is ranked up, its relative frame number available, by relative frame number via following meter
Calculate the absolute frame number that just can obtain camera internal, and then obtain corresponding high-definition image.
If FrameNum is the absolute frame number of high definition, FrameCorrespond be routine processes relative frame number (after
Frame number when continuous detection algorithm is captured), FrameNumBegin is the absolute frame starting and decoding rear first I frame
Number, then FrameCorrespond with FrameNum corresponding relation is as follows:
FrameNum=FrameCorrespond+FrameNumBegin
4, the little image transmitting after compression is processed by video camera to industrial computer, so can be substantially reduced resource occupation, it is achieved with
Time process multichannel purpose.
5, when industrial computer sends candid photograph instruction, corresponding high-definition image data can be obtained by the way of step 3, carry out
Preserve.
6, buffer queue is periodically emptied.