Method, device and monitoring equipment for determining the occlusion state of a target object
By performing object detection and historical occlusion probability analysis on the target image, combined with pre-trained models, the occlusion situation of the target object is judged, and the problems of slow occlusion judgment speed and poor accuracy in the prior art are solved, and more efficient occlusion situation judgment is achieved.
Patent Information
- Application Number
- CN202111023064.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-01
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-09-01
AI Technical Summary
In the prior art, the judgment speed of the target object occlusion in the image is slow and the accuracy of the identification and analysis is difficult to ensure the accuracy of the identification and analysis.
By detecting the target image, dividing preset sub-regions, and determining whether the target object is blocked based on the historical occlusion probability of each sub-region, combining probability analysis and pre-trained occlusion situation to judge the model, reduce the demand for device computing power. Improve judgment speed and accuracy.
It effectively improves the speed and accuracy of judging the occlusion situation of the target object, solves the problems of slow speed and poor accuracy in the prior art, and has higher judgment accuracy.
Smart Images

Figure CN113723318B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a method, a device and a monitoring device for determining an occlusion state of a target object. Background Art
[0002] In the field of intelligent security, various targets in surveillance videos are analyzed. For example, in video structuring, pedestrian, vehicle, and non-motor vehicle attribute analysis or pedestrian and non-motor vehicle re-identification are usually performed. However, the quality of targets in natural scenes varies greatly, and some targets are severely obscured. In this case, if the target is directly input into the subsequent analysis module for analysis, it is difficult to ensure the accuracy of the analysis, and even the analysis results may be completely opposite to the actual results. Therefore, in order to ensure the accuracy of the recognition analysis, it is necessary to determine whether the target is obscured during the analysis process.
[0003] In related technologies, solutions for judging the occlusion of targets in images generally rely heavily on the computing power of the device, and have slow analysis speed and poor accuracy.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet.
[0005] The above information disclosed in the background technology section is only used to enhance the understanding of the background technology of the technology described in this article. Therefore, the background technology may contain some information that does not form the known prior art for those skilled in the art. Summary of the invention
[0006] The embodiments of the present invention provide a method, an apparatus and a monitoring device for determining the occlusion state of a target object, so as to at least solve the problems of slow speed and poor accuracy in judging the occlusion state of a target object in an image in the related art.
[0007] In order to achieve the above-mentioned purpose, according to a first aspect of an embodiment of the present invention, a method for determining the occlusion state of a target object is provided, comprising: performing object detection on a target image of a target scene to determine an object area in the target image; determining at least one preset sub-area corresponding to the object area; and determining whether the target object in the object area is occluded based on a historical occlusion probability corresponding to each preset sub-area in at least one preset sub-area, wherein the historical occlusion probability is a probability of historical target occlusion in the corresponding preset sub-area.
[0008] Furthermore, whether the target object in the object area is occluded is determined based on the historical occlusion probabilities corresponding to each preset sub-area in at least one preset sub-area, including: determining whether the object portion of the target object located in each preset sub-area is occluded based on the historical occlusion probabilities of each preset sub-area; if the object portion located in at least one preset sub-area is occluded, determining that the target object is occluded.
[0009] Furthermore, based on the historical occlusion probability of each preset sub-region, it is determined whether the part of the target object located in each preset sub-region is occluded, including: performing the following operations for each preset sub-region respectively: if the historical occlusion probability corresponding to a preset sub-region among the preset sub-regions is greater than or equal to the first preset probability, then it is determined that the part of the target object located in a preset sub-region is occluded.
[0010] Furthermore, it also includes: if the historical occlusion probability corresponding to a preset sub-region among the preset sub-regions is less than or equal to a second preset probability, determining that a portion of the target object located in a preset sub-region is not occluded, and the second preset probability is less than the first preset probability.
[0011] Furthermore, it also includes: if the historical occlusion probability of a preset sub-region among each preset sub-region is greater than the second preset probability and less than the first preset probability, at least the part of the target image corresponding to a preset sub-region is input into a pre-trained occlusion situation judgment model to obtain the situation where the part of the target object located in a preset sub-region is occluded.
[0012] Furthermore, before performing object detection on the target image of the target scene and determining the object area in the target image, the method also includes: acquiring a background image of the target scene; determining whether the background structure corresponding to each preset sub-area in the background image is the underlying background, the underlying background being a background structure that cannot occlude the target object; and when the background structure corresponding to the corresponding preset sub-area is the underlying background, determining that the historical occlusion probability of the preset sub-area is 0.
[0013] Furthermore, when the background structure corresponding to the corresponding preset sub-area is not the underlying background, the method also includes: obtaining multiple frames of historical images of the target scene, the number of frames of the historical images is greater than the preset number of frames; inputting the multiple frames of historical images into a pre-trained occlusion situation judgment model to obtain multiple historical occlusion results of the preset sub-area; and calculating the historical occlusion probability of the preset sub-area based on the multiple historical occlusion results.
[0014] Furthermore, determining whether the background structure corresponding to each preset sub-area in the background image is the underlying background includes: determining the background structure classification to which each pixel of the background image belongs; and determining whether the background structure corresponding to the corresponding preset sub-area in the background image is the underlying background based on the background structure classification of multiple pixel points corresponding to each preset sub-area in the background image.
[0015] Furthermore, based on the background structure classification of multiple pixel points corresponding to each preset sub-area of the background image, it is determined whether the background structure corresponding to the corresponding preset sub-area in the background image is the underlying background, including: calculating the proportion of pixel points belonging to the underlying background structure among the multiple pixel points corresponding to the preset sub-area; when the proportion of pixel points belonging to the underlying background structure among the multiple pixel points corresponding to the preset sub-area is greater than or equal to the preset proportion, determining that the background structure corresponding to the preset sub-area in the background image is the underlying background; when the proportion of pixel points belonging to the underlying background structure among the multiple pixel points corresponding to the preset sub-area is less than the preset proportion, determining that the background structure corresponding to the preset sub-area in the background image is not the underlying background.
[0016] Furthermore, obtaining a background image of the target scene includes: obtaining multiple frames of scene images of the target scene; and obtaining a background image by using an image fusion algorithm based on the multiple frames of scene images.
[0017] According to a second aspect of an embodiment of the present invention, there is provided a device for determining an occlusion state of a target object, comprising: a detection unit, for performing object detection on a target image of a target scene, and determining an object region in the target image; a first determination unit, for determining at least one preset sub-region corresponding to the object region; and a second determination unit, for determining whether a target object in the object region is occluded based on a historical occlusion probability corresponding to each preset sub-region in at least one preset sub-region, wherein the historical occlusion probability is a probability of historical target occlusion in the corresponding preset sub-region.
[0018] According to a third aspect of an embodiment of the present invention, a non-volatile storage medium is provided, the non-volatile storage medium including a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned method for determining the occlusion state of the target object.
[0019] According to a fourth aspect of an embodiment of the present invention, a processor is provided, and the processor is used to run a program, wherein the program executes the above-mentioned method for determining the occlusion state of a target object when running.
[0020] According to a fifth aspect of an embodiment of the present invention, a monitoring device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for determining the occlusion state of a target object when executing the computer program.
[0021] The method for determining the occlusion state of a target object using the technical solution of the present invention comprises: performing object detection on a target image of a target scene to determine an object area in the target image; determining at least one preset sub-area corresponding to the object area; determining whether the target object in the object area is occluded according to the historical occlusion probability corresponding to each preset sub-area in at least one preset sub-area, wherein the historical occlusion probability is based on the probability of the historical target being occluded in the corresponding preset sub-area. In this way, by combining probability analysis, at least according to the historical occlusion probability of at least one preset sub-area where the target object is located, it is determined whether the target object is occluded. When this scheme is used to judge the occlusion situation of a preset sub-area with a large or small occlusion probability in the target image, it is not necessary to identify or process the target image, which can effectively reduce the demand for device computing power and improve the judgment speed. Moreover, when this judgment method is used to judge the occlusion situation of a preset sub-area with a large or small occlusion probability in the target image, it can have a higher judgment accuracy than the image recognition technology in the related art, thereby solving the problem of slow speed and poor accuracy in judging the occlusion situation of the target in the image in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0023] Figure 1 is a flow chart of an optional embodiment of a method for determining an occlusion state of a target object according to the present invention;
[0024] Figure 2 is a schematic diagram of an optional embodiment of a device for determining an occlusion state of a target object according to the present invention;
[0025] Figure 3 is a flow chart of an optional embodiment of a method for determining an occlusion state of a target object according to the present invention;
[0026] Figure 4 It is a flow chart of determining the historical occlusion probability table of each grid of the target scene according to the method for determining the occlusion state of the target object of the present invention. DETAILED DESCRIPTION
[0027] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] It should be understood that when an element (such as a layer, film, region, or substrate) is described as being "on" another element, the element may be directly on the other element, or there may be intermediate elements. Moreover, in the specification and claims, when an element is described as being "connected" to another element, the element may be "directly connected" to the other element, or "connected" to the other element through a third element.
[0031] Figure 1 is a method for determining the occlusion state of a target object according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0032] Step S102, acquiring a target image of a target scene;
[0033] Step S104, determining one or more preset sub-regions where the target object in the target image is located;
[0034] Step S106 , determining whether the target object is blocked at least according to the historical blocking probability of one or more preset sub-regions, where the historical blocking probability is the probability that the historical target in the corresponding preset sub-region is blocked by other objects.
[0035] The method for determining the occlusion state of the target object using the above scheme includes: performing object detection on the target image of the target scene to determine the object area in the target image; determining at least one preset sub-area corresponding to the object area; determining whether the target object in the object area is occluded according to the historical occlusion probability corresponding to each preset sub-area in at least one preset sub-area, and the historical occlusion probability is based on the probability of the historical target being occluded in the corresponding preset sub-area. In this way, by combining probability analysis, at least according to the historical occlusion probability of at least one preset sub-area where the target object is located, it is determined whether the target object is occluded. When this scheme is used to judge the occlusion situation of the preset sub-area with a large or small occlusion probability in the target image, it is not necessary to identify or process the target image, which can effectively reduce the demand for device computing power and improve the judgment speed. Moreover, when this judgment method is used to judge the occlusion situation of the preset sub-area with a large or small occlusion probability in the target image, it can have higher judgment accuracy than the image recognition technology in the related art, thereby solving the problem of slow speed and poor accuracy in judging the occlusion situation of the target in the image in the related art.
[0036] It should be noted that the preset sub-regions are pre-divided according to the target scene, and the shape of each preset sub-region can be any shape.
[0037] Specifically, whether the target object in the object area is occluded is determined based on the historical occlusion probabilities corresponding to each preset sub-area in at least one preset sub-area, including: determining whether the object part located in each preset sub-area in the target object is occluded based on the historical occlusion probabilities of each preset sub-area; if the object part located in at least one preset sub-area is occluded, it is determined that the target object is occluded.
[0038] If the parts of the target object located in all the preset sub-areas are not blocked, it is determined that the target object is not blocked.
[0039] The historical occlusion probability of each preset sub-region, that is, the probability that the historical target in each preset sub-region is occluded by other objects, can store the historical statistical results, so as to facilitate the subsequent determination of the historical occlusion probability of each preset sub-region.
[0040] In specific cases, the target object may occupy one or more predefined sub-regions:
[0041] When the target object occupies a preset sub-area, if it is determined based on the historical occlusion probability of the preset sub-area that the part of the target object located in the preset sub-area is occluded, then it can be determined that the target object is definitely occluded; and if it is determined based on the historical occlusion probability of the preset sub-area that the part of the target object located in the preset sub-area is not occluded, then it can be determined that the target object is definitely not occluded.
[0042] When the target object occupies multiple preset sub-areas, it can be determined whether the part of the target object located in each preset sub-area is occluded based on the historical occlusion probability of each preset sub-area. If the part of the target object located in each preset sub-area is occluded, the target object must be occluded; otherwise, if the part of the target object located in all the preset sub-areas is not occluded, it can be determined that the target object is not occluded.
[0043] Determining whether a portion of the target object located in each preset sub-region is blocked according to the historical blocking probability of each preset sub-region includes: performing the following operations for each preset sub-region: if the historical blocking probability corresponding to one of the preset sub-regions is greater than or equal to a first preset probability, determining that the portion of the target object located in one of the preset sub-regions is blocked. If the historical blocking probability corresponding to one of the preset sub-regions is less than or equal to a second preset probability, determining that the portion of the target object located in one of the preset sub-regions is not blocked, and the second preset probability is less than the first preset probability.
[0044] In specific implementation, the first preset probability and the second preset probability can be flexibly selected according to actual conditions or needs. For example, in the present embodiment, the first preset probability can be 80% or 90%. At this time, if the historical occlusion probability of the corresponding preset sub-area reaches the first preset probability, then the part of the target object located in the preset sub-area is very likely to be occluded. At this time, the judgment that the target object is occluded can be made faster and more accurately than using other image recognition algorithms. Similarly, in the present embodiment, the second preset probability can be 10% or 20%. When the historical occlusion probability of the corresponding preset sub-area is less than or equal to the second preset probability, the probability that the part of the target object located in the preset sub-area is occluded is also very small. At this time, the judgment that the part of the target object located in the preset sub-area is not occluded can be made faster and more accurately than using other image recognition algorithms.
[0045] If the historical occlusion probability of a preset sub-region among the preset sub-regions is greater than the second preset probability and less than the first preset probability, at least the part of the target image corresponding to a preset sub-region is input into the pre-trained occlusion judgment model to obtain the situation in which the part of the target object located in a preset sub-region is occluded.
[0046] When the historical occlusion probability of the corresponding preset sub-region is between the first preset probability and the second preset probability, it is difficult to obtain an accurate occlusion result by probability. At this time, at least the portion of the target image corresponding to the preset sub-region is input into the occlusion judgment model, which is conducive to obtaining a more reliable judgment result. In this way, the combination of probability judgment and model judgment can effectively improve the judgment speed and ensure the judgment accuracy for various situations.
[0047] Specifically, before performing object detection on the target image of the target scene and determining the object area in the target image, the method also includes: acquiring a background image of the target scene; determining whether the background structure corresponding to each preset sub-area in the background image is the underlying background, the underlying background is a background structure that cannot occlude the target object; when the background structure corresponding to the corresponding preset sub-area is the underlying background, determining that the historical occlusion probability of the preset sub-area is 0.
[0048] That is to say, by determining whether the background structure corresponding to each preset sub-area in the background image is the underlying background, if it is, the background structure corresponding to the preset sub-area cannot cause occlusion to the target object, and then directly determining the historical occlusion probability of the preset sub-area as 0, not only the result is reliable, but also there is no need to perform a large amount of data analysis on the area to calculate the historical occlusion probability. Among them, the underlying background is a background structure that cannot block the target object, such as the sky, road and other types of background structures. When a part of the target object appears in these preset sub-areas, it can be clearly seen that no background occlusion will occur, so that judgments can be made quickly and accurately. If the judgment is made by methods such as CNN (convolutional neural network judgment model), not only the speed is slow, but also when the CNN effect is not good, the accuracy of the result obtained is also poor.
[0049] Specifically, when the background structure corresponding to the corresponding preset sub-area is not the underlying background, the method also includes: obtaining multiple frames of historical images of the target scene, the number of frames of the historical images is greater than the preset number of frames; inputting the multiple frames of historical images into a pre-trained occlusion situation judgment model to obtain multiple historical occlusion results of the preset sub-area; and calculating the historical occlusion probability of the preset sub-area based on the multiple historical occlusion results.
[0050] When the background structure corresponding to the corresponding preset sub-region is not the underlying background, the occlusion judgment model (CNN) will be used to analyze multiple frames of historical images to obtain multiple historical occlusion results, and then the historical occlusion probability of the preset sub-region can be calculated by calculating the ratio of the total number of occlusion results to the total number of all historical occlusion results. It can be understood that when the total number of historical occlusion results is small, the error of the calculated historical occlusion probability may be large and the credibility is poor. By controlling the number of frames of the historical image to be greater than the preset number of frames, it is beneficial to make the historical occlusion probability area stable and reliable. In specific implementation, the specific value of the preset number of frames can be flexibly selected.
[0051] Taking the example of dividing an image into several grid structures, each grid corresponds to a preset sub-area, and the probability information of the target object being blocked by the background in each grid is counted. For example, if a target object occupies three grids A, B, and C, the target counts of these three grids A, B, and C are respectively increased by 1. At the same time, if according to CNN, if the part of the target object located in the corresponding grid is blocked by the background, the background blockage count of the target object in the grid is +1; if CNN determines that the part of the target object located in the corresponding grid is not blocked, the background blockage count of the target object in the grid remains unchanged. After a period of accumulation, multiple target objects may appear in each grid. When the number of target objects exceeds a certain confidence threshold N, the proportion of the target object in this grid that is blocked by the background is counted as the probability of the target object in this grid being blocked by the background.
[0052] Specifically, determining whether the background structure corresponding to each preset sub-region in the background image is the underlying background includes: determining the background structure classification to which each pixel of the background image belongs; and determining whether the background structure corresponding to the corresponding preset sub-region in the background image is the underlying background based on the background structure classification of multiple pixel points corresponding to each preset sub-region of the background image.
[0053] That is to say, each pixel of the background image is classified to determine the background structure to which it belongs, and then according to the classification of multiple pixels in each preset sub-region, it is determined whether the background structure corresponding to the preset sub-region is the underlying background.
[0054] Specifically, based on the background structure classification of multiple pixel points corresponding to each preset sub-area of the background image, it is determined whether the background structure corresponding to the corresponding preset sub-area in the background image is the underlying background, including: calculating the proportion of pixel points belonging to the underlying background structure among the multiple pixel points corresponding to the preset sub-area; when the proportion of pixel points belonging to the underlying background structure among the multiple pixel points corresponding to the preset sub-area is greater than or equal to the preset proportion, determining that the background structure corresponding to the preset sub-area in the background image is the underlying background; when the proportion of pixel points belonging to the underlying background structure among the multiple pixel points corresponding to the preset sub-area is less than the preset proportion, determining that the background structure corresponding to the preset sub-area in the background image is not the underlying background.
[0055] Acquiring the background image of the target scene includes: acquiring multiple frames of scene images of the target scene; and obtaining the background image by using an image fusion algorithm based on the multiple frames of scene images. Thus, by using the image fusion algorithm, the foreground target in the image can be effectively removed to obtain a complete background image, thereby ensuring the accuracy of the final judgment result.
[0056] like Figure 3 and Figure 4 As shown, Figure 3 It is a schematic diagram of a method for determining the occlusion state of a target object according to a more specific embodiment of the present invention. In the specific implementation, the type of each preset sub-area is a grid, that is, the target image is divided into a number of grids. When the target image is acquired, the grid covered by the target image is first determined, and then the historical occlusion probability of each grid is determined according to the historical occlusion probability table of each grid of the target scene. According to the relationship between the historical occlusion probability of each grid and the first preset probability and the second preset probability, if it is greater than or equal to the first preset probability, it is determined that the part of the target object located in the grid is occluded; if it is less than the second preset probability, it is determined that the part of the target object located in the grid is not occluded; if it is between the first preset probability and the second preset probability, the pre-trained occlusion situation judgment model (CNN) is run to determine whether the part of the target object located in the grid is occluded. Figure 4 is a specific implementation example of obtaining the historical occlusion probability table of each grid in the target scene, such as Figure 4As shown, in the specific implementation, an image fusion algorithm is first used to fuse multiple frames of images, thereby removing the foreground target and obtaining the background image, which is divided into several grids. Then, a scene segmentation algorithm is used to determine the background structure classification to which each pixel of the background image belongs. According to the background structure classification of each pixel, it is possible to determine whether each grid is the underlying background. When the corresponding grid is the underlying background, the historical occlusion probability of the grid is determined to be 0. Otherwise, an occlusion situation judgment model (CNN) is run for multiple frames of historical images, and then the historical occlusion probability of the grid is statistically calculated. The historical occlusion probability of each grid is summarized to obtain a historical occlusion probability table of each grid of the target scene.
[0057] Secondly, if Figure 2 As shown, an embodiment of the present invention also provides a device for determining the occlusion state of a target object, including: a detection unit, used to perform object detection on a target image of a target scene, and determine an object area in the target image; a first determination unit, used to determine at least one preset sub-area corresponding to the object area; a second determination unit, used to determine whether the target object in the object area is occluded based on a historical occlusion probability corresponding to each preset sub-area in at least one preset sub-area, wherein the historical occlusion probability is a probability of historical target occlusion in the corresponding preset sub-area.
[0058] The second determination unit includes a first determination module and a second determination module: the first determination module is used to determine whether the object part located in each preset sub-area in the target object is occluded according to the historical occlusion probability of each preset sub-area; the second determination module is used to determine that the target object is occluded if the object part located in at least one preset sub-area is occluded.
[0059] Specifically, the first determination module is used to perform the following operations for each preset sub-region: if the historical occlusion probability corresponding to a preset sub-region among the preset sub-regions is greater than or equal to the first preset probability, then determine that the portion of the target object located in a preset sub-region is occluded.
[0060] The first determination module is also used to: if the historical occlusion probability corresponding to a preset sub-region among the preset sub-regions is less than or equal to a second preset probability, determine that a portion of the target object located in a preset sub-region is not occluded, and the second preset probability is less than the first preset probability.
[0061] Specifically, the first determination module is also used for: if the historical occlusion probability of a preset sub-region among the preset sub-regions is greater than the second preset probability and less than the first preset probability, then at least the part of the target image corresponding to a preset sub-region is input into a pre-trained occlusion situation judgment model to obtain the situation in which the part of the target object located in a preset sub-region is occluded.
[0062] The device also includes a first acquisition unit, a third determination unit and a fourth determination unit: the first acquisition unit is used to acquire the background image of the target scene before performing object detection on the target image of the target scene and determining the object area in the target image; the third determination unit is used to determine whether the background structure corresponding to each preset sub-area in the background image is the underlying background, and the underlying background is a background structure that cannot occlude the target object; the fourth determination unit is used to determine that the historical occlusion probability of the preset sub-area is 0 when the background structure corresponding to the corresponding preset sub-area is the underlying background.
[0063] Specifically, when the background structure corresponding to the corresponding preset sub-area is not the underlying background, the device also includes a second acquisition unit and an input unit: the second acquisition unit is used to acquire multiple frames of historical images of the target scene, and the number of frames of the historical images is greater than the preset number of frames; the input unit is used to input the multiple frames of historical images into a pre-trained occlusion situation judgment model to obtain multiple historical occlusion results of the preset sub-area; based on the multiple historical occlusion results, the historical occlusion probability of the preset sub-area is calculated.
[0064] The third determination unit is used to include: determining the background structure classification to which each pixel point of the background image belongs; and determining whether the background structure corresponding to the corresponding preset sub-area in the background image is the underlying background based on the background structure classification of multiple pixel points corresponding to each preset sub-area of the background image.
[0065] Specifically, the third determination unit is used to: calculate the proportion of pixel points belonging to the underlying background structure among the multiple pixel points corresponding to the preset sub-area; when the proportion of pixel points belonging to the underlying background structure among the multiple pixel points corresponding to the preset sub-area is greater than or equal to the preset proportion, determine that the background structure corresponding to the preset sub-area in the background image is the underlying background; when the proportion of pixel points belonging to the underlying background structure among the multiple pixel points corresponding to the preset sub-area is less than the preset proportion, determine that the background structure corresponding to the preset sub-area in the background image is not the underlying background.
[0066] The first acquisition unit is used to: acquire multiple frames of scene images of the target scene; and obtain a background image by using an image fusion algorithm based on the multiple frames of scene images.
[0067] In addition, an embodiment of the present invention further provides a non-volatile storage medium, which includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned method for determining the occlusion state of the target object.
[0068] Again, an embodiment of the present invention further provides a processor, and the processor is used to run a program, wherein the program executes the above-mentioned method for determining the occlusion state of the target object when it is running.
[0069] Finally, an embodiment of the present invention further provides a monitoring device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for determining the occlusion state of a target object when executing the computer program.
[0070] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments. Moreover, the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be performed in a different order than here.
[0071] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0072] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be 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 through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0073] 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 units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0074] 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 software functional units.
[0075] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0076] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for determining the occlusion state of a target object, characterized in that: include: Performing object detection on a target image of a target scene to determine an object region in the target image; Determine at least one preset sub-region corresponding to the object region; Determining whether the target object in the object area is occluded according to the historical occlusion probability corresponding to each preset sub-area of the at least one preset sub-area, wherein the historical occlusion probability is based on the probability of the historical target being occluded in the corresponding preset sub-area; Determining whether the target object in the object area is blocked according to the historical blocking probability corresponding to each preset sub-area in the at least one preset sub-area includes: determining whether the object portion of the target object located in each preset sub-area is blocked according to the historical blocking probability of each preset sub-area; if the object portion located in at least one preset sub-area is blocked, determining that the target object is blocked; Determining whether a portion of the target object located in each of the preset sub-regions is blocked according to the historical blocking probability of each of the preset sub-regions includes: performing the following operations for each of the preset sub-regions: if the historical blocking probability corresponding to a preset sub-region among the preset sub-regions is greater than or equal to a first preset probability, determining that the portion of the target object located in the preset sub-region is blocked; Before performing object detection on a target image of a target scene and determining an object region in the target image, the method further includes: acquiring a background image of the target scene; determining whether a background structure corresponding to each of the preset sub-regions in the background image is an underlying background, wherein the underlying background is a background structure that cannot block the target object; and when the background structure corresponding to the corresponding preset sub-region is the underlying background, determining that the historical blocking probability of the preset sub-region is 0; When the background structure corresponding to the corresponding preset sub-area is not the underlying background, the method also includes: obtaining multiple frames of historical images of the target scene, the number of frames of the historical images being greater than the preset number of frames; inputting the multiple frames of the historical images into a pre-trained occlusion situation judgment model to obtain multiple historical occlusion results of the preset sub-area; and calculating the historical occlusion probability of the preset sub-area based on the multiple historical occlusion results.
2. The method for determining the occlusion state of a target object according to claim 1, characterized in that: Also includes: If the historical occlusion probability corresponding to a preset sub-region among the preset sub-regions is less than or equal to a second preset probability, it is determined that the portion of the target object located in the preset sub-region is not occluded, and the second preset probability is less than the first preset probability.
3. The method for determining the occlusion state of a target object according to claim 2, characterized in that: Also includes: If the historical occlusion probability of a preset sub-region among the preset sub-regions is greater than the second preset probability and less than the first preset probability, at least the part of the target image corresponding to the preset sub-region is input into a pre-trained occlusion judgment model to obtain the occlusion situation of the part of the target object located in the preset sub-region.
4. The method for determining the occlusion state of a target object according to claim 1, characterized in that: Determining whether the background structure corresponding to each of the preset sub-regions in the background image is the bottom background includes: Determine the background structure category to which each pixel of the background image belongs; According to the background structure classification of the plurality of pixels corresponding to the respective preset sub-regions of the background image, it is determined whether the background structure corresponding to the corresponding preset sub-region in the background image is the underlying background.
5. The method for determining the occlusion state of a target object according to claim 4, characterized in that: Determining whether the background structure corresponding to the corresponding preset sub-region in the background image is the underlying background according to the background structure classification of the plurality of pixels corresponding to each preset sub-region of the background image includes: Calculating the proportion of the pixel points belonging to the underlying background structure among the plurality of pixel points corresponding to the preset sub-area; When the proportion of the pixel points belonging to the underlying background structure among the plurality of pixel points corresponding to the preset sub-region is greater than or equal to the preset proportion, determining that the background structure corresponding to the preset sub-region in the background image is the underlying background; When the proportion of the pixel points belonging to the underlying background structure in the plurality of pixel points corresponding to the preset sub-region is less than the preset proportion, it is determined that the background structure corresponding to the preset sub-region in the background image is not the underlying background.
6. The method for determining the occlusion state of a target object according to claim 1, characterized in that: Acquiring a background image of the target scene, including: Acquire multiple frames of scene images of the target scene; The background image is obtained by using an image fusion algorithm based on multiple frames of the scene image.
7. A device for determining the occlusion state of a target object, characterized in that: include: A detection unit, used to perform object detection on a target image of a target scene and determine an object region in the target image; A first determining unit, configured to determine at least one preset sub-region corresponding to the object region; A second determination unit, configured to determine whether the target object in the object area is occluded according to a historical occlusion probability corresponding to each preset sub-area in the at least one preset sub-area, wherein the historical occlusion probability is based on a probability of historical target occlusion in the corresponding preset sub-area; The second determining unit determines whether the target object in the object area is blocked according to the historical blocking probability corresponding to each preset sub-area in the at least one preset sub-area by: determining whether the object part of the target object located in each preset sub-area is blocked according to the historical blocking probability of each preset sub-area; If an object located in at least one of the preset sub-areas is partially blocked, determining that the target object is blocked; The second determination unit determines whether the object portion of the target object located in each of the preset sub-regions is blocked according to the historical blockage probability of each of the preset sub-regions by: performing the following operations for each of the preset sub-regions: if the historical blockage probability corresponding to one of the preset sub-regions is greater than or equal to a first preset probability, determining that the portion of the target object located in the one preset sub-region is blocked; The detection unit is used to perform object detection on a target image of a target scene and before determining an object region in the target image: acquire a background image of the target scene; Determine whether the background structure corresponding to each of the preset sub-regions in the background image is an underlying background, where the underlying background is a background structure that cannot block the target object; if the background structure corresponding to the corresponding preset sub-region is the underlying background, determine that the historical blocking probability of the preset sub-region is 0; The detection unit is further configured to: acquire multiple frames of historical images of the target scene, the number of frames of the historical images being greater than a preset number of frames, when the background structure corresponding to the corresponding preset sub-region is not the underlying background; Input multiple frames of the historical images into a pre-trained occlusion situation judgment model to obtain multiple historical occlusion results of the preset sub-area; and calculate the historical occlusion probability of the preset sub-area based on the multiple historical occlusion results.
8. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the method for determining the occlusion state of a target object according to any one of claims 1 to 6.
9. A processor, characterized in that: The processor is used to run a program, wherein the program, when running, executes the method for determining the occlusion state of a target object as described in any one of claims 1 to 6.
10. A monitoring device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for determining the occlusion state of a target object as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Face mask detection method and device, electronic equipment and storage medium
CN111523480A
