A human body shielding detection method, computer device and storage medium
By acquiring the key point locations and semantic segmentation results of human images, and combining the effective pixel values, area, and connectivity of the segmented regions for occlusion judgment, this method solves the misjudgment problem of existing occlusion detection methods when the lighting environment changes, and achieves occlusion detection with high accuracy and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-18
- Publication Date
- 2026-03-10
AI Technical Summary
Existing occlusion detection methods are prone to misjudgment when the lighting environment changes, lack interpretability, and image classification methods lack reliability in occlusion judgment.
By acquiring the key point locations and semantic segmentation results of human images, and combining the effective pixel values, area, and connectivity of the segmented regions, occlusion judgment is performed. The confidence of key points is discarded, and a neural network model is used for human region segmentation and occlusion detection.
It improves the accuracy and reliability of occlusion detection, has high environmental robustness, does not require threshold adjustment based on environment, and the detection results are reliable and interpretable.
Smart Images

Figure CN116363692B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method for detecting human occlusion, a computer device, and a storage medium. Background Technology
[0002] Existing occlusion detection methods are mostly based on feeding the image after pedestrian detection into an image classification network for occlusion classification, or indirectly determining whether a pedestrian is occluded by predicting the visibility of pedestrian keypoint coordinates and judging the confidence level of the keypoint coordinates and the set possible occlusion threshold.
[0003] Methods based on keypoint coordinate confidence levels offer limited interpretability for occlusion detection and are prone to misjudgment as lighting conditions change. Furthermore, different confidence thresholds may be required for different environments. Occlusion detection in image classification often determines occlusion based on category scores, which also lacks interpretability. Summary of the Invention
[0004] Therefore, it is necessary to propose a human body occlusion detection method, computer equipment, and storage medium to address the above problems, which can improve the reliability and accuracy of human body occlusion detection.
[0005] A method for detecting human body occlusion includes:
[0006] Acquire the image to be processed and crop out the human body image from the image to be processed;
[0007] The human body image is input into a neural network model to obtain the key point locations and semantic segmentation results of the human body image. Based on the key point locations and semantic segmentation results, a human body region segmentation image of the human body image is obtained. The human body region segmentation image includes multiple segmentation regions, and each segmentation region has a corresponding pixel value.
[0008] Obtain the image pixel value of the point corresponding to the key point location in the human body region segmentation image, and determine whether the image pixel value is a valid pixel value;
[0009] If the image pixel values of all key point locations are valid pixel values, then the area and connectivity of the valid pixel value region of each segmented region are obtained, and it is determined whether each segmented region is occluded based on the area and / or connectivity of the valid pixel value region.
[0010] The step of obtaining the effective pixel value area and region connectivity of each segmented region includes:
[0011] Determine whether the area of the effective pixel value region of each segmented region is lower than the corresponding preset area threshold. If the area of the effective pixel value region of the segmented region is lower than the corresponding preset area threshold, it is determined that the segmented region has occlusion.
[0012] The segmented regions include a head region, an upper body region, and a lower body region;
[0013] After the step of determining whether the area of the effective pixel value region of the segmented region is lower than a preset area threshold, the following steps are included:
[0014] If the effective pixel value area of the segmented region is not lower than the corresponding preset area threshold, the effective pixel value area of the lower body region and the upper body region are compared. If the ratio is lower than the preset ratio threshold, it is determined that the lower body region is occluded.
[0015] If the ratio is not lower than a preset ratio threshold, it is determined whether the area between the upper body region and the lower body region is a valid pixel value. If the area between the upper body region and the lower body region is not a valid pixel value, it is determined that the middle part of the human body is occluded, and the quality of the human body image does not meet the preset requirements.
[0016] The step of determining whether each segmented region is occluded based on the area of the effective pixel value region and the region connectivity includes:
[0017] Determine whether there exists a segmented region with an effective pixel value area of 0. If there exists a segmented region with an effective pixel value area of 0, then determine that the quality of the human body image does not meet the preset requirements.
[0018] The step of determining whether each segmented region is occluded based on the area of the effective pixel value region and the region connectivity includes:
[0019] The number of contours in each segmented region is obtained. If the number of contours in the segmented region is greater than or equal to 2, it is determined that the segmented region is occluded.
[0020] The step of determining whether each segmented region is occluded based on the area of the effective pixel value region and the region connectivity includes:
[0021] If the number of contours in the segmented region is greater than or equal to 3, then the quality of the human body image is determined to be unsatisfactory.
[0022] The step of determining whether the image pixel value is a valid pixel value includes:
[0023] If the image pixel value at the location of the key point is not a valid pixel value, then it is determined that the key point location corresponding to the image pixel value is occluded.
[0024] The step of determining whether the image pixel value is a valid pixel value includes:
[0025] Calculate the number of key points that are occluded. If the number exceeds a preset threshold, then determine that the quality of the human image does not meet the preset requirements.
[0026] A computer device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps described above.
[0027] A computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps described above.
[0028] The embodiments of the present invention have the following beneficial effects:
[0029] The method obtains the key point locations and semantic segmentation results of the human body image, and obtains human body region segmentation images based on the key point locations and semantic segmentation results. It determines whether each segmented region is occluded based on the effective pixel value, region area and / or region connectivity of each segmented region. It combines key point detection and image segmentation methods for occlusion detection, abandons key point confidence and combines semantic segmentation results for occlusion judgment, does not need to adjust the threshold according to the environment, has high environmental robustness, and the detection results are accurate and reliable. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] in:
[0032] Figure 1 This is a flowchart illustrating the first embodiment of the human body occlusion detection method provided by the present invention;
[0033] Figure 2 This is a schematic diagram showing the location of key points provided by the present invention;
[0034] Figure 3 This is a schematic diagram of the neural network structure provided by the present invention;
[0035] Figure 4 This is a schematic diagram of the human body region segmentation image provided by the present invention;
[0036] Figure 5 This is an image diagram showing the points corresponding to key points in a human body region segmentation image.
[0037] Figure 6 This is a flowchart illustrating the second embodiment of the human body occlusion detection method provided by the present invention;
[0038] Figure 7 This is a flowchart illustrating the third embodiment of the human body occlusion detection method provided by the present invention;
[0039] Figure 8 This is a schematic diagram of the human body occlusion detection results provided by the present invention;
[0040] Figure 9 This is a schematic diagram of the structure of an embodiment of the computer device provided by the present invention;
[0041] Figure 10 This is a schematic diagram of an embodiment of the computer-readable storage medium provided by the present invention. Detailed Implementation
[0042] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0043] Please refer to the following: Figure 1 , Figure 1 This is a schematic flowchart of the first embodiment of the human body occlusion detection method provided by the present invention. The human body occlusion detection method provided by the present invention includes the following steps:
[0044] S101: Obtain the image to be processed and crop out the human body image from the image to be processed.
[0045] In a specific implementation scenario, the image to be processed is acquired. This image can be a frame obtained by sampling a video, a real-time image captured by a camera, an image downloaded from the internet, or an image uploaded by a user. The image to be processed is input into a detection model to obtain the human body contours within the image. These contours are then cropped to obtain the human body image. When multiple figures are present in the image, the human body contours of each figure are cropped to obtain multiple human body images, one corresponding to one figure. Occlusion detection is then performed on each human body image, or the target figure is selected from multiple figures based on preset criteria to obtain the target figure's human body image. After obtaining the human body images, they need to be scaled to ensure that the images are of roughly the same size for subsequent detection processing.
[0046] S102: Input the human body image into the neural network model to obtain the key point location and semantic segmentation result of the human body image. Based on the key point location and semantic segmentation result, obtain the human body region segmentation image of the human body image. The human body region segmentation image includes multiple segmentation regions, and each segmentation region has a corresponding pixel value.
[0047] In a specific implementation scenario, a human image is input into a neural network model. This model can obtain the key point locations of the human image. The key point locations adopt the definition of pedestrian key points in the COCO dataset, consisting of 17 key points on the human body: 0-nose, 1-left eye, 2-right eye, 3-left ear, 4-right ear, 5-left shoulder, 6-right shoulder, 7-left elbow, 8-right elbow, 9-left wrist, 10-right wrist, 11-left hip, 12-right hip, 13-left knee, 14-right knee, 15-left ankle, 16-right ankle. Please refer to the relevant documentation. Figure 2 , Figure 2 This is a schematic diagram of the key point locations provided by the present invention. The neural network model can also acquire semantic information from human images and assign corresponding pixel values to each pixel of the human image based on this semantic information. Specific pixel values can be set by the user according to actual needs, ensuring that points with different semantic information are displayed differently. In this implementation scenario, the semantic label pixel value for the upper body region is set to 1, the semantic label pixel value for the lower body region is set to 2, the semantic label pixel value for the head region is set to 3, and the semantic label pixel value for the background region is set to 0. Objects obscuring the person are defined as belonging to the background category.
[0048] Please refer to the following: Figure 3 , Figure 3This is a schematic diagram of the neural network structure provided by the present invention. The neural network model is a multi-task model for human keypoint detection and segmentation based on deep learning, simultaneously predicting keypoint coordinates and semantic information of the person's pixels. The shallow convolutional network portion of the neural network model is reused, with one branch predicting the keypoint coordinates of pedestrians and the other predicting the semantic category of the pedestrian image, thus forming a multi-task model. The input of this neural network model is a human image. After passing through shallow convolutional layers with shared weight information, features such as texture and structure are extracted from the input human image. Compared to two separate keypoint detection and human segmentation tasks, this step reduces the computational cost of the weight-sharing convolutional layers. By processing the outputs of the two branches, the keypoint positions and semantic segmentation results corresponding to the current input human image are obtained respectively.
[0049] Simultaneously, by combining keypoint locations and semantic segmentation results, a human body region segmentation image is obtained from the human image. This human body region segmentation image includes multiple segmented regions. In this implementation scenario, these multiple segmented regions include the head region, upper body region, and lower body region. For example, the region including keypoints 0, 1, 2, 3, and 4, and located above keypoints 5 and 6, belongs to the head region; the region including keypoints 5, 6, 7, 8, 9, and 10, and located above keypoints 11 and 12, belongs to the upper body region; and the region including keypoints 11, 12, 13, 13, 14, and 16 belongs to the lower body region. The boundaries between the head region, upper body region, and lower body region are then adjusted based on the semantic segmentation results to obtain the human body region segmentation image. Please refer to [reference needed]. Figure 4 , Figure 4 This is a schematic diagram of the human body region segmentation image provided by the present invention. The acquired human body region segmentation image includes multiple segmented regions, each with a corresponding pixel value. For example, if a point's original semantic segmentation result is 1, and based on the keypoint location, the point belongs to the upper body region, then the pixel value of that point is 1. As another example, if a point's original semantic segmentation result is 3, and based on the keypoint location, the point belongs to the upper body region, then the pixel value of that point is adjusted to 1. For points with a semantic segmentation result of 0, no pixel value adjustment is made.
[0050] S103: Obtain the image pixel value of the point corresponding to the key point location in the human body region segmentation image, determine whether the image pixel value is a valid pixel value, and if so, execute step S104.
[0051] In a specific implementation scenario, the image pixel values of the points corresponding to the key point locations in the human body region segmentation image are obtained. It is then determined whether these image pixel values are valid. Valid pixel values in this implementation scenario are non-zero pixel values. In other implementation scenarios, they could be the pixel values assigned to points that are not part of the background and are semantic information, as described in step S102. For details on obtaining the image pixel values of the key point locations in the human body region segmentation image, please refer to [reference needed]. Figure 5 , Figure 5 This is an image illustration showing the location of a key point in a human body region segmentation image. If the pixel value of the key point in the human body region segmentation image is 0, it means that the key point is occluded. If the pixel value of the key point in the human body region segmentation image is not 0, it means that the key point is not occluded, but this does not mean that the segmented region containing the key point is not occluded.
[0052] S104: Obtain the effective pixel value area and region connectivity of each segmented region, and determine whether each segmented region is occluded based on the effective pixel value area and / or region connectivity.
[0053] In a specific implementation scenario, if the image pixel values corresponding to all keypoint locations are valid pixel values, it indicates that there is no occlusion at any keypoint location. However, it is still necessary to exclude whether there is occlusion at other locations outside the keypoint locations within each segmented region. The effective pixel value area and the region connectivity of each segmented region are obtained; that is, the existence of multiple connected components in each segmented region is statistically analyzed. Based on the effective pixel value area and / or region connectivity, it is determined whether each segmented region is occluded.
[0054] Since the human body parts corresponding to the segmented regions are known, the area range of the segmented regions is also known. For example, the size of a human head has a known range (which can be obtained through big data sampling). Therefore, the area of the head region in the segmented region has a minimum preset area threshold. Similarly, the upper body region and the lower body region each have their own preset area thresholds. The area corresponding to the effective pixel values of each segmented region is calculated. In this implementation scenario, this refers to the area corresponding to non-zero pixel values, that is, the area of the unoccluded region. The area corresponding to the effective pixel values of each segmented region is compared with its respective preset area threshold. If the area corresponding to the effective pixel values of a segmented region is lower than the corresponding preset area threshold, it indicates that the area of the effective pixel values of that segmented region is too small, and it can be determined that the segmented region is occluded.
[0055] In other implementation scenarios, if the area corresponding to the effective pixel value of the segmented region is not lower than its respective preset area threshold, it indicates that the segmented region may not be occluded, and further judgment is needed to determine whether occlusion exists. In this implementation scenario, the segmented region includes the upper body region and the lower body region. The area ratio of the upper body and the lower body can be known, for example, obtained through big data collection and processing. The human body image is segmented, and the effective pixel value areas of the lower body region and the upper body region are compared. It is determined whether the obtained ratio is lower than the corresponding preset ratio threshold (e.g., 0.15). If the ratio is lower than the preset ratio threshold, it indicates that the effective pixel value area of the lower body region is small, and some areas are occluded. Therefore, it is determined that the lower body region is occluded.
[0056] In other implementation scenarios, if neither the upper nor lower body regions are obstructed, it is necessary to determine whether there is obstruction between the upper and lower body regions. For example, in this implementation scenario, it can be determined whether there are any points with an image pixel value of 0 in the area between the upper and lower body regions, that is, whether the image pixel values of the points in this area are all valid pixel values. If there are any points with an image pixel value of 0 in this area, that is, not all the image pixel values of the points in this area are valid pixel values, then it is determined that there is obstruction between the upper and lower body regions.
[0057] In another implementation scenario, the number of contours in each segmented region can be obtained by performing single-pixel contour extraction on points with the same pixel value in each segmented region. For example, the number of contours of connected regions formed by points with the same pixel value in each segmented region can be obtained. If a segmented region is unoccluded, its contour count should be 1. If the contour count is greater than 1, it indicates that the segmented region has multiple connected regions, i.e., there is occlusion.
[0058] In one implementation scenario, the determination of whether each segmented region is occluded can be made by combining the determination results of the effective pixel value area and / or the region connectivity, or by using only the determination results of the effective pixel value area and the region connectivity.
[0059] In other implementation scenarios, determining that at least one segmented region in a human body region segmentation image is occluded is sufficient to diagnose occlusion in the human body image. Further assessment of the severity of occlusion is needed. If severe occlusion is present, the human body image requires processing, such as deletion or special marking. This can be determined by counting the number of keypoints with a pixel value of 0 in the human body region segmentation image. If this number exceeds a preset threshold (e.g., 3), it indicates that a large area of the human body is occluded, and the quality of the human body image is deemed unsatisfactory.
[0060] Alternatively, the effective pixel value area of each segmented region can be obtained. If at least one segmented region has an effective pixel value area of 0, it indicates that the segmented region is completely occluded, and the quality of the human image is determined to be unsatisfactory.
[0061] The system can also calculate the number of contours in each segmented region for judgment. If the number of contours in at least one segmented region is greater than 3, then at least one segmented region has occlusion in the form of through-holes, multiple blocks, etc., and the quality of the human body image is determined to be unsatisfactory.
[0062] It can also determine whether the area between the upper body region and the lower body region consists entirely of valid pixel values. If the area between the upper body region and the lower body region does not consist entirely of valid pixel values, it is determined that the middle part of the human body is occluded, and the quality of the human body image does not meet the preset requirements.
[0063] If the quality of the human body image does not meet the preset requirements, it cannot be used for subsequent human body recognition and other operations. The human body image can be deleted and a new human body image can be obtained to perform the above steps.
[0064] As described above, this embodiment obtains the key point locations and semantic segmentation results of human images, obtains human region segmentation images based on the key point locations and semantic segmentation results, and determines whether each segmented region is occluded based on the effective pixel values, region area, and / or region connectivity of each segmented region. It combines key point detection and image segmentation methods for occlusion detection, abandons key point confidence and combines semantic segmentation results for occlusion judgment, does not require threshold adjustment based on the environment, has high environmental robustness, and the detection results are accurate and reliable.
[0065] Please see Figure 6 , Figure 6 This is a schematic flowchart of the second embodiment of the human body occlusion detection method provided by the present invention. The human body occlusion detection method provided by the present invention includes the following steps:
[0066] S201: Obtain the image to be processed and crop out the human body image from the image to be processed.
[0067] S202: Input the human body image into the neural network model to obtain the key point location and semantic segmentation results of the human body image. Based on the key point location and semantic segmentation results, obtain the human body region segmentation image of the human body image, which includes multiple segmentation regions.
[0068] S203: Obtain the image pixel values of the key point locations in the human body region segmentation image, and determine whether the image pixel values are valid pixel values; if yes, proceed to step S204 or S207; if no, proceed to step S208.
[0069] S204: Determine whether the area of the effective pixel value region of each segmented region is lower than the corresponding preset area threshold. If not, proceed to step S205; if yes, proceed to step S208.
[0070] S205: Compare the effective pixel value areas of the lower body region and the upper body region, and determine whether the ratio is lower than the preset ratio threshold. If not, proceed to step S206; if yes, proceed to step S208.
[0071] S206: Determine whether the area between the upper body region and the lower body region consists entirely of valid pixel values. If not, proceed to step S208.
[0072] S207: Obtain the number of contours in each segmented region, and determine whether the number of contours in the segmented region is greater than or equal to 2. If so, proceed to step S208.
[0073] S208: Determine that at least one segmented region is occluded.
[0074] In a specific implementation scenario, the details of steps S201-S208 have been described above and will not be repeated here.
[0075] Please see Figure 7 , Figure 7 This is a flowchart illustrating the third embodiment of the human body occlusion detection method provided by the present invention. The human body occlusion detection method provided by the present invention includes the following steps:
[0076] S301: Obtain the image to be processed and crop out the human body image from the image to be processed.
[0077] S302: Input the human body image into the neural network model to obtain the key point location and semantic segmentation result of the human body image. Based on the key point location and semantic segmentation result, obtain the human body region segmentation image of the human body image. The human body region segmentation image includes multiple segmentation regions, and each segmentation region has a corresponding pixel value.
[0078] S303: Obtain the image pixel values of the points corresponding to the key point locations in the human body region segmentation image, and determine whether all image pixel values are valid pixel values; if yes, proceed to step S305 or S308; if no, proceed to step S304.
[0079] S304: Calculate the number of occluded key points and determine whether the number exceeds the preset threshold. If so, proceed to step S310.
[0080] S305: Determine whether the area of the effective pixel value region of each segmented region is lower than the corresponding preset area threshold. If yes, proceed to step S306. If no, proceed to step S307.
[0081] S306: Determine if there is a segmented region with an effective pixel value and a region area of 0. If so, proceed to step S310.
[0082] S307: Determine whether the area between the upper body region and the lower body region consists entirely of valid pixel values. If not, proceed to step S310.
[0083] S308: Obtain the number of contours of connected regions in each segmented region, and determine whether the number of contours in the segmented region is greater than or equal to 2. If so, proceed to step S309.
[0084] S309: Determine whether the number of contours in the segmented region is greater than or equal to 3. If so, proceed to step S310.
[0085] S310: The quality of the human body image does not meet the preset requirements.
[0086] In a specific implementation scenario, the details of steps S301-S310 have been described above and will not be repeated here.
[0087] In one implementation scenario, Figures 1-3 The method shown in the image is tested on the Partial-Reid dataset. By comparing the original test image and the visualized result image, the accuracy and effectiveness of occlusion detection can be intuitively judged. At the same time, it can accurately locate the specific location of the occlusion. The test results are as follows: Figure 8 As shown, Figure 8 This is a schematic diagram of the human body occlusion detection results provided by the present invention.
[0088] In one implementation scenario, tests were conducted on a 625-image test set of the Partial-Reid dataset. The test set included 467 occluded images, of which 451 were detected; and 158 non-occluded images were detected. The test results are shown in Table 1 below.
[0089] Table 1 Test Results
[0090]
[0091] As shown in Table 1, out of a total of 467 pedestrians with obscurations, 463 were accurately detected, achieving a detection accuracy of 99.1%. Out of a total of 158 normal pedestrians without obscurations, all 158 were correctly detected, achieving an accuracy of 100%.
[0092] This invention not only solves the problem of low accuracy in occlusion detection using traditional and classification-based algorithms, but also provides visualization of occlusion detection results, improving the usability of human occlusion detection methods. Compared to keypoint confidence methods, this application combines keypoint detection and image segmentation techniques, eliminating the need to adjust thresholds based on the environment, making it simple to apply and highly robust to environmental conditions. It also filters occluded pedestrians, significantly improving the accuracy of methods such as Re-identification (using algorithms) pedestrian recognition, pedestrian tracking, and uniform recognition.
[0093] Please see Figure 9 , Figure 9 This is a schematic diagram of an embodiment of the computer device provided by the present invention. The intelligent device 10 includes a processor 11 and a memory 12. The processor 11 is coupled to the memory 12. The memory 12 stores a computer program, which the processor 11 executes during operation to implement the method described above. Detailed steps can be found above and will not be repeated here.
[0094] Please see Figure 10 , Figure 10 This is a schematic diagram of an embodiment of the computer-readable storage medium provided by the present invention. The computer-readable storage medium 20 stores at least one computer program 21, which is executed by a processor to implement the method described above. Detailed steps can be found above and will not be repeated here. In one embodiment, the computer-readable storage medium 20 can be a storage chip in a terminal, a hard disk, a portable hard disk, a USB flash drive, an optical disc, or other readable and writable storage tools, or it can be a server, etc.
[0095] The storage medium can be implemented by any type of volatile or non-volatile storage device, or a combination thereof. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM). The storage media described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.
[0096] In the several embodiments provided by this invention, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0097] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0098] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0099] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, and optical disks.
[0100] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0101] The methods disclosed in the several method embodiments provided by this invention can be arbitrarily combined without conflict to obtain new method embodiments.
[0102] The features disclosed in the several product embodiments provided by this invention can be arbitrarily combined without conflict to obtain new product embodiments.
[0103] The features disclosed in the several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0104] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various equivalent substitutions or obvious modifications can be made without departing from the concept of the present invention, and all such modifications, achieving the same performance or application, should be considered within the scope of protection of the present invention.
Claims
1. A human occlusion detection method, characterized by, The method comprises the following steps: acquiring a to-be-processed image, and cutting out a human body image in the to-be-processed image; inputting the human body image into a neural network model, acquiring a key point position and a semantic segmentation result of the human body image, and acquiring a human body region segmentation image of the human body image based on the key point position and the semantic segmentation result, wherein the human body region segmentation image comprises a plurality of segmentation regions, and each segmentation region has a corresponding pixel value; acquiring an image pixel value of a point corresponding to the key point position in the human body region segmentation image, and judging whether the image pixel value is a valid pixel value; the valid pixel value is a pixel value corresponding to a non-background region; if the image pixel value of the point corresponding to the key point position is not a valid pixel value, it is determined that the corresponding key point position is occluded; if the image pixel values of all the key point positions are valid pixel values, the valid pixel value area and / or the region connectivity of each segmentation region are acquired, and it is judged whether each segmentation region is occluded based on the valid pixel value area and / or the region connectivity, wherein the region connectivity is the number of connected domains existing in each segmentation region.
2. The human occlusion detection method of claim 1, wherein The step of judging whether each segmentation region is occluded based on the valid pixel value area and / or the region connectivity comprises the following steps: judging whether the valid pixel value area of each segmentation region is lower than a corresponding preset area threshold value, and if the valid pixel value area of the segmentation region is lower than the corresponding preset area threshold value, it is determined that the segmentation region has an occlusion.
3. The human occlusion detection method of claim 2, wherein The segmentation region comprises a head region, an upper body region and a lower body region. After the step of judging whether the valid pixel value area of the segmentation region is lower than a preset area threshold value, the following steps are included: if the valid pixel value area of the segmentation region is not lower than the corresponding preset area threshold value, the valid pixel value areas of the lower body region and the upper body region are compared, and if the ratio is lower than a preset ratio threshold value, it is determined that the lower body region is occluded; if the ratio is not lower than the preset ratio threshold value, it is judged whether the region between the upper body region and the lower body region is all valid pixel values, and if the region between the upper body region and the lower body region is not all valid pixel values, it is determined that the middle part of the human body is occluded, and it is determined that the quality of the human body image does not meet a preset requirement.
4. The human occlusion detection method of claim 2, wherein The step of judging whether each segmentation region is occluded based on the valid pixel value area and / or the region connectivity comprises the following steps: judging whether there is a segmentation region whose valid pixel value area is 0, and if there is a segmentation region whose valid pixel value area is 0, it is determined that the quality of the human body image does not meet a preset requirement.
5. The human occlusion detection method of claim 1, wherein The step of judging whether each segmentation region is occluded based on the valid pixel value area and / or the region connectivity comprises the following steps: acquiring the number of contours of a connected domain having the same image pixel value in each segmentation region, and if the number of contours in the segmentation region is greater than or equal to 2, it is determined that the segmentation region has an occlusion.
6. The human occlusion detection method of claim 5, wherein The step of judging whether each of the segmentation regions is occluded based on the area of the effective pixel value region and / or the region connectivity comprises: If the number of contours in the segmentation region is greater than or equal to 3, it is determined that the quality of the human body image does not meet the preset requirement.
7. The human occlusion detection method of claim 1, wherein The step of judging whether the image pixel value is an effective pixel value comprises: The number of positions of the occluded key points is calculated, and if the number exceeds a preset number threshold, it is determined that the quality of the human body image does not meet the preset requirement. 8.A computer readable storage medium storing a computer program, wherein the computer program is executed by a processor to make the processor perform the steps of the method according to any one of claims 1 to 7. 9.A computer device comprising a memory and a processor, wherein the memory stores a computer program, and the computer program is executed by the processor to make the processor perform the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Real scene shielding pedestrian detection network based on body key point detection and a detection method thereof
CN109766868A
Shielding recognition method and device, computer equipment and storage medium
CN111310624A
Abnormal behavior identification method and device
CN111753724A
Video-based camera lens shielding detection method and system
CN112927262A