Summary of the invention
The invention provides method for testing motion and device, to reduce the complexity of motion detection.
Technical scheme of the present invention is achieved in that
A kind of method for testing motion, this method comprises:
A, the area-of-interest of current frame image being carried out macroblock partitions, is sub-macro block more than with each macroblock partitions;
B, for current macro, selection portion molecule macro block in all sub-macro blocks of this macro block; For selected each sub-macro block, calculate each pixel block values in this sub-macro block and the difference of this pixel block values in the background model, with the difference addition of all block of pixels correspondences, obtain the motion ident value of this sub-macro block; With the motion ident value addition of selected sub-macro block, obtain the motion ident value of current macro;
C, judge current macro the motion ident value whether greater than preset value, if determine that current macro is the motion macro block, upgrades the border of current moving object with the border of current macro; Otherwise, determine that current macro is a background macro block.
Described current macro is first macro block of current moving object,
Further comprise between described step B, the C:
B1, the right piece that adopts step B calculating current macro and the motion ident value of following piece;
And the motion ident value of the described judgement current macro of step C greater than after the preset value, judge that whether current macro is that the condition of motion macro block is: whether the motion ident value of judging the right piece of current macro and following piece all greater than preset value, if determine that then current macro is the motion macro block.
Described current macro is first macro block of current moving object,
The border that step C upgrades on described border with current macro current moving object further comprises afterwards:
D, according to the border of current moving object, be the center with current moving object, a macro block length is expanded in current moving object respectively on the direction of upper and lower, left and right, obtain a rectangle frame after the expansion;
E, for each direction of having expanded a macro block length, searching moving macro block in the macro block of expanding on this direction if search, is then expanded a macro block length with the border of current moving object on this direction; When the macro block of each direction of having expanded a macro block length all being searched for when finishing, judge whether not search any motion macro block, if the border of determining current moving object is the final border of moving object, otherwise, return step e.
Described in all sub-macro blocks of this macro block selection portion molecule macro block be: in all sub-macro blocks of this macro block, serve as chooser macro block at interval with a preset number sub-macro block;
The described difference addition of step B with all block of pixels correspondences, the motion ident value that obtains this sub-macro block comprises:
For each row of this sub-macro block, with the difference addition of all block of pixels correspondences of these row, if gained and value, determine then that the motion ident value of these row is M greater than noise threshold; Otherwise the motion ident value of determining these row is N; With the motion ident value addition of all row of this sub-macro block, obtain the motion ident value of this sub-macro block, wherein, M, N are default constant.
The border of described definite current moving object is that the final border of current moving object further comprises afterwards:
With current moving object and predetermined movement object rule match, if on the coupling, determine that current moving object is the real motion object; Otherwise, determine that current moving object is chaff interference.
Described definite current moving object is that the real motion object further comprises afterwards:
Detected moving object is counted to current frame image, if count value arrives preset value, then stops current frame image being carried out motion detection, and count value is exported.
The described definite current macro of step C is that background macro block further comprises afterwards:
Judge whether predetermined continuously frame number is confirmed as background macro block to this macro block, if, according to this macro block in this macro block update background module in this continuously predetermined frame number image.
A kind of motion detection apparatus, this device comprises:
The macroblock partitions module is carried out macroblock partitions to the area-of-interest of current frame image, is sub-macro block more than with each macroblock partitions;
Motion macro block search module, for current macro, selection portion molecule macro block in all sub-macro blocks of this macro block; For selected each sub-macro block, calculate each pixel block values in this sub-macro block and the difference of this pixel block values in the background model, with the difference addition of all block of pixels correspondences, obtain the motion ident value of this sub-macro block; With the motion ident value addition of selected sub-macro block, obtain the motion ident value of current macro; If the motion ident value of current macro, determines then that current macro is the motion macro block greater than preset value, the boundary information of current macro is outputed to the border update module; Otherwise, determine that current macro is a background macro block;
The border update module is upgraded the border of current moving object according to the boundary information of current macro.
Described macroblock partitions module comprises:
First divides module, and the area-of-interest of current frame image is carried out macroblock partitions, is sub-macro block more than with each macroblock partitions;
Second divides module, is unit with a preset number pixel, is an above block of pixels with each macroblock partitions,
And described motion macro block search module comprises:
Search module, if current macro is first macro block of current moving object, then right piece and the following block identification with current macro sign and current macro sends to motion ident value computing module, if the motion ident value of the current macro that motion ident value computing module returns, the right piece of current macro and following piece is all greater than preset value, determine that then current macro is the motion macro block, the boundary information of current macro is outputed to the border update module;
Motion ident value computing module, receive the macro block sign that search module is sent, according to default selective rule, selection portion molecule macro block from this macro block, for selected each sub-macro block, calculate each pixel block values in this sub-macro block and the difference of this pixel block values in the background model, difference addition with all block of pixels correspondences, obtain the motion ident value of this sub-macro block, motion ident value addition with selected all sub-macro blocks, obtain the motion ident value of this macro block, the motion ident value of this macro block is returned to search module.
Described macroblock partitions module comprises:
First divides module, and the area-of-interest of current frame image is carried out macroblock partitions, is sub-macro block more than with each macroblock partitions;
Second divides module, is unit with a preset number pixel, is an above block of pixels with each sub-macroblock partitions,
And described motion macro block search module comprises:
Search module, if current macro is first macro block of current moving object, then right piece and the following block identification with current macro sign and current macro sends to motion ident value computing module, if the current macro that motion ident value computing module returns, the right piece of current macro and the motion ident value of following piece are all greater than preset value, determine that then current macro is the motion macro block, the boundary information of current macro is outputed to the border update module, and with the current macro is the center, on current macro, down, a left side, right four direction is expanded a macro block length respectively, obtain a rectangle frame after the expansion, each macro block sign of expansion is sent to motion ident value computing module, if the motion ident value of the macro block that motion ident value computing module returns is greater than preset value, determine that then this macro block is the motion macro block, the pairing directional information of this macro block is sent to the border update module, simultaneously, a macro block length is expanded in current moving object on the direction of this macro block correspondence, obtain a rectangle frame after the expansion, the macro block sign of expanding is sent to motion ident value computing module; As if not searching any motion macro block on all directions of having expanded a macro block length in current moving object, then send current moving object border and determine indication to the border update module;
Motion ident value computing module, receive the macro block sign that search module is sent, according to default selective rule, selection portion molecule macro block from this macro block, for selected each sub-macro block, calculate each pixel block values in this sub-macro block and the difference of this pixel block values in the background model, difference addition with all block of pixels correspondences, obtain the motion ident value of this sub-macro block, motion ident value addition with selected all sub-macro blocks, obtain the motion ident value of this macro block, the motion ident value of this macro block is returned to search module
And described border update module receives the directional information that search module is sent, and a macro block length is expanded on the border of current moving object on this direction; Receive the definite indication in current moving object border that search module is sent, the border of determining current moving object is the final border of current moving object.
Described motion ident value computing module comprises:
Sub-macro block is selected module, receives the macro block sign that search module is sent, and according to default selective rule, selection portion molecule macro block from this macro block sends to computing module with selected sub-macro block sign;
Computing module, receive selected sub-macro block sign, for each selected sub-macro block, calculate each pixel block values in this sub-macro block and the difference of this pixel block values in the background model, each row for this sub-macro block, with the difference addition of all block of pixels of these row, if gained and value, determine then that the motion ident value of these row is M greater than noise threshold; Otherwise the motion ident value of determining these row is N; With the motion ident value addition of all row of this sub-macro block, obtain the motion ident value of this sub-macro block; With the motion ident value addition of selected all sub-macro blocks, obtain the motion ident value of current macro, the motion ident value of current macro is returned to search module, wherein, M, N are default constant.
Described border update module is further used for, when the final border of current moving object is determined, with the boundary information output of current moving object;
And described device further comprises: moving object rule match module, the boundary information of the current moving object that reception border update module is sent according to this boundary information and predetermined movement object rule, judges whether current moving object is the real motion object, if keep this moving object; Otherwise, delete this moving object.
Described moving object rule match module is further used for, after definite current moving object is the real motion object, and the indication of output counting;
And, described device further comprises: counting module, be used for after receiving the counting indication that moving object rule match module is sent, the moving object count value of current frame image is added 1, judge whether count value arrives preset value, if with count value output, and the stop motion of notice motion macro block search module detects.
Described motion macro block search module is further used for, after definite current macro is background macro block, with current frame image sign and the output of this background macro block sign;
And, described device further comprises: the background model update module, be used to receive image identification and the background macro block sign that motion ident value computing module is sent, if find that this background macro block identifies the predetermined continuously frame number of corresponding macro block and is confirmed as background macro block, then according to this macro block in this macro block update background module of being somebody's turn to do in the continuously predetermined frame number image.
Compared with prior art, the inventive method comprises: A, the area-of-interest of current frame image being carried out macroblock partitions, is sub-macro block more than with each macroblock partitions; B, for current macro, selection portion molecule macro block in all sub-macro blocks of this macro block; For selected each sub-macro block, calculate each pixel block values in this sub-macro block and the difference of this pixel block values in the background model, with the difference addition of all block of pixels correspondences, obtain the motion ident value of this sub-macro block; With the motion ident value addition of selected sub-macro block, obtain the motion ident value of current macro; C, judge current macro the motion ident value whether greater than preset value, if determine that current macro is the motion macro block, upgrades the border of current moving object with the border of current macro; Otherwise, determine that current macro is a background macro block.The present invention need not to adopt the Gaussian function density estimation method to carry out modeling, and selection portion molecule macro block in the macro block of area-of-interest, determine that by selected sub-macro block being carried out calculus of differences whether macro block is the motion macro block, has reduced the complexity of motion detection.
Embodiment
The present invention is further described in more detail below in conjunction with drawings and the specific embodiments.
Fig. 1 is a method for testing motion flow chart provided by the invention, and as shown in Figure 1, its concrete steps are as follows:
Step 100: the position that preestablishes area-of-interest.
The position of area-of-interest can change with the change of concern condition etc.
Step 101: receiving current frame image, the area-of-interest of current frame image is carried out macroblock partitions, is sub-macro block more than with each macroblock partitions.
Step 102: for current macro, according to default selective rule, selection portion molecule macro block in current macro is a unit with a preset number pixel, is an above block of pixels with each sub-macroblock partitions.
Step 103: for selected each sub-macro block, each pixel block values in this sub-macro block and this pixel block values in the background model are made difference,, obtain the motion ident value of this sub-macro block with the difference addition of all block of pixels.
If with m pixel is that unit is a block of pixels with sub-macroblock partitions, the pixel value of establishing 1 pixel again is n bit (bit), and then each pixel block values is m * n bit, like this, pixel block values is made difference and single pixel value is compared as difference, and its stability is higher.
Step 104:, obtain the motion ident value of current macro with the motion ident value addition of selected all sub-macro blocks.
Step 105: whether the motion ident value of judging current macro greater than preset value, if, execution in step 106; Otherwise, execution in step 107.
Step 106: determine that current macro is the motion macro block, upgrade the border of current moving object, go to step 109 with the border of current macro.
Step 107: determine that current macro is a background macro block, judge whether to satisfy moving object boundary search end condition, if, execution in step 108; Otherwise, execution in step 109.
Moving object boundary search end condition can be: search is less than the motion macro block in the preset range on current moving object border.
Step 108: determine the boundary search of current moving object is finished, the next one that goes to area-of-interest is not searched for macro block, begins to detect next moving object, returns step 102.
Step 109: the next one that goes to current macro is not searched for adjacent piece, continues the border of the current moving object of search, returns step 102.
The method for testing motion flow chart that Fig. 2 provides for the embodiment of the invention, as shown in Figure 2, its concrete steps are as follows:
Step 200: the position that preestablishes area-of-interest.
Step 201: receiving current frame image, current frame image is divided into 16 * 16 macro block, is 4 16 * 4 sub-macro block with each macroblock partitions.
Step 202: with first macro block of area-of-interest as current macro.
Step 203:, be that unit is divided into 4 block of pixels with 4 pixels with per 1 of this sub-macro block 16 capable pixels at the 1st, 3 16 * 4 sub-macro block of current macro.
Step 204:, calculate the difference of this pixel block values in this pixel block values and the background model for each block of pixels.
Step 205: for the 1st, 3 sub-macro block, respectively with the difference addition of 4 block of pixels correspondences of each row, if gained and value then make the motion ident value m=1 of these row greater than default noise threshold; Otherwise, make the motion ident value m=0 of these row.
Step 206: calculate the 1st, 3 sub-macro block all row the motion ident value m's and value, obtain the motion ident value M of current macro.
Step 207: judge M>M
0Whether set up, if, execution in step 208; Otherwise, execution in step 216.
M
0Be preset value.
Step 208: adopt step 203~206 to calculate the right piece of current macro and the motion ident value M of following piece.
Step 209: whether the M that judges the right piece of current macro and following piece is all greater than M
0If,, execution in step 210; Otherwise, execution in step 216.
Step 210: determine that current macro is the motion macro block, with the border of current macro initial boundary as current moving object.
Step 211: according to the border of current moving object, be the center, on the four direction of the upper and lower, left and right of current moving object, expand a macro block length respectively with current moving object.
After current moving object expansion, what obtain is a rectangle frame all the time.
Step 212: for each direction of having expanded a macro block length, in the macro block of on this direction, expanding, the searching moving macro block.
Here, when the searching moving macro block,, obtain the motion ident value M of this macro block, if M>M0 determines that then this macro block is the motion macro block by step 203~206 for each macro block.
Step 213: judge whether on all directions of having expanded a macro block length, not search any motion macro block, if, execution in step 215; Otherwise, execution in step 214.
Step 214: for each direction that searches the motion macro block, a macro block length is expanded on the border of current moving object on this direction, returned step 212.
In the present embodiment, current moving object is represented with a rectangle frame all the time.
For the macro block of expanding on certain direction, as long as search a motion macro block, then a macro block length is expanded on the border of moving object on this direction, this motion macro block search procedure to this direction finishes simultaneously.
Step 215: the border of determining current moving object is the final border of current moving object, and the next one that goes to area-of-interest is not searched for macro block, to begin the detection to next moving object, returns step 203.
Step 216: determine that current macro is a background macro block, the next one that goes to area-of-interest is not searched for macro block, continues the searching moving object, returns step 203.
In embodiment illustrated in fig. 2, when the motion ident value of computing macro block, be that the 1st, 3 sub-macro block according to this macro block calculates, in actual applications, also can calculate according to the 2nd, 4 sub-macro block.
In addition, in embodiment illustrated in fig. 2, the size of sub-macro block is 16 * 4, in actual applications, can be other size with sub-macroblock partitions according to actual needs also, and for example: the size of sub-macro block also can be 4 * 16, perhaps 16 * 8,8 * 16, or the like.According to the motion ident value of the motion ident value computing macro block of sub-macro block the time, general principle is: with 1 sub-macro block is interval chooser macro block, calculate the motion ident value of selected sub-macro block,, obtain the motion ident value of macro block the motion ident value addition of selected sub-macro block.
After the motion detection of finishing current frame image, the positional information and the current frame image of all moving objects can be transferred to display module, also can in current frame image, identify the border of each moving object, then current frame image is transferred to display module.
After in step 215, determining the final border of current moving object, if current moving object and predetermined movement object rule match on the coupling, can be determined that then current moving object is the real motion object, keeps this moving object; Otherwise, this moving object is considered as chaff interference, delete this moving object.The moving object rule can for: the area of moving object is greater than preset value, perhaps: the difference of the brightness of moving object and the brightness of preset range block of pixels on every side is greater than preset value.
In addition, in some scene, require:, notify the monitor staff, and needn't move detection to this two field picture again when the moving object number in the two field picture during greater than preset number.Like this, in the present embodiment, determine the final border of current moving object in the step 215 after, to count detected moving object in the current frame image, if count value arrives preset value, then stop current frame image being carried out motion detection, and count value is exported.
In addition, in the embodiment of the invention, can carry out motion detection result to each macro block of area-of-interest and follow the tracks of, if a continuous p of macro block (p 〉=2) frame is confirmed as static macro block, then according to this macro block in this macro block update background module in this continuous p (p 〉=2) frame.
Below be example with a macro block, the process of the motion ident value of this macro block of calculating that the embodiment of the invention is provided describes:
Fig. 3 is the division exemplary plot to one 16 * 16 macro block of area-of-interest, as shown in Figure 3, it with this macroblock partitions 4 16 * 4 sub-macro block, for the 1st, 3 sub-macro block, is that unit is divided into 4 block of pixels with 16 pixels of each row with 4 pixels, and the sequence number of each block of pixels is 0,1,2,3.
For each block of pixels in the 1st, 3 the sub-macro block, calculate the difference of this pixel block values in this pixel block values and the background model, calculate respectively then 4 block of pixels correspondences of each row in the 1st, 3 the sub-macro block 4 differences and, if this difference greater than noise threshold, then makes the motion ident value m=1 of these row; Otherwise, make the motion ident value m=0 of these row; With the motion ident value m addition of all row of the 1st, 3 sub-macro blocks, obtain the motion ident value M of this 16 * 16 macro block then.Fig. 4 is for calculating the exemplary plot of motion ident value of the 1st 16 * 4 sub-macro block, and wherein, pix_ij represents j the pixel block values that the i of current sub-macro block is capable, back_00 represents j the capable pixel block values of i of the current sub-macro block of background model, wherein, 0≤i≤3,0≤j≤3.
Below provide one and use the example that the present invention determines the moving object border:
Shown in Fig. 5-1, if macro block 0 is the 1st macro block of area-of-interest, after adopting step 203~210 to determine that macro block 0 is for the motion macro block, determine that then the border of macro block 0 is the initial boundary of first moving object of current frame image, promptly represent current moving object as the dash area among Fig. 5-1;
Then, be the center with macro block 0, on the four direction of the upper and lower, left and right of macro block 0, expand a macro block length respectively, shown in Fig. 5-1, searching moving macro block in the macro block of on each direction, expanding then, that is: for the top of macro block 0, searching moving macro block in macro block 8,1,2; Right-hand for macro block 0, searching moving macro block in macro block 2,3,4; For the below of macro block 0, searching moving macro block in macro block 4,5,6; For the left of macro block 0, searching moving macro block in macro block 6,7,8.If Search Results is: macro block 1 is the motion macro block, and the border of then upgrading current moving object is: the border of macro block 0+1, the current moving object after promptly representing to upgrade as the dash area among Fig. 5-2;
Then, be the center with macro block 0+1, macro block length of expansion above macro block 0+1, shown in Fig. 5-2, searching moving macro block in the macro block 9,10,11 of expansion above macro block 0+1, if search, the border of then upgrading current moving object is: the border of macro block 0+1+10.
Need to prove, if search a motion macro block, and this macro block is corresponding both direction simultaneously, then need the border of current moving object is expanded on this two direction simultaneously, as: establish among Fig. 5-1, search macro block 2 and be the motion macro block, then need upgrade the coboundary and the right margin of current moving object simultaneously, the border of the current moving object after the renewal is: the border of macro block 0+1+2+3, the current moving object after promptly representing to upgrade as the dash area among Fig. 5-3; Then, be the center with macro block 0+1+2+3, above macro block 0+1+2+3 and right-handly expand a macro block length respectively, shown in Fig. 5-3, Kuo Zhan macro block is 9,10,11,12 up, is 12,13,14,15 at the macro block of right-hand expansion.
Fig. 6 is the composition diagram of motion detection apparatus provided by the invention, and as shown in Figure 6, this device comprises: macroblock partitions module 61, motion macro block search module 62 and border update module 63, wherein:
Macroblock partitions module 61: the area-of-interest to current frame image carries out macroblock partitions, with each macroblock partitions is sub-macro block more than, with a preset number pixel is unit, with each sub-macroblock partitions is an above block of pixels, and macro block information, sub-macro block information and block of pixels information are sent to motion macro block search module 62.
Motion macro block search module 62: receive macro block information, sub-macro block information and block of pixels information that macroblock partitions module 61 is sent, for current macro, selection portion molecule macro block in all sub-macro blocks of this macro block; For selected each sub-macro block, calculate each pixel block values in this sub-macro block and the difference of this pixel block values in the background model, with the difference addition of all block of pixels correspondences, obtain the motion ident value of this sub-macro block; With the motion ident value addition of selected all sub-macro blocks, obtain the motion ident value of current macro; If the motion ident value of current macro, determines then that current macro is the motion macro block greater than preset value, the boundary information of current macro is outputed to border update module 63; Otherwise, determine that current macro is a background macro block.
Border update module 63: the boundary information of the current macro of sending according to motion macro block search module 62, upgrade the border of current moving object.
As shown in Figure 7, in actual applications, macroblock partitions module 61 can comprise: first divides module 611 and second divides module 612, wherein:
First divides module 611: the area-of-interest to current frame image carries out macroblock partitions, is sub-macro block more than with each macroblock partitions, and macro block information and sub-macro block information are outputed to second division module 612 and the motion macro block search module 62.
Second divides module 612: receiving first and divide macro block information and the sub-macro block information that module 611 is sent, is unit with a preset number pixel, is an above block of pixels with each sub-macroblock partitions, and block of pixels information is outputed to motion macro block search module 62.
And motion macro block search module can 62 comprises: search module 621 and motion ident value computing module 622, wherein:
Search module 621: receive first and divide the macro block information that module 611 is sent, if current macro is first macro block of current moving object, then right piece and the following block message with current macro information and current macro sends to motion ident value computing module 622, if the motion ident value of the current macro that motion ident value computing module 622 returns, the right piece of current macro and following piece is all greater than preset value, determine that then current macro is the motion macro block, the boundary information of current macro is outputed to border update module 63; Otherwise, determine that current macro is a background macro block.
Motion ident value computing module 622: receive the first division module 611 and second and divide macro block information, sub-macro block information and the block of pixels information that module 612 is sent; Receive the macro block information that search module 621 is sent, according to default selective rule, selection portion molecule macro block the sub-macro block of the corresponding macro block of the macro block information of sending from search module 621, for selected each sub-macro block, calculate each pixel block values in this sub-macro block and the difference of this pixel block values in the background model, difference addition with all block of pixels correspondences, obtain the motion ident value of this sub-macro block, motion ident value addition with selected all sub-macro blocks, obtain the motion ident value of this macro block, the motion ident value of this macro block is returned to search module 621.
Perhaps,
First divides module 611, be used for area-of-interest with current frame image and be divided into 16 * 16 macro block, with each macroblock partitions is 4 16 * 4 sub-macro block, macro block information and sub-macro block information is outputed to second divide module 612 and motion macro block search module 62.
Second divides module 612, and be used to receive first and divide macro block information and the sub-macro block information that module 611 is sent, be unit with 4 pixels, every row of each sub-macro block is divided into 4 block of pixels, block of pixels information is outputed to motion macro block search module 62.
Perhaps,
Search module 621, be used to receive first and divide the macro block information that module 611 is sent, if current macro is first macro block of current moving object, then right piece and the following block message with current macro information and current macro sends to motion ident value computing module 622, if the current macro that motion ident value computing module 622 returns, the right piece of current macro and the motion ident value of following piece are all greater than preset value, determine that then current macro is the motion macro block, the boundary information of current macro is outputed to border update module 63, and with the current macro is the center, on current macro, down, a left side, right four direction is expanded a macro block length respectively, obtain a rectangle frame after the expansion, each macro block sign of expansion is sent to motion ident value computing module 622, if the motion ident value of the macro block that motion ident value computing module 622 returns is greater than preset value, determine that then this macro block is the motion macro block, the pairing directional information of this macro block is sent to border update module 63, simultaneously, a macro block length is expanded in current moving object on the direction of this macro block correspondence, obtain a rectangle frame after the expansion, the macro block sign of expanding is sent to motion ident value computing module 622; As if not searching any motion macro block on all directions of having expanded a macro block length in current moving object, then send current moving object border and determine indication to border update module 63.
And border update module 63 receives the directional information that search module 621 is sent, and then a macro block length is upwards expanded this directional information counterparty in the border of current moving object; Receive the definite indication in current moving object border that search module 621 is sent, determine that then the border of current moving object is the final border of current moving object.
In actual applications, motion ident value computing module 622 can comprise: sub-macro block is selected module and computing module, wherein:
Sub-macro block is selected module: receive the first division module 611 and second and divide macro block information, sub-macro block information and the block of pixels information that module 612 is sent; Receive the macro block information that search module 621 is sent, according to default selective rule, selection portion molecule macro block the sub-macro block of the macro block information correspondence macro block of sending from search module 621 sends to computing module with selected sub-macro block information.
Computing module: receive the selected sub-macro block information that sub-macro block selects module to send, calculate each pixel block values in this sub-macro block and the difference of this pixel block values in the background model, each row for this sub-macro block, difference addition with all block of pixels of these row, if gained and value, determine then that the motion ident value of these row is 1 greater than noise threshold; Otherwise the motion ident value of determining these row is 0; With the motion ident value addition of all row of this sub-macro block, obtain the motion ident value of this sub-macro block; With the motion ident value addition of selected all sub-macro blocks, obtain the motion ident value of current macro, the motion ident value of current macro is returned to search module 621.
In actual applications, border update module 63 also can be used for, when the border of current moving object is determined, with the boundary information output of current moving object.
And, motion detection apparatus shown in Figure 6 also can comprise: moving object rule match module, be used to receive the boundary information of the current moving object that border update module 63 sends, according to this boundary information and predetermined movement object rule, judge whether current moving object is the real motion object, if keep this moving object; Otherwise, delete this moving object.
In actual applications, moving object rule match module also can be used for, after definite current moving object is the real motion object, and the indication of output counting.
And, motion detection apparatus shown in Figure 6 also can comprise: counting module, be used for after receiving the counting indication that moving object rule match module is sent, the moving object count value of current frame image is added 1, judge whether count value arrives preset value, if with count value output, and 62 stop motions of notice motion macro block search module detect.
In actual applications, motion macro block search module 62 also can be used for, after definite current macro is background macro block, with current frame image sign and the output of this background macro block sign.
And, motion detection apparatus shown in Figure 6 also can comprise: the background model update module, be used to receive image identification and the background macro block sign that motion macro block search module 62 is sent, if find that this background macro block identifies the predetermined continuously frame number of corresponding macro block and is confirmed as background macro block, then according to this macro block in this macro block update background module of being somebody's turn to do in the continuously predetermined frame number image.
The above only is process of the present invention and method embodiment, in order to restriction the present invention, all any modifications of being made within the spirit and principles in the present invention, is not equal to replacement, improvement etc., all should be included within protection scope of the present invention.