Clothing detection method, electronic equipment, storage medium and program product

By using object detection models and multi-level image screening technology in clothing detection methods, the problems of high resource consumption and poor generalization of existing methods are solved, and more efficient and flexible clothing detection is achieved.

CN119762757APending Publication Date: 2025-04-04CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411930985.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The existing clothing detection methods have high demand for system resources and poor generalization, resulting in poor application effects in different scenarios.

Method used

By acquiring multiple detection images, using the object detection model to identify images that do not meet the preset clothing wear requirements, calculate global feature values ​​and edge information, and perform multi-level image screening and edge information analysis to improve detection accuracy and reduce computing resource usage.

Benefits of technology

It improves the accuracy and generalization ability of clothing detection, reduces computing resources and memory usage, making this method more flexible and practical in different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119762757A_ABST
    Figure CN119762757A_ABST
Patent Text Reader

Abstract

The invention provides a garment detection method, electronic equipment, a storage medium and a program product, and relates to the technical field of garment detection. The method comprises the following steps: acquiring a plurality of first detection images and an image area where a target object is located in each first detection image; for each first detection image, determining a global feature value of the first detection image; based on all the first detection images, determining the first detection image with the global feature value meeting a preset feature value range as a second detection image; for each second detection image, based on a preset image edge index, determining an edge region and an overlapping region between the edge region and an image region where the target object in the second detection image is located; determining edge information of the second detection image according to the image area, the edge area and the overlapping area; and determining a target detection image according to the edge information of all the second detection images and a preset edge information requirement. The method can reduce system resource requirements and guarantee detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of clothing detection, and in particular to a clothing detection method, electronic equipment, storage medium and program product. Background Art

[0002] In many industries today, in order to ensure the standardization, safety and service quality of the working environment, real-time monitoring with the help of video intelligent monitoring technology has become an important means. For example, in the catering industry, the promotion of the "bright kitchen and bright stove" project enables real-time supervision of kitchen operations to improve the transparency of catering services and food safety standards. Among them, the dress code detection of kitchen staff is a key link; in food processing workshops, the dress compliance of staff has a direct impact on food hygiene quality, which needs to be ensured by video monitoring; in some factory workshops, the wearing of special work clothes is related to production safety and product quality, and there is also a need for dress code detection with the help of video monitoring.

[0003] Currently, when detecting the dress code of staff, it is usually based on the grid data features of the image, using deep neural networks to extract and integrate image features, and then predicting the dress through discriminant or classification algorithms.

[0004] However, these detection methods usually require complex models and a large amount of data support, and have problems such as high demand for system resources and poor generalization. Summary of the invention

[0005] The embodiments of the present application provide a clothing detection method, an electronic device, a storage medium, and a program product, which are used to solve the problems of high system resource requirements and poor generalization of existing detection methods.

[0006] In a first aspect, an embodiment of the present application provides a clothing detection method, comprising:

[0007] Acquire a plurality of first detection images and an image region where the target object is located in each first detection image, wherein the first detection image is an image in which clothing of the target object is identified based on a target detection model and does not meet preset clothing wearing requirements, and the target detection model is a neural network model trained based on historical detection images;

[0008] For each first detection image, determine a global eigenvalue of the first detection image, where the global eigenvalue is used to indicate brightness distribution and pixel complexity of the first detection image;

[0009] Based on all the first detection images, a first detection image whose global eigenvalue satisfies a preset eigenvalue range is determined as a second detection image;

[0010] For each second detection image, based on a preset image edge index, determine an edge region of the second detection image and an overlapping region between the edge region and an image region where the target object in the second detection image is located;

[0011] Determine edge information of the second detection image according to the image area, the edge area and the overlapping area, where the edge information is used to indicate the degree of edge occlusion of the image area in the second detection image;

[0012] The target detection image is determined according to the edge information of all the second detection images and the preset edge information requirement.

[0013] In a possible implementation, determining an edge region of the second detection image and an overlapping region between the edge region and an image region where the target object is located in the second detection image based on a preset image edge indicator includes:

[0014] Determine a first width value of the second detection image in the horizontal direction and a second width value in the vertical direction;

[0015] Multiplying a first indicator in the preset image edge indicator and the first width value to obtain a third width value, and multiplying a second indicator in the preset image edge indicator and the second width value to obtain a fourth width value;

[0016] Determine a single edge area of ​​the second detection image in the horizontal direction according to the first width value and the fourth width value;

[0017] Determine a single edge area of ​​the second detection image in a vertical direction according to the second width value and the third width value;

[0018] Generate an edge region of the second detection image according to the single edge region in the horizontal direction and the single edge region in the vertical direction of the second detection image;

[0019] An overlapping area between the edge area and an image area where the target object is located in the second detection image is determined.

[0020] In a possible implementation, determining edge information of the second detection image according to the image area, the edge area, and the overlapping area includes:

[0021] determining an overlapping sub-region between the image region and each single edge region in the overlapping region;

[0022] If the overlapping area is smaller than the single edge area in the edge area, then for each overlapping sub-area, determining edge sub-information according to the overlapping sub-area and the image area;

[0023] If the overlapping area is greater than or equal to the single edge area in the edge area, then for each overlapping sub-area, determining edge sub-information according to the overlapping sub-area and the single edge area in the edge area;

[0024] The edge information of the second detection image includes edge sub-information corresponding to each overlapping sub-region in the overlapping region.

[0025] In a possible implementation, determining the global feature value of the first detection image includes:

[0026] Determine the brightness value of each pixel in the first detection image and the average brightness value of all pixels;

[0027] Determine the skewness and kurtosis of the first detection image in the brightness channel based on the brightness value and the average brightness value of each pixel;

[0028] Based on the gray level co-occurrence matrix, an entropy value of the first detection image is obtained;

[0029] The global eigenvalue of the first detection image is determined according to the average brightness value, the skewness and kurtosis of the brightness channel, and the entropy value.

[0030] In a possible implementation, before determining the brightness value of each pixel in the first detection image and the average brightness value of all pixels, the method further includes:

[0031] Converting the first detection image into a grayscale image;

[0032] De-noising the grayscale image to obtain a denoised image;

[0033] Accordingly,

[0034] When determining the brightness value of each pixel in the first detection image and the average brightness value of all pixels, the first detection image is a denoised image.

[0035] In a possible implementation, before determining the edge area of ​​the second detection image and the overlapping area between the edge area and the image area where the target object is located in the second detection image based on the preset image edge index, the method further includes:

[0036] Determining an actual dressed image of the target object and an actual histogram of the actual dressed image;

[0037] For each second detection image, normalize the second detection image to obtain a normalized histogram;

[0038] Determine the similarity between the second detection image and the actual clothing image according to the normalized histogram and the actual histogram;

[0039] Screening all the second detection images according to the similarity between all the second detection images and the actual clothing image and the preset image similarity condition;

[0040] Accordingly,

[0041] When determining the edge area of ​​the second detection image and the overlapping area between the edge area and the image area where the target object in the second detection image is located based on the preset image edge index, the second detection image is a second detection image that meets the preset image similarity condition after screening processing.

[0042] In a possible implementation, normalizing the second detection image to obtain a normalized histogram includes:

[0043] Determine the total number of pixels according to the width and height of the second detection image;

[0044] Separating the color channels of the second detection image and determining a pixel matrix of each color channel;

[0045] Based on the pixel matrix of each color channel and the total number of pixels, a normalized histogram is determined.

[0046] In a possible implementation manner, after determining the target detection image according to the edge information of all the second detection images and the preset edge information requirement, the method further includes:

[0047] Determining an actual dressed image of the target object and an actual histogram of the actual dressed image;

[0048] For each target detection image, normalize the target detection image to obtain a normalized histogram;

[0049] Determine the similarity between the target detection image and the actual clothing image based on the normalized histogram and the actual histogram;

[0050] According to the similarity between all the target detection images and the actual clothing images and the preset image similarity condition, all the target detection images are screened to obtain the screened target detection images.

[0051] In a second aspect, an embodiment of the present application provides a clothing detection device, comprising:

[0052] an acquisition module, for acquiring a plurality of first detection images and an image region where a target object is located in each first detection image, wherein the first detection image is an image based on a target detection model identifying that clothing of the target object does not meet a preset clothing wearing requirement, and the target detection model is a neural network model trained based on historical detection images;

[0053] A first processing module, used for determining a global eigenvalue of each first detection image, where the global eigenvalue is used to indicate a brightness distribution and a pixel complexity of the first detection image;

[0054] A first determination module is used to determine, based on all the first detection images, a first detection image whose global eigenvalue satisfies a preset eigenvalue range as a second detection image;

[0055] A second processing module is used to determine, for each second detection image, an edge area of ​​the second detection image and an overlapping area between the edge area and an image area where the target object in the second detection image is located based on a preset image edge index;

[0056] An analysis module, used to determine edge information of the second detection image according to the image area, the edge area and the overlapping area, wherein the edge information is used to indicate the degree of edge occlusion of the image area in the second detection image;

[0057] The second determination module is used to determine the target detection image according to the edge information of all the second detection images and the preset edge information requirement.

[0058] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;

[0059] Memory stores computer-executable instructions;

[0060] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0061] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0062] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0063] The clothing detection method, electronic device, storage medium and program product provided by the embodiments of the present application obtain multiple first detection images and the image area where the target object is located in each first detection image, wherein the first detection image is an image based on the target detection model that identifies that the clothing of the target object does not meet the preset clothing wearing requirements, and the target detection model is a neural network model trained based on historical detection images; for each first detection image, a global eigenvalue of the first detection image is determined, and the global eigenvalue is used to indicate the brightness distribution and pixel complexity of the first detection image; based on all the first detection images, a first detection image whose global eigenvalue meets the preset eigenvalue range is determined as a second detection image; for each second detection image, based on the preset image edge index, the edge of the second detection image is determined. region, and the overlapping region between the edge region and the image region where the target object is located in the second detection image; according to the image region, the edge region and the overlapping region, the edge information of the second detection image is determined, and the edge information is used to indicate the edge occlusion degree of the image region in the second detection image; according to the edge information of all the second detection images and the preset edge information requirements, the means of determining the target detection image is used, and the neural network model trained based on the historical detection images is used to identify the images that do not meet the preset clothing wearing requirements, and then through multi-level image screening and edge information analysis, the identified images are further screened, thereby improving the detection accuracy. At the same time, due to the simple model training and staged image processing, the computing resources and memory occupancy are small, and it can be adjusted according to different application scenarios to improve the generalization ability. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0065] Figure 1 A schematic diagram of a flow chart of a clothing detection method provided in this application;

[0066] Figure 2 A specific flow chart of a clothing detection method provided in this application;

[0067] Figure 3 A schematic diagram of the structure of an edge area and an overlapping area provided in this application;

[0068] Figure 4 A schematic diagram of the structure of a clothing detection device provided in this application;

[0069] Figure 5 A schematic diagram of the structure of the electronic device provided in this application.

[0070] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0071] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0072] In the prior art, in the field of video intelligent monitoring where there is a need for staff dress code detection, clothing detection methods usually start from the grid data features of the image, use methods such as deep neural networks to extract and integrate image features, and then use discrimination or classification algorithms to predict clothing. In order to cope with the impact of environmental changes and changes in personnel postures, a large amount of classified data under different conditions is usually required. These data have high labeling costs and are prone to overfitting, affecting recognition accuracy. Taking different colors of clothing as an example, training deep learning networks requires consideration of issues such as lighting, size, and shooting angles. Corresponding data collection and labeling for these attributes are more likely to occur when the amount of data is small, which affects the generalization performance of the algorithm. At the same time, these methods mostly use multi-model or multi-task learning, which results in the need for higher computing resources and larger memory usage in the actual deployment process, thereby increasing the deployment cost, which is not conducive to large-scale promotion and application in video intelligent monitoring scenarios with staff dress code detection needs in different scenarios.

[0073] In order to solve the above problems, the clothing detection method provided by the present application achieves the goal of reducing computing resources and memory usage while ensuring detection accuracy and improving generalization by optimizing the processing flow and focusing on key features. By using the target detection model to screen out images that do not meet the preset requirements, and then further screening by calculating the global eigenvalues, the number of images that require in-depth analysis is reduced, thereby reducing the computational burden. In the processing of the second detection image, the focus is on the extraction and analysis of edge information, especially the degree of edge occlusion. This way of focusing on key features reduces false detections caused by incomplete camera edges and ensures detection accuracy. In addition, the target detection model is trained based on historical detection images, so that it can effectively identify common improper clothing wearing patterns, enhancing the generalization ability of the model.

[0074] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0075] The execution subject of the clothing detection method provided in the embodiment of the present application can be a server. Among them, the server can be a mobile phone, a computer, a tablet and other devices. The embodiment of the present application does not impose any special restrictions on the implementation method of the execution subject, as long as the execution subject can obtain multiple first detection images and the image area where the target object is located in each first detection image, wherein the first detection image is an image based on the target detection model that the clothing of the target object does not meet the preset clothing wearing requirements, and the target detection model is a neural network model trained based on historical detection images; for each first detection image, determine the global eigenvalue of the first detection image, and the global eigenvalue is used to indicate the brightness distribution and pixel complexity of the first detection image; based on all the first detection images, determine the first detection image whose global eigenvalue meets the preset eigenvalue range as the second detection image; for each second detection image, based on the preset image edge index, determine the edge area of ​​the second detection image, and the overlapping area between the edge area and the image area where the target object is located in the second detection image; according to the image area, the edge area and the overlapping area, determine the edge information of the second detection image, and the edge information is used to indicate the edge occlusion degree of the image area in the second detection image; according to the edge information of all the second detection images and the preset edge information requirements, determine the target detection image.

[0076] Figure 1 This is a flow chart of a clothing detection method provided in this application. Figure 1 As shown, the method may include:

[0077] S101, obtaining multiple first detection images and an image area where a target object is located in each first detection image, wherein the first detection image is an image based on a target detection model that identifies that clothing of the target object does not meet preset clothing wearing requirements, and the target detection model is a neural network model trained based on historical detection images.

[0078] Among them, the target object can refer to the subject that needs to be detected and analyzed in the image, such as a person or body part, clothing or accessories, etc. For example, the overall image or specific parts such as the head of a chef or worker are detected to identify whether he is wearing a chef's uniform or a safety helmet, etc.; identify specific types of clothing, such as chef's uniform, workers' specific work clothes, or accessories such as gloves, shoes, etc., to determine whether they meet the wearing requirements. When the target detection model detects that the chef is not wearing a chef's uniform, the image becomes the first detection image.

[0079] The target detection model can be a lightweight neural network model trained based on historical detection images. Its lightweight design enables it to have a faster computing speed during operation, can quickly process a large amount of image data, reduce the cost of model training and algorithm deployment, and can run well on monitoring equipment with limited resources.

[0080] S102. For each first detection image, determine a global eigenvalue of the first detection image, where the global eigenvalue is used to indicate brightness distribution and pixel complexity of the first detection image.

[0081] Among them, the brightness distribution can help determine whether the image is under normal lighting, strong light, weak light or night vision conditions. The pixel complexity is related to the details, texture, color type, etc. of the objects in the image. Generally, if the image under weak light or night vision conditions has less feature information or too much noise, the pixel complexity may be too high or too low.

[0082] S103 . Based on all the first detection images, determine a first detection image whose global eigenvalue satisfies a preset eigenvalue range as a second detection image.

[0083] The preset feature value range may be a manually set numerical range or threshold condition, and by comparing the global feature value of the first detection image with the range, images that meet specific requirements may be screened out. For example, if it is set to the feature value range corresponding to normal lighting conditions, images under low light or night vision conditions may be screened out, and the second detection image is the first detection image remaining after the low light image or night vision image is screened out, thereby excluding images that may be misdetected due to special lighting (such as night vision).

[0084] Optionally, when there are multiple types of eigenvalues ​​in the global eigenvalues ​​of the first detection image, if the preset eigenvalue range is the eigenvalue range corresponding to normal lighting conditions, only one type of eigenvalue needs to satisfy the preset eigenvalue range to be regarded as the second detection image. When all eigenvalues ​​do not satisfy the range, it means that the probability that the image is a night vision image is very high and it needs to be screened out.

[0085] S104. For each second detection image, based on a preset image edge index, determine an edge region of the second detection image and an overlapping region between the edge region and an image region where the target object in the second detection image is located.

[0086] The preset image edge index may be a relevant parameter for determining the image edge region, and different combinations of indexes may determine the relationship between the image edge region and the image region where the target object is located from different angles.

[0087] S105. Determine edge information of the second detection image according to the image area, the edge area, and the overlapping area, where the edge information is used to indicate an edge occlusion degree of the image area in the second detection image.

[0088] The edge information may be represented by an edge occlusion ratio, such as the area of ​​the overlapping region divided by the area of ​​the target object image region.

[0089] S106: Determine a target detection image according to the edge information of all second detection images and a preset edge information requirement.

[0090] Among them, the preset edge information requirements can be the restriction conditions set about the edge information, such as stipulating that the edge occlusion ratio cannot exceed a certain threshold. If it exceeds, it is considered that the image may be a detection image identified because the target object is close to the edge of the image and the camera edge is incomplete, and further processing or exclusion is required. The remaining images are target detection images. The clothing detection results of the target objects in these target detection images are relatively more reliable and can be used for further analysis, recording or alarm operations.

[0091] Optionally, when there are multiple edge sub-information in the edge information of the second detection image, the multiple edge sub-information can be averaged and then judged against the preset edge information requirements; or each edge sub-information can be judged against the preset edge information requirements to determine the target detection image.

[0092] The clothing detection method provided in the embodiment of the present application automatically identifies images that do not meet the wearing requirements through a trained neural network model to ensure the accuracy of the initial screening; by calculating the global eigenvalue, further screen out images that meet the specific brightness and complexity requirements, avoiding the interference of false detections such as night vision images; focusing on the edge information of the image, accurately locating the edge area and its overlapping area with the target object through the preset edge index, further eliminating false detections caused by incomplete images due to camera edge shooting. This multi-level analysis not only improves the accuracy of detection, but also reduces the computing resources and memory usage by reducing unnecessary calculation steps, so that this method can help improve management efficiency and ensure the standardization and safety of the working environment, whether in the catering industry, food processing workshops or other scenarios with similar dress code detection requirements, and due to the lightweight design of the model, it can effectively reduce costs when deployed on a large scale, and improve the overall cost performance and practicality of the system.

[0093] On the basis of the above embodiment, the method described in S104 for determining the edge area of ​​the second detection image and the overlapping area between the edge area and the image area where the target object in the second detection image is located based on the preset image edge index may include:

[0094] Determine a first width value in the horizontal direction and a second width value in the vertical direction of the second detection image; multiply the first indicator in the preset image edge indicator by the first width value to obtain a third width value, and multiply the second indicator in the preset image edge indicator by the second width value to obtain a fourth width value; determine a single edge area in the horizontal direction of the second detection image according to the first width value and the fourth width value; determine a single edge area in the vertical direction of the second detection image according to the second width value and the third width value; generate an edge area of ​​the second detection image according to the single edge area in the horizontal direction and the single edge area in the vertical direction of the second detection image; determine an overlapping area between the edge area and an image area where a target object in the second detection image is located.

[0095] In this step, the first width value may refer to the size of the second detection image in the horizontal direction, such as the number of horizontal pixels or the horizontal width value of an image. The second width value may refer to the size of the second detection image in the vertical direction, that is, the number of vertical pixels or the vertical width value.

[0096] The first index may be a parameter in the preset image edge index, which is used to determine the ratio of the edge area to the image width in the horizontal direction. For example, if the first index is 0.1, it means that the width of the edge area in the horizontal direction is 10% of the horizontal width of the image.

[0097] The second index is also part of the preset image edge index, which is used to determine the proportional relationship between the edge area and the image height in the vertical direction. For example, the second index is 0.2, indicating that the width of the edge area in the vertical direction is 20% of the vertical height of the image.

[0098] The third width value may be obtained by multiplying the first indicator by the first width value, and determines the actual width of the edge area in the horizontal direction. The fourth width value may be obtained by multiplying the second indicator by the second width value, and is used to determine the actual width of the edge area in the vertical direction.

[0099] The single edge area in the horizontal direction is the edge area range in the horizontal direction determined based on the first width value and the fourth width value. It can be an area with a certain width from the upper or lower edge of the image, and the width is determined by the fourth width value. The single edge area in the vertical direction is the edge area range in the vertical direction determined based on the second width value and the third width value. It can be an area with a certain width from the left or right edge of the image, and the width is determined by the third width value.

[0100] Among them, the single edge regions in the horizontal direction and the vertical direction can be combined. A simple way is to extract the four edge regions (the upper, lower, left and right edge regions of the image) separately and then merge them into a complete edge region image. For example, first obtain the upper edge region, the lower edge region, the left edge region and the right edge region of the image separately, and then splice them together.

[0101] A method for determining the overlapping area can be to first determine the coordinate range of the target object image area, for example, the image area of ​​the target object is a rectangular area with the coordinates of the upper left corner (x1, y1) and the coordinates of the lower right corner (x2, y2); then determine whether the rectangular area has an intersection with the edge area; if there is an intersection, the overlapping area can be determined by calculating the coordinate range of the intersection.

[0102] It should be noted that the calculation method here is set based on a rectangular detection image as an example. If there is a circular or other polygonal image, the edge width of the image and the preset image edge index can be used to determine the annular area with a certain proportional radius from the center of the circle to the outside or the polygonal area scaled from the center of the polygon to each side as the edge area.

[0103] Through the calculation method based on image size and preset indicators, it can flexibly adapt to images of different sizes, whether it is a high-definition large-size image or a low-resolution small-size image, the edge area can be accurately determined. Secondly, accurately determining the overlapping area between the edge area and the target object area helps to more accurately evaluate the degree to which the target object is affected by the occlusion of the image edge. This is crucial to improving the accuracy of dress code detection, because in video surveillance, target objects close to the edge of the image may be inaccurately detected due to partial occlusion. This method can effectively identify and handle this situation. Furthermore, this method is relatively computationally efficient and does not require complex image feature matching or deep learning models to determine the edge area, which reduces the consumption of computing resources, allowing the entire dress code detection system to run stably on resource-limited devices, improving the practicality and scalability of the system.

[0104] Based on the above embodiment, the method for determining edge information of the second detection image according to the image area, the edge area and the overlapping area described in S105 may include:

[0105] Determine an overlapping sub-region between the image region and each single edge region in the overlapping region; if the overlapping region is smaller than the single edge region in the edge region, then for each overlapping sub-region, determine edge sub-information based on the overlapping sub-region and the image region; if the overlapping region is greater than or equal to the single edge region in the edge region, then for each overlapping sub-region, determine edge sub-information based on the overlapping sub-region and the single edge region in the edge region; wherein the edge information of the second detection image includes edge sub-information corresponding to each overlapping sub-region in the overlapping region.

[0106] Among them, the overlapping sub-region can refer to the part where the overlapping region intersects with each single edge region (i.e., the single edge region in the horizontal direction and the single edge region in the vertical direction). For example, when the image area overlaps with the left edge region of the image, this intersecting part is an overlapping sub-region, which is used to further subdivide the overlapping region so as to more accurately analyze the occlusion of the target object in different edge directions.

[0107] The edge sub-information may be information calculated based on the relationship between the overlapping sub-region and the image region or the single edge region in the edge region, and is used to describe the occlusion characteristics of the target object in a specific edge direction. For example, it may be information such as the occlusion ratio and occlusion area in a certain edge direction. Such information is combined to form the edge information of the second detection image, thereby comprehensively reflecting the edge occlusion degree of the target object image region.

[0108] In one example, when the overlapping area is smaller than all the single edge areas, the edge sub-information of each overlapping sub-area is obtained by the area calculation formula: each overlapping sub-area / image area;

[0109] However, as long as the image area is large enough, even if the image area occupies the entire single edge area or multiple single edge areas, the proportion of overlapping sub-areas / image area may be small, resulting in missed detection. Therefore, when the overlapping area is greater than or equal to a single edge area, the edge sub-information of each overlapping sub-area is obtained through the area calculation formula: each overlapping sub-area / (minimum or corresponding to the overlapping sub-area) single edge area.

[0110] By subdividing the overlapping area into overlapping sub-areas and calculating the edge sub-information according to different situations, the occlusion of the target object in different directions of the image edge can be analyzed more carefully, which helps to improve the accuracy of clothing detection of the target object; secondly, different calculation methods are used according to the size relationship between the overlapping area and the single edge area, so that the calculation of edge information is more reasonable and accurate. This adaptive calculation method can better reflect the actual degree of occlusion and avoid information bias caused by a unified calculation method. It is helpful for the subsequent screening and analysis of target detection images and can more effectively eliminate false detections caused by edge occlusion.

[0111] Based on the above embodiment, the method for determining the global feature value of the first detection image described in S102 may include:

[0112] Determine the brightness value of each pixel in the first detection image and the average brightness value of all pixels; determine the skewness and kurtosis of the first detection image in the brightness channel based on the brightness value of each pixel and the average brightness value; obtain the entropy value of the first detection image based on the gray level co-occurrence matrix; determine the global eigenvalue of the first detection image according to the average brightness value, the skewness and kurtosis of the brightness channel, and the entropy value.

[0113] Among them, Gray-level Co-occurrence Matrix (GLCM) is a second-order statistical method for analyzing image texture features. It constructs a matrix by counting the frequency of grayscale combinations of pixel pairs in a specific direction and at a specific distance in the image.

[0114] The average brightness value gives the overall brightness of the image, and the skewness and kurtosis further refine the characteristics of the brightness distribution. The average brightness value can satisfy:

[0115]

[0116] Wherein, W and H are the width and height of the first detection image respectively, and I(x, y) is the brightness value at the pixel position (x, y).

[0117] The skewness reflects the asymmetry of the brightness distribution relative to the mean. The skewness can satisfy:

[0118]

[0119] Where σ is the standard deviation of the brightness value.

[0120] The larger the kurtosis value, the higher the concentration of brightness values ​​around the average value, and the image may have more areas with similar brightness; the smaller the kurtosis value, the more dispersed the brightness distribution is. Kurtosis can satisfy:

[0121]

[0122] The entropy value reflects the complexity of the image texture. The fusion of this information enables the global eigenvalue to more accurately describe the characteristics of the image. The entropy value can satisfy:

[0123] Entropy=-∑ i,j p(i,j)·log(p(i,j));

[0124] Among them, p(i,j) is an element in the gray level co-occurrence matrix, which represents the number of occurrences of the gray value of the pixel point with gray value i in the horizontal direction adjacent to the gray value of j.

[0125] In one example, the global feature value may also include the channel mean and channel standard deviation. For multi-channel images, the performance of the image in different color channels can be further analyzed, which helps to more accurately judge the features of the image in images with multiple color elements. For example, in some scenes containing multi-color clothing and complex backgrounds, image features related to clothing detection can be better extracted. For grayscale images, the channel mean refers to the arithmetic mean of the grayscale values ​​of all pixels in the image, while the channel standard deviation is a statistic that measures the degree of discreteness of the grayscale values ​​of pixels in the grayscale image, which indicates the degree of dispersion of the pixel grayscale values ​​relative to the mean.

[0126] By comprehensively considering multiple parameters related to brightness values, the brightness distribution and texture information of the image can be fully described. This global eigenvalue calculation method of multi-dimensional feature fusion provides a more reliable basis for subsequent image screening according to the preset eigenvalue range, and can effectively distinguish images under different lighting conditions and different texture backgrounds, thereby reducing false detections caused by environmental factors.

[0127] Based on the above embodiment, before determining the brightness value of each pixel in the first detection image and the average brightness value of all pixels, the method may further include:

[0128] The first detection image is converted into a grayscale image; the grayscale image is denoised to obtain a denoised image; accordingly, when determining the brightness value of each pixel in the first detection image and the average brightness value of all pixels, the first detection image is a denoised image.

[0129] Among them, the grayscale image is a color image converted into an image containing only brightness information. The value of each pixel represents its brightness, making the image channel simpler and the calculation more convenient. Denoising can be performed using methods such as Gaussian filtering and median filtering. Gaussian filtering smoothes the image through convolution operations, while median filtering removes noise by replacing pixel values ​​with the median of neighboring pixels to improve calculation accuracy.

[0130] Grayscale processing reduces the complexity of the image, making subsequent brightness calculations more direct and efficient. De-noising improves the accuracy of brightness value calculations by eliminating random noise in the image, ensuring that the average brightness value more accurately reflects the overall brightness level of the image. This preprocessing step not only optimizes the use of computing resources, but also enhances the robustness and reliability of image analysis.

[0131] Since the first detection image identified by the target detection model may have false detection of images that meet the preset clothing requirements, such as a chef in a surveillance image wearing a chef's uniform, but the model identifies the image as a first detection image without the chef's uniform. Therefore, based on the above embodiment, the method may also include a color matching step of the image, that is, before or after determining the edge area check, the image with a high similarity to the actual clothing image of the target object is marked as a false detection image and screened out to reduce the false judgment of the target detection image due to the overfitting of the target detection model.

[0132] Therefore, before determining the edge area of ​​the second detection image and the overlapping area between the edge area and the image area where the target object is located in the second detection image based on the preset image edge index, the method may further include:

[0133] Determine the actual dressing image of the target object and the actual histogram of the actual dressing image; for each second detection image, normalize the second detection image to obtain a normalized histogram; determine the similarity between the second detection image and the actual dressing image according to the normalized histogram and the actual histogram; screen all the second detection images according to the similarity between all the second detection images and the actual dressing images and a preset image similarity condition; accordingly, when determining the edge area of ​​the second detection image and the overlapping area between the edge area and the image area where the target object is located in the second detection image based on a preset image edge indicator, the second detection image is a second detection image that meets the preset image similarity condition after the screening process.

[0134] The actual dress image may refer to a standard image of the target object that meets the dress code requirements, such as an image of a chef wearing a hat and work clothes in a restaurant kitchen. It can be used as a reference image to compare with the second detection image detected later to determine whether there is a false detection.

[0135] The actual histogram can be a statistical representation of the color distribution of pixels in the actual clothing image. The color space of the image (such as RGB color space) is divided into several intervals (usually called bins), and then the number of pixels in each interval is counted to form a histogram representing the color distribution frequency.

[0136] The similarity can be an indicator for measuring the similarity of color features between the second detection image and the actual clothing image, and can be calculated by a variety of methods, such as calculating the distance between two histograms (such as Bhattacharyya distance, chi-square distance, etc.), and the smaller the distance, the higher the similarity.

[0137] In one example, an inner product operation of the cross-correlation is performed on the actual histogram and the normalized histogram. The inner product operation here can be regarded as "sliding" the actual histogram on the normalized histogram, and calculating the sum of the products of the values ​​(y-axis coordinates) of the overlapping x-axis areas of the two histograms to obtain a similarity score.

[0138] The preset image similarity condition can be a similarity threshold or range set manually. When the similarity between the second detection image and the actual clothing image meets the condition, it is considered that the image meets the requirements in terms of color features, and subsequent edge area analysis can continue; if it does not meet the condition, it may be a false detection caused by a large color difference, and it will be filtered out. For example, setting a similarity greater than 0.8 as the preset image similarity condition means that when the similarity between the second detection image and the actual clothing image is greater than 0.8, the image is screened out through color matching, and the remaining second detection image is subjected to subsequent edge area analysis.

[0139] By comparing the color features with the actual clothing image, false detections caused by similar colors but actual clothing that does not meet the requirements can be effectively filtered out. The method of calculating similarity using histograms is relatively simple and efficient. It does not require complex image recognition models to perform detailed analysis of the image content, reduces the consumption of computing resources, and improves the detection speed. It is suitable for real-time processing of large amounts of image data in large-scale video surveillance scenarios.

[0140] Based on the above embodiment, a method for performing normalization processing on the second detection image to obtain a normalized histogram may include:

[0141] According to the width and height of the second detection image, the total number of pixels is determined; the color channels of the second detection image are separated to determine the pixel matrix of each color channel; according to the pixel matrix of each color channel and the total number of pixels, a normalized histogram is determined.

[0142] The total number of pixels refers to the total number of pixels contained in the second detection image, which is obtained by multiplying the width and height of the image and is used for subsequent calculation of the normalized histogram to ensure that the color distribution statistics can be presented in a relative proportion and is not affected by the image size difference. For example, an image with a width of 640 pixels and a height of 480 pixels has a total number of pixels of 640*480=307200 pixels.

[0143] In common digital image representations, color channels are used to describe different components of image color information. For example, in RGB color mode, an image contains three color channels: red, green, and blue. Each channel stores the pixel value of the corresponding color component separately. The combination of different channels presents a rich and colorful image color effect. Separating them helps to analyze the color distribution of the image in more detail.

[0144] For each color channel, its pixel value is stored and represented in the form of a matrix in the computer. In one example, for the pixel matrix of each color channel, it is necessary to determine the method of dividing the color interval, which is usually divided into several intervals according to the color value range (such as the value range of each RGB channel is 0-255), and then the number of pixels in each interval is counted to obtain the normal histogram of the color channel; then, the number of pixels in each interval is divided by the total number of pixels and converted into a relative proportion, so that the normalized histogram of each color channel is obtained.

[0145] The total number of pixels is determined by the image size, and the color channels are separated to obtain the pixel matrix to construct a normalized histogram. It does not require complex deep learning models or a large number of iterative operations. It can quickly complete the extraction and statistics of color features when processing images, reducing the requirements for hardware computing resources. The normalized histogram can well reflect the essential characteristics of the color distribution of the image and is not affected by the image size, making it more reasonable and accurate when performing subsequent color matching and comparison with actual clothing images.

[0146] Based on the above embodiment, after determining the target detection image according to the edge information of all the second detection images and the preset edge information requirement, the method may further include:

[0147] Determine the actual clothing image of the target object and the actual histogram of the actual clothing image; for each target detection image, normalize the target detection image to obtain a normalized histogram; determine the similarity between the target detection image and the actual clothing image based on the normalized histogram and the actual histogram; and screen all target detection images based on the similarity between all target detection images and the actual clothing images and a preset image similarity condition to obtain a screened target detection image.

[0148] This step is similar to the above-mentioned embodiment before determining the edge area of ​​the second detection image and the overlapping area between the edge area and the image area where the target object in the second detection image is located based on the preset image edge index, and will not be repeated here.

[0149] By comparing the color features with the actual clothing image, false detections caused by similar colors but actual clothing that does not meet the requirements can be effectively filtered out. At the same time, color matching is combined with previous global feature value screening, edge area analysis and other steps to form a multi-dimensional detection system. The clothing situation is comprehensively judged from multiple aspects such as image brightness, texture, color and edge occlusion, which improves the accuracy and reliability of dress code detection. Whether in the catering industry, manufacturing industry or other fields with strict requirements on personnel dress codes, it can better ensure the standardization and safety of the working environment and improve management efficiency and quality.

[0150] The following takes chef uniform testing as an example to explain the clothing testing method in detail. Figure 2 A specific flow chart of a clothing detection method provided in this application is as follows: Figure 2 As shown, the method may include:

[0151] S201: Input image.

[0152] The input image is an image captured by a fixed surveillance camera used to monitor a target object in the field of clothing detection.

[0153] S202: Target detection, extracting the candidate area of ​​chef uniform.

[0154] Among them, a lightweight target detection model is used to detect the chef who is not wearing the chef uniform, obtain several candidate images, and the location of the target object in the image is used as the candidate frame.

[0155] S203, night vision and low light verification.

[0156] Among them, night vision images usually have a higher frequency at lower brightness values ​​and a lower frequency at higher brightness values, because night vision images usually enhance dark details. And due to its imaging principle, night vision images usually have higher noise. Therefore, the night vision image is quickly judged by the statistical characteristics and energy characteristics of the picture, and its robust performance in indoor environments is higher. The judgment steps are as follows:

[0157] (1) converting the image obtained in S202 into a grayscale image, and applying Gaussian blur or median filter to reduce noise and improve the accuracy of subsequent feature extraction;

[0158] (2) Calculate the average brightness value L of all pixels in the image avg ;

[0159] (3) Construct the brightness and HSV histograms of the image, and calculate the skewness and kurtosis of the histogram;

[0160] (4) Noise extraction: Use GLCM to extract the entropy value of the image. The larger the entropy value, the more complex the pixel distribution in the image.

[0161] (5) Based on the above features, multiple thresholds are set for comprehensive judgment. If the average brightness of the image is low, the histogram skewness tends to be positive, the kurtosis is greater than a certain threshold, and the noise is also greater than a certain threshold, it is judged as a night vision image and the subsequent chef uniform analysis is skipped.

[0162] For example, the following parameter threshold settings may be used: Lavg < 50, histogram skewness > 1.0, kurtosis > 3.0, entropy > 0.5, V channel average < 100, V channel standard deviation < 20. Optionally, when all parameters of the image meet the threshold conditions, it is regarded as a night vision image.

[0163] S204: Perform color matching based on the chef uniform color specified by the user input.

[0164] In this step, the normalized histogram is calculated for the remaining images except the night vision image in S203. Specifically, the width of each detection result image is multiplied by the height to obtain the total number of pixels of the image; the color channels of the original color image are separated using a color space, such as using an RGB color space or a LAB color space; each color interval in the color histogram is traversed, and the pixel count of the interval is divided by the total number of pixels. In this way, a normalized histogram can be obtained, in which the value of each color interval represents the proportion of the color in the entire image.

[0165] Then, the inner product operation of the cross-correlation between the histogram of the user input and the histogram of the detection image is performed. The inner product operation here can be regarded as "sliding" the histogram of the user input on the histogram of the clothing image, and calculating the sum of the products of the values ​​(y-axis coordinates) of the overlapping x-axis areas of the two histograms. In this way, a similarity score can be obtained. The higher the score, the higher the degree of match between the color input by the user and the color of the clothing image.

[0166] In a certain embodiment, the color space is RGB, the color range is 0-255, and the interval of each histogram is set to 1. Then the cross-correlation of the two histograms needs to be calculated 256+255=511 times, which means the number of times the input histogram slides from the target histogram. In each calculation, the overlap of each overlapping histogram needs to be calculated.

[0167] Finally, use the similarity threshold for screening: for each result image, a similarity with the standard reference image can be calculated, and then a threshold is set, such as 0.8. Result images with a similarity greater than this are judged to be similar to the reference image and are removed from the reported results.

[0168] S205: Lens edge occlusion check.

[0169] This step is used to eliminate false detections caused by incomplete targets at the edge of the camera. By performing position and intersection-and-union operations on the “mouth” shape formed by the edge areas around the image, the candidate boxes for target detection that are too close to the edge of the image are counted to eliminate false detections caused by edge distortion and edge occlusion.

[0170] (1) Image edge area drawing: given thresholds p1 and p2 as the determination ratio range of the edge of the image, that is:

[0171] a. For the horizontal direction of the image, the distance between the left and right sides is less than p1×image width; b. For the horizontal direction of the image, the distance between the left and right sides is less than p2×image width; Figure 3 As shown in the shaded part, it is composed of four boxes and forms a "mouth" shape.

[0172] (2) Candidate detection box position determination: For each candidate detection box, the four corner points are determined. If any corner point is within the edge area, the next step is performed; otherwise, it is considered a non-edge target and the detection result is reported.

[0173] (3) For the candidate box obtained in the previous step, calculate the intersection-and-union ratio between it and the surrounding edges. The calculation formula for the intersection-and-union ratio is as follows:

[0174] For each edge and a candidate box, the calculation formula is:

[0175] When the candidate box overlap area is smaller than the single edge overlap area, IOUedge=candidate box and single edge overlap area / candidate box area; when the candidate box overlap area is greater than or equal to the single edge overlap area, IOUedge=candidate box and single edge overlap area / single edge area.

[0176] For a specified threshold, such as 0.5, if the average value of the intersection and union ratio of each edge in the candidate box is greater than the threshold, the candidate box is filtered out and no result is reported. Figure 3 As shown in the figure, the overlapping area occupies too much area of ​​candidate box 1, and the overlapping area of ​​candidate box 2 occupies more edge area. These candidate boxes will be excluded from the detection range as candidate targets at the edge. The purpose of this is to reduce edge occlusion while weakening the impact of edge distortion on candidate targets.

[0177] S206. Output the result.

[0178] The images retained after being screened through S202 to S205 are output for reporting or subsequent alarm processing.

[0179] The clothing detection method provided in the embodiment of the present application detects chef uniforms that are not worn through a lightweight target detection network to obtain several candidate targets, and then sequentially undergoes night vision and low light verification, color matching (implemented by user-specified reference images), and lens edge occlusion verification, and screens the input images through each processing step. Finally, the screened images are reported. This method adds post-processing modules such as color matching, night vision detection, and edge occlusion verification on the basis of a simple trained detection model. All of these are lightweight algorithms that can achieve faster computing speeds and higher robustness. The cost of model training and algorithm deployment is reduced. At the same time, the chef uniform detection computer system and storage medium generated based on this method have the characteristics of strong embeddability and low computing cost, which facilitates the rapid development of business scenarios such as stand-alone and server-side.

[0180] It should be noted that the clothing detection method provided in the embodiment of the present application, due to its lightweight characteristics, can be integrated with the existing program framework in the form of embedded code or SDK, and provide analysis of devices in stand-alone or high-concurrency scenarios. For example, it can be used as a header file or library file developed in C / C++ language, directly integrated with the source code of the existing application, and compiled into the relevant program. This situation is usually for stand-alone edge computing scenarios, such as embedded devices linked to single-channel cameras, or single-channel / multi-channel cameras sending data to a single computer through an acquisition card. It can also be used as part of the web server to analyze the massive surveillance cameras of the platform. In this example, the web server receives the analysis request from the client, allocates computing resources to the pushed pictures, and calls the algorithm interface for processing. The algorithm itself has no internal state, which is convenient for achieving high concurrency on multi-core CPUs or GPUs.

[0181] Figure 4 A schematic diagram of the structure of a clothing detection device provided in this application, such as Figure 4 As shown, the clothing detection device 40 provided in this embodiment includes:

[0182] An acquisition module 401 is used to acquire a plurality of first detection images and an image region where a target object is located in each first detection image, wherein the first detection image is an image based on a target detection model identifying that clothing of the target object does not meet a preset clothing wearing requirement, and the target detection model is a neural network model trained based on historical detection images;

[0183] A first processing module 402 is used to determine, for each first detection image, a global eigenvalue of the first detection image, where the global eigenvalue is used to indicate brightness distribution and pixel complexity of the first detection image;

[0184] A first determination module 403 is used to determine, based on all first detection images, a first detection image whose global eigenvalue satisfies a preset eigenvalue range as a second detection image;

[0185] A second processing module 404 is used to determine, for each second detection image, an edge region of the second detection image and an overlapping region between the edge region and an image region where the target object in the second detection image is located based on a preset image edge index;

[0186] An analysis module 405 is used to determine edge information of the second detection image according to the image area, the edge area and the overlapping area, where the edge information is used to indicate the degree of edge occlusion of the image area in the second detection image;

[0187] The second determination module 406 is used to determine the target detection image according to the edge information of all the second detection images and the preset edge information requirement.

[0188] In a possible implementation, the second processing module 404 may also be used to:

[0189] Determine a first width value of the second detection image in the horizontal direction and a second width value in the vertical direction;

[0190] Multiplying a first indicator in the preset image edge indicator and the first width value to obtain a third width value, and multiplying a second indicator in the preset image edge indicator and the second width value to obtain a fourth width value;

[0191] Determine a single edge area of ​​the second detection image in the horizontal direction according to the first width value and the fourth width value;

[0192] Determine a single edge area of ​​the second detection image in a vertical direction according to the second width value and the third width value;

[0193] Generate an edge region of the second detection image according to the single edge region in the horizontal direction and the single edge region in the vertical direction of the second detection image;

[0194] An overlapping area between the edge area and an image area where the target object is located in the second detection image is determined.

[0195] In a possible implementation, the analysis module 405 may also be used to:

[0196] determining an overlapping sub-region between the image region and each single edge region in the overlapping region;

[0197] If the overlapping area is smaller than the single edge area in the edge area, then for each overlapping sub-area, determining edge sub-information according to the overlapping sub-area and the image area;

[0198] If the overlapping area is greater than or equal to the single edge area in the edge area, then for each overlapping sub-area, determining edge sub-information according to the overlapping sub-area and the single edge area in the edge area;

[0199] The edge information of the second detection image includes edge sub-information corresponding to each overlapping sub-region in the overlapping region.

[0200] In a possible implementation, the first processing module 402 may also be used to:

[0201] Determine the brightness value of each pixel in the first detection image and the average brightness value of all pixels;

[0202] Determine the skewness and kurtosis of the first detection image in the brightness channel based on the brightness value and the average brightness value of each pixel;

[0203] Based on the gray level co-occurrence matrix, an entropy value of the first detection image is obtained;

[0204] The global eigenvalue of the first detection image is determined according to the average brightness value, the skewness and kurtosis of the brightness channel, and the entropy value.

[0205] In a possible implementation, the first processing module 402 may also be used to:

[0206] Converting the first detection image into a grayscale image;

[0207] De-noising the grayscale image to obtain a denoised image;

[0208] Accordingly,

[0209] When determining the brightness value of each pixel in the first detection image and the average brightness value of all pixels, the first detection image is a denoised image.

[0210] In a possible implementation, the second processing module 404 may also be used to:

[0211] Determining an actual dressed image of the target object and an actual histogram of the actual dressed image;

[0212] For each second detection image, normalize the second detection image to obtain a normalized histogram;

[0213] Determine the similarity between the second detection image and the actual clothing image according to the normalized histogram and the actual histogram;

[0214] Screening all the second detection images according to the similarity between all the second detection images and the actual clothing image and the preset image similarity condition;

[0215] Accordingly,

[0216] When determining the edge area of ​​the second detection image and the overlapping area between the edge area and the image area where the target object in the second detection image is located based on the preset image edge index, the second detection image is a second detection image that meets the preset image similarity condition after screening processing.

[0217] In a possible implementation, the second processing module 404 may also be used to:

[0218] Determine the total number of pixels according to the width and height of the second detection image;

[0219] Separating the color channels of the second detection image and determining a pixel matrix of each color channel;

[0220] Based on the pixel matrix of each color channel and the total number of pixels, a normalized histogram is determined.

[0221] In a possible implementation, the second determining module 406 may also be used to:

[0222] Determining an actual dressed image of the target object and an actual histogram of the actual dressed image;

[0223] For each target detection image, normalize the target detection image to obtain a normalized histogram;

[0224] Determine the similarity between the target detection image and the actual clothing image based on the normalized histogram and the actual histogram;

[0225] According to the similarity between all the target detection images and the actual clothing images and the preset image similarity condition, all the target detection images are screened to obtain the screened target detection images.

[0226] The clothing detection device provided in this embodiment can execute the method provided in the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.

[0227] Figure 5 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 5 As shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the device 50 also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus 504.

[0228] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above method.

[0229] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0230] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0231] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0232] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0233] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0234] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0235] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0236] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0237] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0238] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0239] 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.

[0240] If the function 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, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0241] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0242] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A clothing detection method, characterized in that: include: Acquire a plurality of first detection images and an image region where a target object is located in each first detection image, wherein the first detection image is an image based on a target detection model that identifies that clothing of the target object does not meet a preset clothing wearing requirement, and the target detection model is a neural network model trained based on historical detection images; For each first detection image, determine a global eigenvalue of the first detection image, where the global eigenvalue is used to indicate brightness distribution and pixel complexity of the first detection image; Based on all the first detection images, a first detection image whose global eigenvalue satisfies a preset eigenvalue range is determined as a second detection image; For each second detection image, based on a preset image edge index, determine an edge region of the second detection image and an overlapping region between the edge region and an image region where a target object in the second detection image is located; Determining edge information of the second detection image according to the image area, the edge area and the overlapping area, wherein the edge information is used to indicate an edge occlusion degree of an image area in the second detection image; The target detection image is determined according to the edge information of all the second detection images and the preset edge information requirement.

2. The method according to claim 1, characterized in that The determining, based on a preset image edge index, an edge region of the second detection image and an overlapping region between the edge region and an image region where a target object is located in the second detection image comprises: Determine a first width value of the second detection image in the horizontal direction and a second width value in the vertical direction; Multiplying a first indicator in the preset image edge indicator by the first width value to obtain a third width value, and multiplying a second indicator in the preset image edge indicator by the second width value to obtain a fourth width value; determining a single edge area of ​​the second detection image in a horizontal direction according to the first width value and the fourth width value; Determining a single edge area of ​​the second detection image in a vertical direction according to the second width value and the third width value; Generate an edge region of the second detection image according to a single edge region in the horizontal direction and a single edge region in the vertical direction of the second detection image; An overlapping area between the edge area and an image area where the target object is located in the second detection image is determined.

3. The method according to claim 2, characterized in that The step of determining edge information of the second detection image according to the image area, the edge area, and the overlapping area includes: Determine an overlapping sub-region between the image region and each single edge region in the overlapping region; If the overlapping area is smaller than a single edge area in the edge area, determining edge sub-information for each overlapping sub-area according to the overlapping sub-area and the image area; If the overlapping area is greater than or equal to the single edge area in the edge area, then for each overlapping sub-area, determining edge sub-information according to the overlapping sub-area and the single edge area in the edge area; The edge information of the second detection image includes edge sub-information corresponding to each overlapping sub-region in the overlapping region.

4. The method according to claim 1, characterized in that The determining of the global feature value of the first detection image comprises: Determine the brightness value of each pixel in the first detection image and the average brightness value of all pixels; Determine the skewness and kurtosis of the first detection image in a brightness channel based on the brightness value of each pixel and the average brightness value; Based on the gray level co-occurrence matrix, obtaining an entropy value of the first detection image; A global eigenvalue of the first detection image is determined according to the average brightness value, the skewness and kurtosis of the brightness channel, and the entropy value.

5. The method according to claim 4, characterized in that Before determining the brightness value of each pixel in the first detection image and the average brightness value of all pixels, the method further includes: Converting the first detection image into a grayscale image; Performing denoising on the grayscale image to obtain a denoised image; Accordingly, When determining the brightness value of each pixel in the first detection image and the average brightness value of all pixels, the first detection image is the denoised image.

6. The method according to claim 1, characterized in that Before determining the edge area of ​​the second detection image and the overlapping area between the edge area and the image area where the target object is located in the second detection image based on the preset image edge index, the method further includes: Determining an actual clothing image of the target object and an actual histogram of the actual clothing image; For each second detection image, normalize the second detection image to obtain a normalized histogram; Determining the similarity between the second detection image and the actual clothing image according to the normalized histogram and the actual histogram; Screening all the second detection images according to the similarity between all the second detection images and the actual clothing image and a preset image similarity condition; Accordingly, When determining the edge area of ​​the second detection image and the overlapping area between the edge area and the image area where the target object in the second detection image is located based on the preset image edge index, the second detection image is a second detection image that meets the preset image similarity condition after screening processing.

7. The method according to claim 6, characterized in that The step of normalizing the second detection image to obtain a normalized histogram includes: Determining the total number of pixels according to the width and height of the second detection image; Separating the color channels of the second detection image and determining a pixel matrix of each color channel; A normalized histogram is determined according to the pixel matrix of each color channel and the total number of pixels.

8. The method according to claim 1, characterized in that After determining the target detection image according to the edge information of all the second detection images and the preset edge information requirement, the method further includes: Determining an actual clothing image of the target object and an actual histogram of the actual clothing image; For each target detection image, normalizing the target detection image to obtain a normalized histogram; Determining the similarity between the target detection image and the actual clothing image according to the normalized histogram and the actual histogram; According to the similarity between all the target detection images and the actual clothing image and the preset image similarity condition, all the target detection images are screened to obtain screened target detection images.

9. A clothing detection device, characterized in that: include: An acquisition module, used to acquire a plurality of first detection images and an image region where a target object is located in each first detection image, wherein the first detection image is an image that indicates that clothing of the target object does not meet a preset clothing wearing requirement based on recognition by a target detection model, and the target detection model is a neural network model trained based on historical detection images; A first processing module, used for determining, for each first detection image, a global eigenvalue of the first detection image, wherein the global eigenvalue is used to indicate a brightness distribution and a pixel complexity of the first detection image; A first determination module is used to determine, based on all the first detection images, a first detection image whose global eigenvalue satisfies a preset eigenvalue range as a second detection image; A second processing module is used to determine, for each second detection image, an edge area of ​​the second detection image and an overlapping area between the edge area and an image area where the target object in the second detection image is located based on a preset image edge index; An analysis module, used to determine edge information of the second detection image according to the image area, the edge area and the overlapping area, wherein the edge information is used to indicate the degree of edge occlusion of the image area in the second detection image; The second determination module is used to determine the target detection image according to the edge information of all the second detection images and the preset edge information requirement.

10. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed by a processor.

12. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 8 when being executed by a processor.