Embodiment
Method of the present invention utilizes wavelet transformation to obtain the wavelet coefficient of data line linear array CCD image, find out a little bigger and minimal point of local pole wherein, and be quantified as and only comprise 1,-1 and 0 sequence, per 20 row carry out one-accumulate, add up the highest numerical value of frequency that adds up in 5000 line data and occur, as new background texture, upgrade a background with this every 5000 row, carrying out binaryzation line by line calculates, after obtaining current line and preceding 19 line data small echos and change quantizing add up and, and it is compared with background texture piecemeal, if greater than certain threshold value, think that then this section in this row is a target, be changed to 1, otherwise, then be changed to 0, with this this line data is carried out binaryzation; And be the binaryzation result that 1 segment calls target phase, binaryzation result is that 0 segment is called dead band;
On this basis, carry out vehicle line by line and cut apart, for each track is provided with the plurality of vehicles counter, judge the track under it piecemeal, the modification of the driving information of going forward side by side realizes that with this real-time vehicle cuts apart.
Referring to Fig. 1, as follows based on the concrete implementation step of the binaryzation algorithm of image texture characteristic:
1) initialization of variable.Find background indicia bFindBack=false; Current every trade AL=0, background line number counter nBlock=0,20 line data add up by row and nSum[]=0, add up the frequency aBlockInfo[that each segment data occurs] []=0, binaryzation parameter alpha=0.35, β=2.0;
2) from internal memory, read data line, put AL=AL+1, nBlock=nBlock+1;
3) this line data is carried out three grades of wavelet transformations, takes out wavelet coefficient, be stored in array pDWTData[] in;
4) with array pDWTData[] only be converted into and comprise-1,0,1 sequence, be stored in AR[] in.Wherein, with pDWTData[] in local pole be labeled as 1 a little louder, local minimum point is labeled as-1, other points are labeled as 0;
5) if step 2 is changeed in AL<20);
6), and be stored in array nSum[by the row AR value of up-to-date 20 line data that adds up] in;
7) getting window size is 16, to nSum[] in data handle by window, in window ranges, get the value of a maximal value, and be stored in array nSumAvg[as all pixels in this window] in, promptly data line is divided into 64 sections;
8) if bFindBack=false changes step 11);
9) according to background aBack[], carry out binaryzation by following condition;
if(nSumAvg[j]<=α*aBack[j]&&nSumAvg[j]>=β*aBack[j])
The pairing pixel two-value of this row j segment data turns to 1;
else
The pairing pixel two-value of this row j segment data turns to 0;
10) the binaryzation result to data line further handles, if dead band length≤2 between two target phases, then the pixel of this dead band correspondence is filled to 1, if the length of previous target phase≤2, and distance 〉=7 of the back target phase of its distance then are changed to 0 to the pixel of previous target phase correspondence;
11) frequency that occurs of the AR value of up-to-date 20 line data of statistics, and be stored in array aBlockInfo[] in [], this array first dimension is represented the value of AR, and second ties up and represents segment number;
12) if step 2 is changeed in nBlock<5000);
13) according to aBlockInfo[] statistical information of [], find out each section and the maximum numerical value of frequency occurs as new background, and be stored in aBack[] in, put nBlock=0, revise background indicia bFindBack=true, and put aBlockInfo[] []=0;
14) if receive command for stopping, then stop data processing, otherwise change step 2).
Be the convenient vehicle partitioning algorithm of describing, the line array CCD visual field is divided into three logic tracks (corresponding to two monitored physics tracks) according to the close shot camera field of view, and each track comprises some information: pre-trigger sign, confirm to trigger sign, there are counter in null counter, target, target left margin, target right margin, target begin column number, target end line number, trigger the definite line number of point midway, target level projection counter, triggering in advance.
Referring to Fig. 2, the concrete implementation step that vehicle is cut apart is as follows:
1) lane information initialization.Pre-triggering sign with each track, confirm to trigger sign and be changed to false, with the null counter, the target left margin, the target right margin, target begin column number, target end line number, target level projection counter, the definite line number that triggers is changed to 0, objective definition segment length threshold value n1, the level thresholds n2 that merges vehicle, the horizontal projection of determining headstock adds up and threshold value n3, confirm the target width threshold value n4 of triggering, confirm the target length threshold value n5 of triggering, the null that the affirmation target finishes is counted n6, target maximum length n7, the minimum length n8 of target determines it is not that the horizontal projection of headstock adds up and threshold value n9;
2) read the binaryzation result of up-to-date data line;
3) reference position of the next target phase in location;
4) change step 5) if continuous target phase number surpasses n1, otherwise change step 3);
5) judge whether this continuous target phase can merge to the track of having triggered, if can merge, then changes step 6), otherwise change step 7);
Judge track under it according to the mid point of successive objective section,, need judge whether this continuous target phase belongs to the vehicle of triggering in advance in order to prevent false triggering.The objective definition section to the distance that triggers the track in advance is: if this continuous target phase has common factor with the vehicle horizontal extent that triggers the track, think that then this target phase belongs to the vehicle that has triggered in this track, its distance is 0; Otherwise, the minor increment on border, the left and right sides of vehicle in track has been triggered as its distance in the border, the left and right sides of getting continuous target phase distance respectively, if this distance surpasses threshold value n2, think that then this target phase does not belong to the vehicle that has triggered in this track, otherwise think that this target phase belongs to the vehicle that has triggered in this track;
6) revise the boundary information of this track vehicle.The number that target level projection counter is added up target phase piecemeal, the end line of modifying target number, if the border, the left and right sides of this target phase has exceeded the left and right sides bounds in this track, then step 8) is changeed on the border, the left and right sides of modifying target;
7) newly-built information of vehicles on the track under the successive objective section is put pre-triggering and is masked as true, opens target level projection counter, and border, the left and right sides, begin column number, the end line number of target are set;
8) judge whether to handle all segments of this line data,, change step 9), otherwise change step 3) if dispose;
9) handle information of vehicles by the track;
10) if there is target phase to occur on this track, the null counter puts 0, changes step 11), otherwise changes step 14);
11) if this track is not also confirmed to trigger, change step 12), otherwise change step 15);
12) judge whether to satisfy the condition of confirming triggering,, change step 13), otherwise change step 16) if satisfy.Confirm that trigger condition is: the horizontal projection of headstock information adds up and surpasses threshold value n3, and the width of target surpasses threshold value n4, and the length of target is above threshold value n5;
13) put the affirmation triggering and be masked as true, the definite line number of triggering is changed to the beginning line number of target, changes step 19);
14) this track null counter adds 1, if null length surpasses threshold value n6, thinks that then target finishes, and changes step 18), otherwise change step 19);
15) judge whether target length surpasses threshold value n7,, think that then target finishes, and changes step 18 if surpass), otherwise change step 19);
16) judge whether to satisfy the condition that cancellation triggers,, then change step 17 if satisfy), otherwise change step 19).The cancellation trigger condition is: target length surpasses threshold value n8, and perhaps the target length horizontal projection that surpasses n5 and headstock information adds up and less than threshold value n9;
17) cancellation triggers, put pre-triggering sign, confirm that the triggering sign is changed to false, the definite line number of null counter, target left margin, target right margin, target begin column number, target end line number, target level projection counter, triggering is changed to 0, changes step 19);
18) carrying out vehicle cuts apart.Determine the border, the left and right sides of vehicle according to target level projection counter, border, front and back according to the begin column of vehicle number and end line number definite vehicle, sign vehicle scope, and put pre-triggering sign, confirm to trigger sign and be changed to false, the definite line number of null counter, target left margin, target right margin, target begin column number, target end line number, target level projection counter, triggering is put 0;
19) judge whether to handle all tracks,, change step 20 if dispose), otherwise change step 9);
20) if receive command for stopping, then stop data processing, otherwise change step 2).
It below is the specific embodiment that the inventor provides.
Embodiment 1:
With reference to Fig. 3 a-c) shown in, the linear array CCD image that figure a) gathers for daytime is because there is vehicle shadow in the influence of the sun in the image.Employing based on the binaryzation algorithm process effect of image texture characteristic as figure b) shown in, the interference of having removed shade, figure c) be the vehicle segmentation effect, as seen the present invention has effectively suppressed the influence that shade is cut apart vehicle.
Embodiment 2:
With reference to Fig. 4 a-c) shown in, the linear array CCD image that figure a) gathers for evening is because the influence of car light and light filling exists in the image and not only has car light, and has shade.Employing based on the binaryzation algorithm process effect of image texture characteristic as figure c) shown in, the interference of having removed light and shade, figure c) be the vehicle segmentation effect, as seen the present invention has effectively suppressed the influence that shade and car light are cut apart vehicle.