Patent ID: 9478039
Filing Date: 2016-10-25
CPC Classification: G06T

Claim Text:
1. An image background modeling and foreground extraction method based on a depth image, characterized by comprising step 1 to step 7, wherein it is determined whether step 7 satisfies the requirement of a final result, and if no, the result is taken as an input to continually repeat step 4 to step 7, until a final result is obtained through continual circulation, the steps specifically comprising: step 1: acquiring a depth image representing a distance from objects to a camera, wherein the depth image is a digital image with any resolution, and a depth value of each pixel point of the depth image is a linear distance in a direction where the objects are perpendicular to the principal optic axis of the camera in a current scene; step 2: initiating a real-time depth background model, wherein a real-time depth background model taking a code block as a unit is initiated by using all pixel points in the depth image, wherein the code block refers to statistical background information of a pixel point, each pixel point has a code block, each code block comprises multiple code words, and a maximum of the number of code words is a preset determined value and determined by the imaging stability of the depth image itself, namely, higher imaging stability indicates a smaller maximum of the number of code words; step 3: updating the real-time depth background model, wherein a target masking image is generated through target identification and code block information corresponding to each pixel point in the real-time depth background model is updated according to the target masking image, wherein the target masking image comprises a target region representing pixel points comprised by each target in the image and a non-target background region, the target region in the target masking image is updated as foreground pixel points, and the background region in the target masking image is updated as background pixel points; step 4: acquiring a current depth image representing the distance from the objects to the camera again; step 5: extracting a foreground image based on the real-time depth background model, wherein according to a depth value of any pixel point in the current depth image, all code words in a code block corresponding to the pixel point are searched and compared with the depth value to determine whether the pixel point is a background point or a foreground point, wherein the background point is set to a background value and the foreground point is set to a foreground value, to form the foreground image; step 6: outputting the foreground image and generating a real-time target masking image, wherein target identification is performed according to the foreground image to identify a target object in the current depth image and generate the real-time target masking image, wherein the real-time target masking image comprises a target region for representing pixel points comprised by each target in the current depth image and a background region for representing pixel points comprised by non-targets; and step 7: updating the real-time depth background model, wherein code block information of each pixel point in the real-time depth background model is updated according to the real-time target masking image, wherein the target region in the real-time target masking image is updated as foreground pixel points, and the background region in the real-time target masking image is updated as background pixel points.