CN101533511B - Background image updating method and device thereof - Google Patents

Background image updating method and device thereof Download PDF

Info

Publication number
CN101533511B
CN101533511B CN200910082339XA CN200910082339A CN101533511B CN 101533511 B CN101533511 B CN 101533511B CN 200910082339X A CN200910082339X A CN 200910082339XA CN 200910082339 A CN200910082339 A CN 200910082339A CN 101533511 B CN101533511 B CN 101533511B
Authority
CN
China
Prior art keywords
pixel
pixel value
value
difference
current
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.)
Expired - Fee Related
Application number
CN200910082339XA
Other languages
Chinese (zh)
Other versions
CN101533511A (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.)
Tsinghua University
Original Assignee
Tsinghua University
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 Tsinghua University filed Critical Tsinghua University
Priority to CN200910082339XA priority Critical patent/CN101533511B/en
Publication of CN101533511A publication Critical patent/CN101533511A/en
Application granted granted Critical
Publication of CN101533511B publication Critical patent/CN101533511B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a background image updating method and a device thereof, belonging to the field of image processing. The method comprises: selecting at least one pixel from the current fram and taking each pixel thereof as the current pixel to calculate the first difference value and judge whether the absolute value thereof is smaller than the outer margin of the background threshold value or not; if yes, calculating the first candidate pixel value and adding 1 to the number of times COUNT_A, and if not, subtracting the third pixel value from the first pixel value to obtain the second difference value; judging whether the absolute value of the second difference value is smaller than the outer margin of the foreground threshold value or not; if yes, calculating the second candidate pixel value and adding 1 to the number of times COUNT_B;if not, calculating the third candidate pixel value and adding 1 to the number of times COUNT_C; comparing COUNT_A, COUNT_B and COUNT_C and using the candidate pixel value corresponding to the maximum number of times as the updating pixel value of the corresponding pixel of the background. The device comprises: a first difference value module, a judging module, a first weighted average module, a second difference value module and an updating modle. The invention can fast update the background image with high quality.

Description

The method and apparatus of background image updating
Technical field
The present invention relates to image processing field, particularly the method and apparatus of background image updating.
Background technology
Along with the develop rapidly of computer technology and semiconductor technology, make a video recording first-class video acquisition and treatment technology are widely used in every field just gradually, for people's work and life facilitate.
In these applications, generally adopt the background subtraction subtraction to extract our interested target to the processing of video.The principle of this method is: generation background image at first, and utilize image and background image in the video to subtract each other again, just can obtain the foreground target in the image, thereby realize the function that we are required.In actual applications, background is along with the variation of external environment changes, so background image needs passing in time and dynamically update, and this has just related to the generation and the update method of background image.The generation quality of background image and speed all affect the performance of real application systems.Poor excessively as if the quality that background image generates, then after subtracting computing, can there be much noise on the image poor subtracting with current input image work difference, influence is to the extraction of foreground target; If the background image formation speed is slow excessively, then can't reach the requirement of application system real-time.
In the prior art, common background image generates and update method has: gray average method, image sequence minusing etc.Though the gray average method is simple, when the generation background image, need a large amount of image sequences, and it is bigger disturbed by prospect, poor-performing when scene is complicated.The image sequence minusing will be chosen appropriate threshold when using, therefore change the needs that also can't satisfy practical application when violent in scene.
Summary of the invention
The embodiment of the invention provides the method and apparatus of background image updating.Described technical scheme is as follows:
A kind of method of background image updating comprises: choose at least one pixel in current frame image, each pixel in described at least one pixel respectively as current pixel, is carried out following processing:
Second pixel value of the respective pixel of first pixel value of described current pixel and current background image is subtracted each other, obtain first difference;
Whether the absolute value of judging described first difference is less than the outer boundary of the background threshold of described current pixel;
If the absolute value of described first difference is less than the outer boundary of described background threshold, described first pixel value and described second pixel value are weighted average computation, obtain the first candidate pixel value, and the number of times COUNT_A that described first pixel value and described second pixel value are weighted average computation is increased 1;
If the absolute value of described first difference is not less than the outer boundary of described background threshold, the 3rd pixel value of the respective pixel of described first pixel value and current foreground image is subtracted each other, obtain second difference; And whether the absolute value of judging described second difference is less than the outer boundary of the prospect threshold value of described current pixel;
If the absolute value of described second difference is less than the outer boundary of the prospect threshold value of described current pixel, described first pixel value and described the 3rd pixel value are weighted average computation, obtain the second candidate pixel value, and the number of times COUNT_B that described first pixel value and described the 3rd pixel value are weighted average computation is increased 1;
Otherwise, the 4th pixel value of the respective pixel of described first pixel value and current absorption image is weighted average computation, obtain the 3rd candidate pixel value, and the number of times COUNT_C that described first pixel value and described the 4th pixel value are weighted average computation is increased 1;
The size of number of comparisons COUNT_A, COUNT_B and COUNT_C is with the candidate pixel value of the number of times the maximum correspondence renewal pixel value as the respective pixel of described background image.
A kind of device of background image updating comprises:
First difference block, be used for choosing at least one pixel at current frame image, each pixel in described at least one pixel respectively as current pixel, is subtracted each other second pixel value of the respective pixel of first pixel value of described current pixel and current background image, obtain first difference;
Whether judge module, the absolute value that is used to judge described first difference be less than the outer boundary of the background threshold of described current pixel;
The first weighted mean module, if be used for the outer boundary of the absolute value of described first difference less than described background threshold, described first pixel value and described second pixel value are weighted average computation, obtain the first candidate pixel value, and the number of times COUNT_A that described first pixel value and described second pixel value are weighted average computation is increased 1;
Second difference block if be used for the outer boundary that the absolute value of described first difference is not less than described background threshold, subtracts each other the 3rd pixel value of the respective pixel of described first pixel value and current foreground image, obtains second difference; And whether the absolute value of judging described second difference is less than the outer boundary of the prospect threshold value of described current pixel; If the absolute value of described second difference is less than the outer boundary of the prospect threshold value of described current pixel, described first pixel value and described the 3rd pixel value are weighted average computation, obtain the second candidate pixel value, and the number of times COUNT_B that described first pixel value and described the 3rd pixel value are weighted average computation is increased 1; Otherwise, the 4th pixel value of the respective pixel of described first pixel value and current absorption image is weighted average computation, obtain the 3rd candidate pixel value, and the number of times COUNT_C that described first pixel value and described the 4th pixel value are weighted average computation is increased 1;
Update module is used for the size of number of comparisons COUNT_A, COUNT_B and COUNT_C, with the candidate pixel value of the number of times the maximum correspondence renewal pixel value as the respective pixel of described background image.
The beneficial effect of the technical scheme that the embodiment of the invention provides is:
By first pixel value and second pixel value are weighted average computation, first pixel value and the 3rd pixel value are weighted average computation, perhaps first pixel value and the 4th pixel value are weighted average computation, can realize carrying out fast high-quality background image and upgrade.
Description of drawings
Fig. 1 is the method flow diagram of the background image updating that provides of the embodiment of the invention one;
Fig. 2 is the process flow diagram of applying the present invention to of providing of the embodiment of the invention one when having the video sequence of multiple image;
Fig. 3 is the method flow diagram of the background image updating that provides of the embodiment of the invention two;
Fig. 4 is the device block diagram of the background image updating that provides of the embodiment of the invention three.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Embodiment one
The embodiment of the invention provides a kind of method of background image updating, as shown in Figure 1, comprising: choose at least one pixel in current frame image, each pixel in described at least one pixel respectively as current pixel, is carried out following processing:
110: second pixel value of the respective pixel of first pixel value of current pixel and current background image is subtracted each other, obtain first difference;
120: whether the absolute value of judging first difference is less than the outer boundary of the background threshold of current pixel;
130: if the absolute value of first difference is less than the outer boundary of above-mentioned background threshold value, first pixel value and second pixel value are weighted average computation, obtain the first candidate pixel value, and the number of times COUNT_A that first pixel value and second pixel value are weighted average computation is increased 1;
If the absolute value of first difference is not less than the outer boundary of above-mentioned background threshold value, the 3rd pixel value of the respective pixel of first pixel value and current foreground image is subtracted each other, obtain second difference; And whether the absolute value of judging second difference is less than the outer boundary of the prospect threshold value of current pixel;
If the absolute value of second difference is less than the outer boundary of the prospect threshold value of current pixel, first pixel value and the 3rd pixel value are weighted average computation, obtain the second candidate pixel value, and the number of times COUNT_B that first pixel value and the 3rd pixel value are weighted average computation is increased 1;
Otherwise, the 4th pixel value of the respective pixel of first pixel value and current absorption image is weighted average computation, obtain the 3rd candidate pixel value, and the number of times COUNT_C that first pixel value and the 4th pixel value are weighted average computation is increased 1;
140: the size of number of comparisons COUNT_A, COUNT_B and COUNT_C, with the candidate pixel value of number of times the maximum correspondence renewal pixel value as the respective pixel of above-mentioned background image.
The embodiment of the invention can be applied to have the video sequence of multiple image.Referring to Fig. 2, before the first background image updating of this video sequence, carry out initialized step, be about to this video sequence last frame image arbitrary two field picture before and be set to the initial background image, foreground image and absorption image setting are empty and initialization background threshold and prospect threshold value.Next with the arbitrary two field picture after the above-mentioned initial background image as current frame image, execution in step 110 to 140 is upgraded the current background image of this video sequence.If also there is subsequent frame in present frame, successively with each two field picture after the above-mentioned current frame image as new current frame image execution in step 110 to 140, upgrade the background image of this video sequence, to realize that background image is carried out continuous updating.Present embodiment also can extract some two field pictures in all two field pictures after the above-mentioned initial background image, each two field picture in successively will these some two field pictures upgrades the background image of this video sequence as current frame image.
The method of the embodiment of the invention is by being weighted average computation, first pixel value and the 3rd pixel value are weighted average computation first pixel value and second pixel value, perhaps first pixel value and the 4th pixel value are weighted average computation, can realize carrying out fast high-quality background image and upgrade.
Embodiment two
Present embodiment further specifies the method for background image updating of the present invention on the basis of embodiment one.Referring to Fig. 3, the method for the embodiment of the invention comprises:
301: the arbitrary two field picture before the current frame image is set to the initial background image, and foreground image and absorption image setting are empty and initialization background threshold and prospect threshold value.
The embodiment of the invention can be applied to have the video sequence of multiple image.Before the first background image updating of this video sequence, the arbitrary two field picture before this video sequence last frame image is set to the initial background image, and foreground image and absorption image setting are empty and initialization background threshold and prospect threshold value.Successively each two field picture after the above-mentioned initial background image is upgraded the background image of this video sequence then as current frame image.Present embodiment also can extract some two field pictures in all two field pictures after the above-mentioned initial background image, each two field picture in successively will these some two field pictures upgrades the background image of this video sequence as current frame image.The number of pixels that absorbs image, current frame image, background image and foreground image is identical.In the embodiment of the invention, two width of cloth images are done additive operation, and the pixel value that refers to the respective pixel in two width of cloth images subtracts each other respectively.If above-mentioned image has at least two passages, then the respective pixel in two width of cloth images is carried out additive operation respectively in respective channel.Such as current frame image and background image is the common color image, all has three passages of RGB.With red passage is example, when current frame image subtracting background image on red passage, each pixel of current frame image respectively as current pixel, is carried out: with the pixel value of respective pixel on red passage of current pixel in the pixel value subtracting background image of current pixel on red passage.Wherein, the respective pixel of current pixel in background image refers to the pixel at current pixel same position place in background image.When initialization background threshold and prospect threshold value, the initial value of the two all can be made as 10 (gray-scale value) in the embodiment of the invention.
302: in current frame image, choose at least one pixel, with each pixel in described at least one pixel respectively as current pixel, second pixel value of the respective pixel of first pixel value of current pixel and current background image is subtracted each other, obtain first difference.
303: whether the absolute value of judging first difference is less than the outer boundary of the background threshold of current pixel.
In the embodiment of the invention, inner and outer boundary is set in the both sides of background threshold or prospect threshold value.Such as, be 10 to be example with the background threshold of current pixel, with the absolute value of the difference of this background threshold can be 5, promptly interior boundary can be 5, outer boundary can be 15.Can set the width of inner and outer boundary according to the dynamic change scope of current frame image.When the dynamic change scope was big, inner and outer boundary was answered broad; The dynamic change scope hour, inner and outer boundary should be narrower.With the prospect threshold value of current pixel is 10 to be example, and when the dynamic change scope was big, the absolute value of the difference of inner and outer boundary and this background threshold can be 6, and promptly interior boundary can be 4, and outer boundary can be 16; The dynamic change scope hour, the absolute value of the difference of inner and outer boundary and this background threshold can be 4, promptly interior boundary can be 6, outer boundary can be 14.At synchronization, the background threshold of different pixels can be different, and the prospect threshold value of different pixels also can be different.
304: if the absolute value of first difference is less than the outer boundary of the background threshold of current pixel, first pixel value and second pixel value are weighted average computation, obtain the first candidate pixel value, and the number of times COUNT_A that first pixel value and second pixel value are weighted average computation is increased 1.Otherwise execution in step 306.
If the absolute value of first difference falls between background threshold and its outer boundary, though the absolute value of first difference greater than background threshold owing to less than the outer boundary of background threshold, still first pixel value and second pixel value are weighted average computation, calculating formula is:
Figure G200910082339XD00051
COUNT_A can have two kinds to increase 1 mode in the present embodiment.If when being arranged on first background image updating, COUNT_A is 1, can after first pixel value and second pixel value are weighted average computation, COUNT_A be increased 1 so; If when being arranged on first background image updating, COUNT_A is 0, so can be behind the outer boundary of the absolute value of judging first difference less than background threshold, first pixel value and second pixel value are weighted before the average computation, COUNT_A is increased 1.
305: the background threshold of upgrading current pixel.
If the absolute value of first difference thinks that less than the outer boundary of the background threshold of current pixel and greater than the background threshold of current pixel the background threshold of current pixel is less than normal, the background threshold of current pixel is increased a step-length;
If the absolute value of first difference, thinks that the background threshold of current pixel is bigger than normal less than the inner boundary of the background threshold of current pixel, the background threshold of current pixel is reduced a step-length;
If the absolute value of first difference equals the background threshold of current pixel, do not upgrade.
Step-length when background threshold is upgraded in the present embodiment can be 1.
306: if the absolute value of first difference is not less than the outer boundary of background threshold, the 3rd pixel value of the respective pixel of first pixel value and current foreground image is subtracted each other, obtain second difference.
307: whether the absolute value of judging second difference is less than the outer boundary of the prospect threshold value of current pixel.
308: if the absolute value of second difference is less than the outer boundary of the prospect threshold value of current pixel, first pixel value and the 3rd pixel value are weighted average computation, obtain the second candidate pixel value, and the number of times COUNT_B that first pixel value and the 3rd pixel value are weighted average computation is increased 1.Otherwise, execution in step 310.
The calculating formula that first pixel value and the 3rd pixel value is weighted average computation is:
Figure G200910082339XD00061
COUNT_B can have two kinds to increase 1 mode in the present embodiment.If when being arranged on first background image updating, COUNT_B is 1, can after first pixel value and the 3rd pixel value are weighted average computation, COUNT_B be increased 1 so; If when being arranged on first background image updating, COUNT_B is 0, so can be behind the outer boundary of the absolute value of judging second difference less than the prospect threshold value of current pixel, first pixel value and the 3rd pixel value are weighted before the average computation, COUNT_B is increased 1.
309: the prospect threshold value of upgrading current pixel.
If the absolute value of second difference is less than the outer boundary of the prospect threshold value of current pixel and greater than the prospect threshold value of current pixel, the prospect threshold value of current pixel is increased a step-length;
If the absolute value of second difference is less than the inner boundary of the prospect threshold value of current pixel, the prospect threshold value of current pixel is reduced a step-length;
If the absolute value of second difference equals the prospect threshold value of current pixel, do not upgrade.
Step-length when the prospect threshold value is upgraded in the present embodiment can be 1.
310: the 4th pixel value of the respective pixel of first pixel value and current absorption image is weighted average computation, obtains the 3rd candidate pixel value, and the number of times COUNT_C that first pixel value and the 4th pixel value are weighted average computation is increased 1.
The calculating formula that the 4th pixel value of the respective pixel of first pixel value and current absorption image is weighted average computation is:
Figure G200910082339XD00071
COUNT_C can have two kinds to increase 1 mode in the present embodiment.If when being arranged on first background image updating, COUNT_C is 1, can after first pixel value and the 4th pixel value are weighted average computation, COUNT_C be increased 1 so; If when being arranged on first background image updating, COUNT_C is 0, so can be after the absolute value of judging second difference be not less than the outer boundary of prospect threshold value of current pixel, first pixel value and the 4th pixel value are weighted before the average computation, COUNT_C is increased 1.
311: the size of number of comparisons COUNT_A, COUNT_B and COUNT_C, with the candidate pixel value of the number of times the maximum correspondence renewal pixel value of the respective pixel of image as a setting.
When handling the current pixel of present frame, judge whether present frame exists next pixel in the embodiment of the invention,, continue next pixel execution in step 303 to 311, the pixel value of the respective pixel of background image updating if there is next pixel.
Further, step 311 after the renewal pixel value of the respective pixel of image is also comprising the candidate pixel value of number of times the maximum correspondence as a setting:
With the candidate pixel value of the second largest person's correspondence of number of times renewal pixel value as the respective pixel of above-mentioned foreground image;
The number of times reckling is if COUNT_C, then with the 3rd candidate pixel value of the COUNT_C correspondence renewal pixel value as the respective pixel of above-mentioned absorption image; Otherwise with the candidate pixel value zero setting of number of times reckling correspondence renewal pixel value as the respective pixel of above-mentioned absorption image.
When the renewal of the background image of all pixels of handling present frame, continue the next frame image is handled, in the embodiment of the invention to realize that background image is carried out continuous updating.
The embodiment of the invention is by being provided with background threshold and inner and outer boundary thereof, prospect threshold value and inner and outer boundary thereof, first pixel value and second pixel value are weighted average computation, first pixel value and the 3rd pixel value are weighted average computation, perhaps first pixel value and the 4th pixel value are weighted average computation, can pursue pixel renewal frame by frame to fast and high quality background image.
Embodiment three
The embodiment of the invention provides a kind of device of background image updating, as shown in Figure 4, comprising:
Initialization module 401, be used for before current frame image is chosen at least one pixel, arbitrary two field picture before current frame image or the described current frame image is set to the initial background image, and foreground image and absorption image setting are empty and initialization background threshold and prospect threshold value.
The embodiment of the invention can be applied to have the video sequence of multiple image.Before the first background image updating of this video sequence, the arbitrary two field picture before this video sequence last frame image is set to the initial background image, and foreground image and absorption image setting are empty and initialization background threshold and prospect threshold value.Successively each two field picture after the above-mentioned initial background image is upgraded the background image of this video sequence then as current frame image.Present embodiment also can extract some two field pictures in all two field pictures after the above-mentioned initial background image, each two field picture in successively will these some two field pictures upgrades the background image of this video sequence as current frame image.The number of pixels that absorbs image, current frame image, background image and foreground image is identical.In the embodiment of the invention, two width of cloth images are done additive operation, and the pixel value that refers to the respective pixel in two width of cloth images subtracts each other respectively.If above-mentioned image has at least two passages, then the respective pixel in two width of cloth images is carried out additive operation respectively in respective channel.Such as current frame image and background image is the common color image, all has three passages of RGB.With red passage is example, when current frame image subtracting background image on red passage, each pixel of current frame image respectively as current pixel, is carried out: with the pixel value of respective pixel on red passage of current pixel in the pixel value subtracting background image of current pixel on red passage.Wherein, the respective pixel of current pixel in background image refers to the pixel at current pixel same position place in background image.When initialization background threshold and prospect threshold value, the initial value of the two all can be made as 10 (gray-scale value) in the embodiment of the invention.
First difference block 402, be used for choosing at least one pixel at current frame image, each pixel in described at least one pixel respectively as current pixel, is subtracted each other second pixel value of the respective pixel of first pixel value of current pixel and current background image, obtain first difference.
Whether judge module 403, the absolute value that is used to judge first difference be less than the outer boundary of the background threshold of current pixel.
In the embodiment of the invention, inner and outer boundary is set in the both sides of background threshold or prospect threshold value.Such as, be 10 to be example with the background threshold of current pixel, with the absolute value of the difference of this background threshold can be 5, promptly interior boundary can be 5, outer boundary can be 15.Can set the width of inner and outer boundary according to the dynamic change scope of current frame image.When the dynamic change scope was big, inner and outer boundary was answered broad; The dynamic change scope hour, inner and outer boundary should be narrower.With the prospect threshold value of current pixel is 10 to be example, and when the dynamic change scope was big, the absolute value of the difference of inner and outer boundary and this background threshold can be 6, and promptly interior boundary can be 4, and outer boundary can be 16; The dynamic change scope hour, the absolute value of the difference of inner and outer boundary and this background threshold can be 4, promptly interior boundary can be 6, outer boundary can be 14.At synchronization, the background threshold of different pixels can be different, and the prospect threshold value of different pixels also can be different.
The first weighted mean module 404, if be used for the outer boundary of the absolute value of first difference less than the above-mentioned background threshold value, first pixel value and second pixel value are weighted average computation, obtain the first candidate pixel value, and the number of times COUNT_A that first pixel value and second pixel value are weighted average computation is increased 1.
The calculating formula that first pixel value and second pixel value is weighted average computation is:
Figure G200910082339XD00081
Second difference block 405 if be used for the outer boundary that the absolute value of first difference is not less than the above-mentioned background threshold value, subtracts each other the 3rd pixel value of the respective pixel of first pixel value and current foreground image, obtains second difference; And whether the absolute value of judging second difference is less than the outer boundary of the prospect threshold value of current pixel; If the absolute value of second difference is less than the outer boundary of the prospect threshold value of current pixel, first pixel value and the 3rd pixel value are weighted average computation, obtain the second candidate pixel value, and the number of times COUNT_B that first pixel value and the 3rd pixel value are weighted average computation is increased 1; Otherwise, the 4th pixel value of the respective pixel of first pixel value and current absorption image is weighted average computation, obtain the 3rd candidate pixel value, and the number of times COUNT_C that first pixel value and the 4th pixel value are weighted average computation is increased 1; Wherein, current absorption image refers to the image that obtains behind current frame image subtracting background image and the foreground image.
The calculating formula that first pixel value and the 3rd pixel value is weighted average computation is:
Figure G200910082339XD00091
The calculating formula that the 4th pixel value of the respective pixel of first pixel value and current absorption image is weighted average computation is:
Figure G200910082339XD00092
Update module 406 is used for the size of number of comparisons COUNT_A, COUNT_B and COUNT_C, with the candidate pixel value of the number of times the maximum correspondence renewal pixel value of the respective pixel of image as a setting.
Further, update module 306 also is used for, with the candidate pixel value of number of times the maximum correspondence as a setting after the renewal pixel value of the respective pixel of image, with the candidate pixel value of the second largest person's correspondence of number of times renewal pixel value as the respective pixel of above-mentioned foreground image; The number of times reckling is if COUNT_C, then with the 3rd candidate pixel value of the COUNT_C correspondence renewal pixel value as the respective pixel of above-mentioned absorption image; Otherwise with the candidate pixel value zero setting of number of times reckling correspondence renewal pixel value as the respective pixel of above-mentioned absorption image.
The device of the embodiment of the invention continues the next frame image is handled when the renewal of the background image of all pixels of handling present frame, to realize that background image is carried out continuous updating.
The embodiment of the invention is by being provided with background threshold and inner and outer boundary thereof, prospect threshold value and inner and outer boundary thereof, first pixel value and second pixel value are weighted average computation, first pixel value and the 3rd pixel value are weighted average computation, perhaps first pixel value and the 4th pixel value are weighted average computation, can pursue pixel renewal frame by frame to fast and high quality background image.
The embodiment of the invention can utilize software to realize that corresponding software programs can be stored in the storage medium that can read, for example, and in the hard disk of computing machine, buffer memory or the CD.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (12)

1. the method for a background image updating is characterized in that, comprising: choose at least one pixel in current frame image, each pixel in described at least one pixel respectively as current pixel, is carried out following processing:
Second pixel value of the respective pixel of first pixel value of described current pixel and current background image is subtracted each other, obtain first difference;
Whether the absolute value of judging described first difference is less than the outer boundary of the background threshold of described current pixel;
If the absolute value of described first difference is less than the outer boundary of described background threshold, described first pixel value and described second pixel value are weighted average computation, obtain the first candidate pixel value, and the number of times COUNT_A that described first pixel value and described second pixel value are weighted average computation is increased 1;
If the absolute value of described first difference is not less than the outer boundary of described background threshold, the 3rd pixel value of the respective pixel of described first pixel value and current foreground image is subtracted each other, obtain second difference; And whether the absolute value of judging described second difference is less than the outer boundary of the prospect threshold value of described current pixel;
If the absolute value of described second difference is less than the outer boundary of the prospect threshold value of described current pixel, described first pixel value and described the 3rd pixel value are weighted average computation, obtain the second candidate pixel value, and the number of times COUNT_B that described first pixel value and described the 3rd pixel value are weighted average computation is increased 1;
Otherwise, if the absolute value of described second difference is more than or equal to the outer boundary of the prospect threshold value of described current pixel, the 4th pixel value of the respective pixel of described first pixel value and current absorption image is weighted average computation, obtain the 3rd candidate pixel value, and described first pixel value and described the 4th pixel value are weighted the number of times of average computation
COUNT_C increases 1;
The size of number of comparisons COUNT_A, COUNT_B and COUNT_C is with the candidate pixel value of the number of times the maximum correspondence renewal pixel value as the respective pixel of described background image.
2. the method for background image updating as claimed in claim 1 is characterized in that, the described calculating formula that described first pixel value and described second pixel value are weighted average computation is:
Figure FSB00000255317100011
3. the method for background image updating as claimed in claim 1 is characterized in that, the described calculating formula that described first pixel value and described the 3rd pixel value are weighted average computation is:
Figure FSB00000255317100021
4. the method for background image updating as claimed in claim 1 is characterized in that, the calculating formula that the 4th pixel value of described respective pixel with described first pixel value and current absorption image is weighted average computation is:
Figure FSB00000255317100022
5. the method for background image updating as claimed in claim 1 is characterized in that, describedly also comprises choose at least one pixel in current frame image before:
Arbitrary two field picture before the described current frame image is set to the initial background image, and foreground image and absorption image setting are empty and initialization background threshold and prospect threshold value.
6. the method for background image updating as claimed in claim 1 is characterized in that, after the described renewal pixel value of candidate pixel value as the respective pixel of described background image with number of times the maximum correspondence, also comprises:
With the candidate pixel value of the second largest person's correspondence of number of times renewal pixel value as the respective pixel of described foreground image;
The number of times reckling is if COUNT_C, then with the 3rd candidate pixel value of the COUNT_C correspondence renewal pixel value as the respective pixel of described absorption image; Otherwise with the candidate pixel value zero setting of described number of times reckling correspondence renewal pixel value as the respective pixel of described absorption image.
7. the method for background image updating as claimed in claim 1 is characterized in that, described obtaining also comprises after the first candidate pixel value: upgrade described background threshold.
8. the method for background image updating as claimed in claim 1 is characterized in that, described obtaining also comprises after the second candidate pixel value: upgrade described prospect threshold value.
9. the method for background image updating as claimed in claim 7 is characterized in that, the described background threshold of described renewal comprises:
If the absolute value of described first difference less than the outer boundary of described background threshold and greater than described background threshold, increases a step-length with described background threshold;
If the absolute value of described first difference less than the inner boundary of described background threshold, reduces a step-length with described background threshold;
If the absolute value of described first difference equals described background threshold, do not upgrade.
10. the method for background image updating as claimed in claim 8 is characterized in that, the described prospect threshold value of described renewal comprises:
If the absolute value of described second difference less than the outer boundary of described prospect threshold value and greater than described prospect threshold value, increases a step-length with described prospect threshold value;
If the absolute value of described second difference less than the inner boundary of described prospect threshold value, reduces a step-length with described prospect threshold value;
If the absolute value of described second difference equals described prospect threshold value, do not upgrade.
11. the device of a background image updating is characterized in that, comprising:
First difference block, be used for choosing at least one pixel at current frame image, each pixel in described at least one pixel respectively as current pixel, is subtracted each other second pixel value of the respective pixel of first pixel value of described current pixel and current background image, obtain first difference;
Whether judge module, the absolute value that is used to judge described first difference be less than the outer boundary of the background threshold of described current pixel;
The first weighted mean module, if be used for the outer boundary of the absolute value of described first difference less than described background threshold, described first pixel value and described second pixel value are weighted average computation, obtain the first candidate pixel value, and the number of times COUNT_A that described first pixel value and described second pixel value are weighted average computation is increased 1;
Second difference block if be used for the outer boundary that the absolute value of described first difference is not less than described background threshold, subtracts each other the 3rd pixel value of the respective pixel of described first pixel value and current foreground image, obtains second difference; And whether the absolute value of judging described second difference is less than the outer boundary of the prospect threshold value of described current pixel; If the absolute value of described second difference is less than the outer boundary of the prospect threshold value of described current pixel, described first pixel value and described the 3rd pixel value are weighted average computation, obtain the second candidate pixel value, and the number of times COUNT_B that described first pixel value and described the 3rd pixel value are weighted average computation is increased 1; Otherwise, if the absolute value of described second difference is more than or equal to the outer boundary of the prospect threshold value of described current pixel, the 4th pixel value of the respective pixel of described first pixel value and current absorption image is weighted average computation, obtain the 3rd candidate pixel value, and the number of times COUNT_C that described first pixel value and described the 4th pixel value are weighted average computation is increased 1;
Update module is used for the size of number of comparisons COUNT_A, COUNT_B and COUNT_C, with the candidate pixel value of the number of times the maximum correspondence renewal pixel value as the respective pixel of described background image.
12. the device of background image updating as claimed in claim 11 is characterized in that, also comprises:
Initialization module, be used for before current frame image is chosen at least one pixel, arbitrary two field picture before current frame image or the described current frame image is set to the initial background image, and foreground image and absorption image setting are empty and initialization background threshold and prospect threshold value.
CN200910082339XA 2009-04-14 2009-04-14 Background image updating method and device thereof Expired - Fee Related CN101533511B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910082339XA CN101533511B (en) 2009-04-14 2009-04-14 Background image updating method and device thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910082339XA CN101533511B (en) 2009-04-14 2009-04-14 Background image updating method and device thereof

Publications (2)

Publication Number Publication Date
CN101533511A CN101533511A (en) 2009-09-16
CN101533511B true CN101533511B (en) 2011-02-16

Family

ID=41104090

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910082339XA Expired - Fee Related CN101533511B (en) 2009-04-14 2009-04-14 Background image updating method and device thereof

Country Status (1)

Country Link
CN (1) CN101533511B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102646280B (en) * 2012-04-06 2014-12-03 长安大学 Background real-time updating method based on block accumulation counting
CN106327521B (en) * 2016-08-23 2019-03-26 豪威科技(上海)有限公司 Video background extracting method and motion image detecting method
CN107578053B (en) * 2017-09-25 2020-03-24 重庆虚拟实境科技有限公司 Contour extraction method and device, computer device and readable storage medium
CN109002750B (en) * 2017-12-11 2021-03-30 罗普特科技集团股份有限公司 Relevant filtering tracking method based on significance detection and image segmentation
CN110473176B (en) * 2019-07-29 2024-04-19 腾讯医疗健康(深圳)有限公司 Image processing method and device, fundus image processing method and electronic equipment
CN111429472B (en) * 2020-03-16 2023-11-03 阿波罗智联(北京)科技有限公司 Image recognition method, device, electronic equipment and storage medium
CN113807227B (en) * 2021-09-11 2023-07-25 浙江浙能嘉华发电有限公司 Safety monitoring method, device, equipment and storage medium based on image recognition

Also Published As

Publication number Publication date
CN101533511A (en) 2009-09-16

Similar Documents

Publication Publication Date Title
CN101533511B (en) Background image updating method and device thereof
US20200005468A1 (en) Method and system of event-driven object segmentation for image processing
US20170186141A1 (en) Video Tone Mapping For Converting High Dynamic Range (HDR) Content To Standard Dynamic Range (SDR) Content
US8295607B1 (en) Adaptive edge map threshold
US20180039864A1 (en) Fast and accurate skin detection using online discriminative modeling
CN108229346B (en) Video summarization using signed foreground extraction and fusion
CN108446089B (en) Data display method and device and display
JP6849101B2 (en) Fast, gradual, super-voxel-based spatiotemporal video segmentation method
CN112019827B (en) Method, device, equipment and storage medium for enhancing video image color
CN116406504A (en) Method and apparatus for histogram-based and adaptive tone mapping using multiple frames
CN112967207A (en) Image processing method and device, electronic equipment and storage medium
US11087444B2 (en) Field programmable gate array (FPGA) implementation and optimization of augmented contrast limited adaptive histogram equalization
CN113014817B (en) Method and device for acquiring high-definition high-frame video and electronic equipment
WO2018126486A1 (en) Parallel video image contrast enhancing method and apparatus
CN111833262A (en) Image noise reduction method and device and electronic equipment
CN108885790A (en) Image is handled based on exercise data generated
US11954765B2 (en) Applying random patches to pixel block of an image utilizing different weights
US9055177B2 (en) Content aware video resizing
US20130278775A1 (en) Multiple Stream Processing for Video Analytics and Encoding
CN103974043B (en) Image processor and image treatment method
CN113269205A (en) Video key frame extraction method and device, electronic equipment and storage medium
CN107222772A (en) A kind of method and device for realizing captions processing
CN113762016A (en) Key frame selection method and device
CN107480616B (en) Skin color detection unit analysis method and system based on image analysis
Tai et al. VLSI architecture design of layer-based bilateral and median filtering for 4k2k videos at 30fps

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20110216

CF01 Termination of patent right due to non-payment of annual fee