A method and device for removing background of a fixed-point monitoring moving target scene
By identifying and subtracting the background area in the fixed-point monitoring of the moving target scene, the poor background extraction effect and ghosting problems are solved, and the adaptability of complex environments for visual tracking is improved.
Patent Information
- Application Number
- CN202111141975.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-28
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-09-28
AI Technical Summary
In fixed-point monitoring of motion target scenarios, the prior art has problems with poor background extraction effects and ghosting, which makes it difficult to reduce background interference.
By obtaining the pixel point color characteristics and angle values of the monitoring image, the color characteristics difference between pixel points with the same angle value in the adjacent image is calculated. If the difference is less than the threshold, it is recognized as the background area and subtracted in the image.
Effectively reduce background interference, improve visual tracking adaptability, reduce ghost appearance, and improve tracking stability.
Smart Images

Figure CN113888592B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a method and device for removing background of a scene of a fixed-point monitoring moving target. Background Art
[0002] In image recognition, the background varies greatly. Complex backgrounds may have features similar to the target, interfering with the detection, tracking and recognition of the target. Therefore, in order to reduce the interference caused by the background, it is necessary to extract the background.
[0003] The existing background extraction algorithms include: inter-frame difference method, background difference method, ViBe algorithm, and optical flow method. Among them, inter-frame difference method and background difference method are for stationary cameras, while ViBe method and optical flow method are suitable for moving cameras. Current research is basically aimed at improving these methods or improving them in embedded systems.
[0004] In the field of video surveillance, the monitoring point is fixed, but the camera will rotate within a certain angle range to monitor moving targets. In this application scenario, compared with a static camera, the background is moving, but compared with a vehicle-mounted or aircraft-mounted camera, the background range is limited. Summary of the invention
[0005] In order to solve the above technical problems, the present invention proposes a method and device for removing the background of a fixed-point monitoring moving target scene. The method and device are used to solve the technical problems of poor background extraction effect and ghosting in the fixed-point monitoring moving target scene of the prior art.
[0006] According to a first aspect of the present invention, a method for removing background of a scene of a fixed-point monitoring moving target is provided, the method comprising the following steps:
[0007] Step S101: Acquire several surveillance images and extract the I i Each pixel I i (x,y) corresponds to the color feature C i(x,y) ; Where 1≤i≤n, n is the number of monitored images; 1≤x≤P Hi , P Hi For monitoring image I i The number of pixels in the horizontal direction, 1≤y≤P Vi , P Vi For monitoring image I i The number of pixels in the vertical direction; x is the horizontal coordinate of the pixel in the image, y is the vertical coordinate, and the coordinate of the upper left corner is (0,0);
[0008] Step S102: For each monitoring image I i , get each pixel Ii The angle value (φ) corresponding to (x,y) i(x,y) ,θ i(x,y) ), where φ i(x,y) is pixel I i (x,y) azimuth frame angle, θ i(x,y) is pixel I i (x, y) pitch frame angle, the azimuth frame angle φ i(x,y) is the angle of rotation of the pixel point in the left and right directions relative to the initial position; the pitch frame angle θ i(x,y) is the angle of rotation of the pixel point in the up and down directions relative to the initial position;
[0009] Step S103: For all surveillance images, the color feature difference between each pixel having the same angle value in two adjacent surveillance images is calculated. If the color feature difference is less than a predetermined threshold, the area corresponding to the pixel is the background area.
[0010] Step S104: subtract the background area from the monitoring image.
[0011] According to a second aspect of the present invention, there is provided a device for removing background of a scene of a fixed-point monitoring moving target, the device comprising:
[0012] Image acquisition module: configured to acquire a number of surveillance images and extract each surveillance image I i Each pixel I i (x,y) corresponds to the color feature C i(x,y) ; Where 1≤i≤n, n is the number of monitored images; 1≤x≤P Hi , P Hi For monitoring image I i The number of pixels in the horizontal direction, 1≤y≤P Vi , P Vi For monitoring image I i The number of pixels in the vertical direction; x is the horizontal coordinate of the pixel in the image, y is the vertical coordinate, and the coordinate of the upper left corner is (0,0);
[0013] Frame angle acquisition module: configured to obtain each monitoring image I i , get each pixel I i The angle value (φ) corresponding to (x,y) i(x,y) ,θ i(x,y) ), where φ i(x,y) is pixel I i (x,y) azimuth frame angle, θ i(x,y) is pixel I i (x, y) pitch frame angle, the azimuth frame angle φ i(x,y) is the angle of rotation of the pixel point in the left and right directions relative to the initial position; the pitch frame angle θi(x,y) is the angle of rotation of the pixel point in the up and down directions relative to the initial position;
[0014] Feature difference calculation module: configured to calculate the color feature difference between each pixel point with the same angle value in two adjacent surveillance images for all surveillance images. If the color feature difference is less than a predetermined threshold, the area corresponding to the pixel point is the background area;
[0015] Background removal module: configured to subtract the background area in the surveillance image.
[0016] According to a third aspect of the present invention, a system for removing background of a scene of a fixed-point monitoring moving target is provided, comprising:
[0017] A processor, which is used to execute multiple instructions;
[0018] A memory for storing a plurality of instructions;
[0019] The plurality of instructions are used to be stored in the memory, and loaded and executed by the processor to implement the method for removing the background of a scene of a moving target under fixed-point monitoring as described above.
[0020] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium storing a plurality of instructions; the plurality of instructions are used for a processor to load and execute the method for removing background in a scene of fixed-point monitoring of a moving target as described above.
[0021] According to the above solution of the present invention, the interference of the background in the visual tracking method can be reduced, and the adaptability of the visual tracking method to complex environments can be improved.
[0022] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present invention in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention, and the present invention is described by providing the following accompanying drawings. In the accompanying drawings:
[0024] Figure 1 A flow chart of a method for removing background in a fixed-point monitoring moving target scene according to an embodiment of the present invention;
[0025] Figure 2 A structural block diagram of a device for removing background of a fixed-point monitoring moving target scene according to an embodiment of the present invention; DETAILED DESCRIPTION
[0026] First combine Figure 1A method flow for removing background of a scene of a fixed-point monitoring moving target according to an embodiment of the present invention is described, and the method comprises the following steps:
[0027] Step S101: Acquire several surveillance images and extract the I i Each pixel I i (x,y) corresponds to the color feature C i(x,y) ; Where 1≤i≤n, n is the number of monitored images; 1≤x≤P Hi , P Hi For monitoring image I i The number of pixels in the horizontal direction, 1≤y≤P Vi , P Vi For monitoring image I i The number of pixels in the vertical direction; x is the horizontal coordinate of the pixel in the image, y is the vertical coordinate, and the coordinate of the upper left corner is (0,0);
[0028] Step S102: For each monitoring image I i , get each pixel I i The angle value (φ) corresponding to (x,y) i(x,y) ,θ i(x,y) ), where φ i(x,y) is pixel I i (x,y) azimuth frame angle, θ i(x,y) is pixel I i (x, y) pitch frame angle, the azimuth frame angle φ i(x,y) is the angle of rotation of the pixel point in the left and right directions relative to the initial position; the pitch frame angle θ i(x,y) is the angle of rotation of the pixel point in the up and down directions relative to the initial position;
[0029] Step S103: For all surveillance images, the color feature difference between each pixel having the same angle value in two adjacent surveillance images is calculated. If the color feature difference is less than a predetermined threshold, the area corresponding to the pixel is the background area.
[0030] Step S104: subtract the background area from the monitoring image.
[0031] Step S101: Acquire a number of surveillance images and extract the I i Each pixel I i (x,y) corresponds to the color feature C i(x,y) ; Where 1≤i≤n, n is the number of monitored images; 1≤x≤P Hi , P Hi For monitoring image I i The number of pixels in the horizontal direction, 1≤y≤P Vi , P ViFor monitoring image I i The number of pixels in the vertical direction, where:
[0032] The monitoring equipment includes but is not limited to a camera, and each image captured by the camera is converted from the RGB color space to the HSL color space. i For example, each pixel I i Weighted sum of the H, S, and L components of (x, y)
[0033] C i(x,y) =αH i(x,y) +βS i(x,y) +γL i(x,y)
[0034] In the formula, C i(x,y) Represents pixel I i (x, y) weighted sum of color features, H i(x,y) , S i(x,y) , L i(x,y) Represents pixel I i (x, y) is the H, S, L component in the HSL color space. α, β, and γ are the weighted coefficients of the H, S, and L components, respectively, and their magnitude relationship is α>>β>>γ. H represents hue, which is the different colors perceived by the human eye, so its coefficient is the largest; S is saturation, which refers to the purity of the color. The higher the value, the purer the color. At the same time, it is affected by light and is a secondary factor reflecting color characteristics. Its coefficient is in the middle; L is brightness, which is used here to reflect the degree of light reflection of the object, and its coefficient is the smallest. Through the above conversion, the color characteristics of the pixel can be retained to the greatest extent and the impact of light changes can be reduced.
[0035] In this embodiment, the background usually occupies most of the area of an image, and it is not necessary to retain detail information when distinguishing the background. Therefore, the image can be sampled, and one pixel point can be sampled for each m×m block, where m is an odd number, and the pixel at the center of the block is selected.
[0036] The step S102: for each monitoring image I i , get each pixel I i The angle value (φ) corresponding to (x,y) i(x,y) ,θ i(x,y) ), where φ i(x,y) is pixel I i (x,y) azimuth frame angle, θ i(x,y) is pixel I i (x, y) pitch frame angle, the azimuth frame angle φ i(x,y) is the angle of rotation of the pixel point in the left and right directions relative to the initial position; the pitch frame angle θ i(x,y) is the angle of rotation of the pixel point in the up and down directions relative to the initial position, where:
[0037] In fixed-point monitoring, the camera is installed at a fixed location and only moves left or right or up or down. A certain position is selected as the initial position. The angle of rotation in the left-right direction relative to the initial position is called the azimuth frame angle, and the angle of rotation in the up-down direction relative to the initial position is called the pitch frame angle. The azimuth and pitch frame angles at the initial position are both 0 degrees. The azimuth frame angle is positive when moving to the left, and the pitch frame angle is positive when moving upward. In image I i In the example, the number of horizontal and vertical pixels is known to be P. Hi and P Vi , the horizontal and vertical field of view of the camera are Φ and Θ, then the image I i The azimuth frame angle and elevation frame angle at the center are φ Ci and θ Ci Let the coordinates of the upper left pixel of the image be (0,0) and the coordinates of the lower right pixel be (P Hi -1,P Vi -1), then pixel I i The frame angle corresponding to (x,y) is
[0038]
[0039]
[0040] In this embodiment, through the pixel I i The angle value (φ) corresponding to (x,y) i(x,y) ,θ i(x,y) ) indexes the color feature corresponding to the pixel, that is, based on the angle value (φ i(x,y) ,θ i(x,y) ) Determine pixel I i (x,y) corresponds to the color feature C i(x,y) .
[0041] Step S103: Calculate the color feature difference between each pixel with the same angle value in two adjacent monitoring images, wherein the angle value (φ i(x,y) ,θ i(x,y) ) indexes the corresponding pixel points in different surveillance images, which can quickly locate the corresponding pixel points in multiple surveillance images, and then calculate the color feature difference between the pixel points with the same angle value in two adjacent surveillance images, and compare it with the preset threshold to determine the background area.
[0042] In this embodiment, the monitoring image may be a panoramic image, and a panoramic image is saved at regular intervals. The color feature difference is calculated between multiple panoramic images. The area where the difference is less than a certain threshold is considered to have not changed for a period of time and is determined to be the background.
[0043] The step S104: subtracting the background area from the monitoring image, in this embodiment, is applied in the real-time tracking process, obtaining the current monitoring image, subtracting the background color from the current monitoring image, and achieving a fading effect. The faded image changes from a complex background to a single color, which is conducive to reducing background interference and improving tracking stability.
[0044] The embodiment of the present invention further provides a device for removing background of a scene of a fixed-point monitoring moving target, such as Figure 2 As shown, the device comprises:
[0045] Image acquisition module: configured to acquire a number of surveillance images and extract each surveillance image I i Each pixel I i (x,y) corresponds to the color feature C i(x,y) ; Where 1≤i≤n, n is the number of monitored images; 1≤x≤P Hi , P Hi For monitoring image I i The number of pixels in the horizontal direction, 1≤y≤P Vi , P Vi For monitoring image I i The number of pixels in the vertical direction; x is the horizontal coordinate of the pixel in the image, y is the vertical coordinate, and the coordinate of the upper left corner is (0,0);
[0046] Frame angle acquisition module: configured to obtain each monitoring image I i , get each pixel I i The angle value (φ) corresponding to (x,y) i(x,y) ,θ i(x,y) ), where φ i(x,y) is pixel I i (x,y) azimuth frame angle, θ i(x,y) is pixel I i (x, y) pitch frame angle, the azimuth frame angle φ i(x,y) is the angle of rotation of the pixel point in the left and right directions relative to the initial position; the pitch frame angle θ i(x,y) is the angle of rotation of the pixel point in the up and down directions relative to the initial position;
[0047] Feature difference calculation module: configured to calculate the color feature difference between each pixel point with the same angle value in two adjacent surveillance images for all surveillance images. If the color feature difference is less than a predetermined threshold, the area corresponding to the pixel point is the background area;
[0048] Background removal module: configured to subtract the background area in the surveillance image.
[0049] The embodiment of the present invention further provides a system for removing background of a scene of a fixed-point monitoring moving target, comprising:
[0050] A processor, which is used to execute multiple instructions;
[0051] A memory for storing a plurality of instructions;
[0052] The plurality of instructions are used to be stored in the memory, and loaded and executed by the processor to implement the method for removing the background of a scene of a moving target under fixed-point monitoring as described above.
[0053] The embodiment of the present invention further provides a computer-readable storage medium, wherein a plurality of instructions are stored in the storage medium; the plurality of instructions are used for a processor to load and execute the method for removing background in a scene of a moving target monitored at a fixed point as described above.
[0054] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0055] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0056] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0057] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0058] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a physical server, or a network cloud server, etc., which needs to be installed with Windows or Windows Server operating system) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (RandomAccess Memory, RAM), disk or optical disk and other media that can store program codes.
[0059] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A method for removing background from a scene of a fixed-point monitoring moving target, characterized in that: The method comprises the following steps: Step S101: Acquire several surveillance images and extract the I i Each pixel I i (x,y) corresponds to the color feature C i(x,y) ; Where 1≤i≤n, n is the number of monitored images; 1≤x≤P Hi , P Hi For monitoring image I i The number of pixels in the horizontal direction, 1≤y≤P Vi , P Vi For monitoring image I i The number of pixels in the vertical direction; x is the horizontal coordinate of the pixel in the image, y is the vertical coordinate, and the coordinate of the upper left corner is (0,0); Step S102: For each monitoring image I i , get each pixel I i The angle value (φ) corresponding to (x,y) i(x,y) ,θ i(x,y) ), where φ i(x,y) is pixel I i (x,y) azimuth frame angle, θ i(x,y) is pixel I i (x, y) pitch frame angle, the azimuth frame angle φ i(x,y) is the angle of rotation of the pixel point in the left and right directions relative to the initial position; the pitch frame angle θ i(x,y) is the angle of rotation of the pixel point in the up and down directions relative to the initial position; Step S103: For all surveillance images, the color feature difference between each pixel having the same angle value in two adjacent surveillance images is calculated. If the color feature difference is less than a predetermined threshold, the area corresponding to the pixel is the background area. Step S104: subtracting the background area from the monitoring image; Pixel I i (x,y) corresponds to the color feature C i(x,y) The calculation method is to convert each pixel point I i Weighted sum of the H, S, and L components of (x, y) C i(x,y) =αH i(x,y) +βS i(x,y) +γL i(x,y) In the formula, C i(x,y) Represents pixel I i (x, y) weighted sum of color features, H i(x,y) , S i(x,y) , L i(x,y) Represents pixel I i (x, y) is the H, S, and L components in the HSL color space. α, β, and γ are the weighting coefficients of the H, S, and L components, respectively, and their magnitude relationship is α>>β>>γ; Pixel I i The frame angle corresponding to (x,y) is φ Ci and θ Ci I i Center position, orientation, frame angle and image I i Center position pitch frame angle.
2. The method for removing background of a fixed-point monitoring moving target scene as claimed in claim 1, characterized in that: The step S103: calculating the color feature difference between the pixels with the same angle value in two adjacent monitoring images, including: i(x,y) ,θ i(x,y) ) indexes the corresponding pixel points in different surveillance images, and then calculates the color feature difference between the pixel points with the same angle value in two adjacent surveillance images.
3. A device for removing background from a scene of a fixed-point monitoring moving target, characterized in that: The device comprises: Image acquisition module: configured to acquire a number of surveillance images and extract each surveillance image I i Each pixel I i (x,y) corresponds to the color feature C i(x,y) ; Where 1≤i≤n, n is the number of monitored images; 1≤x≤P Hi , P Hi For monitoring image I i The number of pixels in the horizontal direction, 1≤y≤P Vi , P Vi For monitoring image I i The number of pixels in the vertical direction; x is the horizontal coordinate of the pixel in the image, y is the vertical coordinate, and the coordinate of the upper left corner is (0,0); Frame angle acquisition module: configured to obtain each monitoring image I i , get each pixel I i The angle value (φ) corresponding to (x,y) i(x,y) ,θ i(x,y) ), where φ i(x,y) is pixel I i (x,y) azimuth frame angle, θ i(x,y) is pixel I i (x, y) pitch frame angle, the azimuth frame angle φ i(x,y) is the angle of rotation of the pixel point in the left and right directions relative to the initial position; the pitch frame angle θ i(x,y) is the angle of rotation of the pixel point in the up and down directions relative to the initial position; Feature difference calculation module: configured to calculate the color feature difference between each pixel point with the same angle value in two adjacent surveillance images for all surveillance images. If the color feature difference is less than a predetermined threshold, the area corresponding to the pixel point is the background area; Background removal module: configured to subtract the background area in the surveillance image; Pixel I i (x,y) corresponds to the color feature C i(x,y) The calculation method is to convert each pixel point I i Weighted sum of the H, S, and L components of (x, y) C i(x,y) =αH i(x,y) +βS i(x,y) +γL i(x,y) In the formula, C i(x,y) Represents pixel I i (x, y) weighted sum of color features, H i(x,y) , S i(x,y) , L i(x,y) Represents pixel I i (x, y) is the H, S, and L components in the HSL color space. α, β, and γ are the weighting coefficients of the H, S, and L components, respectively, and their magnitude relationship is α>>β>>γ; Pixel I i The frame angle corresponding to (x,y) is φ Ci and θ Ci I i Center position, orientation, frame angle and image I i Center position pitch frame angle.
4. The device for removing background of a fixed-point monitoring moving target scene as claimed in claim 3, characterized in that: The feature difference calculation module includes a first calculation submodule configured to calculate the angle value (φ i(x,y) ,θ i(x,y) ) indexes the corresponding pixel points in different surveillance images, and then calculates the color feature difference between the pixel points with the same angle value in two adjacent surveillance images.
5. A computer-readable storage medium, wherein a plurality of instructions are stored in the storage medium; the plurality of instructions are used for a processor to load and execute the method for removing background of a scene of a fixed-point monitoring moving target as described in any one of claims 1-2.
