CN101600110A - Method for testing motion and device - Google Patents

Method for testing motion and device Download PDF

Info

Publication number
CN101600110A
CN101600110A CN 200910088933 CN200910088933A CN101600110A CN 101600110 A CN101600110 A CN 101600110A CN 200910088933 CN200910088933 CN 200910088933 CN 200910088933 A CN200910088933 A CN 200910088933A CN 101600110 A CN101600110 A CN 101600110A
Authority
CN
China
Prior art keywords
macro block
macro
motion
current
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 200910088933
Other languages
Chinese (zh)
Other versions
CN101600110B (en
Inventor
黄攀
朱旭东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN 200910088933 priority Critical patent/CN101600110B/en
Publication of CN101600110A publication Critical patent/CN101600110A/en
Application granted granted Critical
Publication of CN101600110B publication Critical patent/CN101600110B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses method for testing motion and device.Method comprises: A. carries out macroblock partitions to the area-of-interest of current frame image, 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; Whether the motion ident value of C. judging current macro is 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 has reduced the complexity of motion detection, and has guaranteed the reliability of motion detection.

Description

Method for testing motion and device
Technical field
The present invention relates to technical field of video monitoring, be specifically related to method for testing motion and device.
Background technology
At present, the video monitoring technology is used more and more widely, and along with the continuous progress of image processing techniques and video relevant device, people are more and more higher to the intelligent requirements of watch-dog, not only has been satisfied with common passive type monitoring.For specific monitoring place,, need to detect the moving target in the scene usually such as bank, parking lot, unit gateway, safety check department etc.
Usually utilize the Gaussian function density estimation method that the original image that collects is carried out modeling,, come differentiation prospect and background by calculating its matching degree with model to each pixel or the macro block of every two field picture of transmission, and then detection moving object.
Said method can produce following problem:
Algorithm complexity, amount of calculation are big, the disposal ability of terminal are required high, and under existing hardware technology condition, the equipment cost height is difficult for promoting; Simultaneously, because calculation of complex, the post-processed of every two field picture will take a lot of times, especially under the situation that HD video encoding and decoding performance is had too many difficulties to cope with at present, can cause the delay of image, and to the performance requirement height of codec, technology realizes that difficulty is big.
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.
Description of drawings
Fig. 1 is a method for testing motion flow chart provided by the invention;
The method for testing motion flow chart that Fig. 2 provides for the embodiment of the invention;
The division exemplary plot that Fig. 3 provides for the embodiment of the invention to one 16 * 16 macro block of area-of-interest;
The exemplary plot of the motion ident value of the sub-macro block that the calculating that Fig. 4 provides for the embodiment of the invention is the 1st 16 * 4;
The exemplary plot one of searching moving macro block in area-of-interest that Fig. 5-1 provides for the embodiment of the invention;
The exemplary plot two of searching moving macro block in area-of-interest that Fig. 5-2 provides for the embodiment of the invention;
The exemplary plot three of searching moving macro block in area-of-interest that Fig. 5-3 provides for the embodiment of the invention;
The composition diagram of the motion detection apparatus that Fig. 6 provides for the embodiment of the invention;
The macroblock partitions module that Fig. 7 provides for the embodiment of the invention and the composition diagram of motion macro block search module.
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.

Claims (14)

1, a kind of method for testing motion is characterized in that, 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.
2, the method for claim 1 is characterized in that, 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.
3, the method for claim 1 is characterized in that, 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.
4, as the arbitrary described method of claim 1 to 3, it is characterized in that,
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.
5, method as claimed in claim 3 is characterized in that, 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.
6, method as claimed in claim 5 is characterized in that, 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.
7, the method for claim 1 is characterized in that, 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.
8, a kind of motion detection apparatus is characterized in that, 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.
9, device as claimed in claim 8 is characterized in that, 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.
10, device as claimed in claim 8 is characterized in that, 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.
As claim 9 or 10 described devices, it is characterized in that 11, 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.
12, device as claimed in claim 8 is characterized in that, 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.
13, device as claimed in claim 12 is characterized in that, 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.
14, device as claimed in claim 8 is characterized in that, 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.
CN 200910088933 2009-07-14 2009-07-14 Method and device for detecting motion Active CN101600110B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200910088933 CN101600110B (en) 2009-07-14 2009-07-14 Method and device for detecting motion

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200910088933 CN101600110B (en) 2009-07-14 2009-07-14 Method and device for detecting motion

Publications (2)

Publication Number Publication Date
CN101600110A true CN101600110A (en) 2009-12-09
CN101600110B CN101600110B (en) 2011-06-08

Family

ID=41421316

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200910088933 Active CN101600110B (en) 2009-07-14 2009-07-14 Method and device for detecting motion

Country Status (1)

Country Link
CN (1) CN101600110B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103501428A (en) * 2013-10-22 2014-01-08 北京博威康技术有限公司 Multimedia monitoring method and multimedia monitoring device
CN103516955A (en) * 2012-06-26 2014-01-15 郑州大学 Invasion detecting method in video monitoring
CN111800634A (en) * 2020-06-30 2020-10-20 西安万像电子科技有限公司 Image processing method and device
CN113727176A (en) * 2021-08-30 2021-11-30 杭州国芯科技股份有限公司 Video motion subtitle detection method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103516955A (en) * 2012-06-26 2014-01-15 郑州大学 Invasion detecting method in video monitoring
CN103516955B (en) * 2012-06-26 2016-12-21 郑州大学 Intrusion detection method in video monitoring
CN103501428A (en) * 2013-10-22 2014-01-08 北京博威康技术有限公司 Multimedia monitoring method and multimedia monitoring device
CN111800634A (en) * 2020-06-30 2020-10-20 西安万像电子科技有限公司 Image processing method and device
CN113727176A (en) * 2021-08-30 2021-11-30 杭州国芯科技股份有限公司 Video motion subtitle detection method
CN113727176B (en) * 2021-08-30 2023-05-16 杭州国芯科技股份有限公司 Video motion subtitle detection method

Also Published As

Publication number Publication date
CN101600110B (en) 2011-06-08

Similar Documents

Publication Publication Date Title
CN102378992B (en) Articulated region detection device and method for same
CN102073851B (en) Method and system for automatically identifying urban traffic accident
KR20200018612A (en) Method, apparatus and apparatus for object detection
CN101026761B (en) Motion estimation method of rapid variable-size-block matching with minimal error
US20130343604A1 (en) Video processing apparatus and video processing method
JP2007503757A (en) Mode decision for intermediate prediction in video coding
CN101600110B (en) Method and device for detecting motion
CN104123776B (en) A kind of object statistical method based on image and system
CN111428607A (en) Tracking method and device and computer equipment
CN104063885A (en) Improved movement target detecting and tracking method
CN112465855B (en) Passenger flow statistical method, device, storage medium and equipment
CN107483953B (en) Inter frame motion estimation method, apparatus and electronic equipment
CN102263955A (en) Method for detecting video occlusion based on motion vectors
CN102426785A (en) Traffic flow information perception method based on contour and local characteristic point and system thereof
CN111524086B (en) Moving object detection device, moving object detection method, and storage medium
JP2003324743A (en) Motion vector searching apparatus and motion vector searching method
CN103810718A (en) Method and device for detection of violently moving target
CN101505426A (en) Motion detection method and apparatus for compression domain
CN107590431A (en) A kind of quantity statistics method and device based on image recognition
CN101877135B (en) Moving target detecting method based on background reconstruction
CN100385957C (en) Kinematic vector predicting method
Laumer et al. Moving object detection in the H. 264/AVC compressed domain
CN101511019A (en) Method and apparatus for estimating variable mode motion
CN105898343A (en) Video live broadcasting method and device and terminal video live broadcasting method and device
JP2001145109A (en) Moving vector detecting device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: ZHEJIANG UNIVIEW TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: HUASAN COMMUNICATION TECHNOLOGY CO., LTD.

Effective date: 20120220

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20120220

Address after: Hangzhou City, Zhejiang province 310053 Binjiang District Dongxin Road No. 66 building two or three layer A C

Patentee after: Zhejiang Uniview Technology Co., Ltd.

Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base

Patentee before: Huasan Communication Technology Co., Ltd.