Dressing standard monitoring method
By segmenting clothing using human body detection and image segmentation algorithms, filling in background pixels, and training a color recognition classifier, the problem of background interference within the human body bounding box is solved, improving the accuracy of clothing color recognition and the accuracy of monitoring results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-14
AI Technical Summary
The presence of a significant amount of background outside the clothing and pants within the human body frame affects the accuracy of clothing color classification, leading to inaccurate clothing monitoring results.
After target detection using a human body detection algorithm, the human body and clothing are segmented using an image segmentation algorithm. The bounding rectangle is then filled with background pixels to train a color recognition classifier. Finally, data augmentation technology is used to improve color recognition accuracy.
It improves the accuracy and precision of clothing color recognition, reduces background interference, and ensures the accuracy of clothing monitoring results.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image recognition technology, specifically relating to a method for monitoring dress code. Background Technology
[0002] Dress code monitoring uses image processing methods to identify clothing colors and triggers alarms when improper attire is detected. This method, primarily used in factories for monitoring work clothes and anti-static clothing, is an important practical application for safe production.
[0003] Patent application CN202011147308.0 discloses a method for comprehensively determining appropriate attire based on computer vision. This method uses human body recognition, clothing recognition, and face recognition algorithms to detect individuals in single-frame images captured by a camera. The results from these algorithms are then matched to determine whether the attire conforms to regulations. For individuals deemed improperly dressed, a human tracking algorithm is used for tracking and identification. Subsequent single-frame images captured by the camera continue to assess whether the tracked individuals are properly dressed. If a tracked individual is deemed improperly dressed five times consecutively, facial information matched by the face recognition algorithm is reported. This invention determines whether the tracked individual is properly dressed by judging whether the clothing frame and the human body frame match successfully. However, the presence of significant background outside the clothing frame within the human body frame can significantly affect clothing color classification, potentially impacting the accuracy of the final monitoring results.
[0004] The information disclosed in this background section is intended only to enhance the understanding of the overall background of the invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0005] The purpose of this invention is to provide a method for monitoring dress code, in order to solve the problem that the presence of a large amount of background outside the clothes and pants within the human body frame can have a significant impact on the classification of clothing colors.
[0006] To achieve the above objectives, the present invention provides the following technical solution: A method for monitoring dress code includes the following steps: S1, Label the clothing segmentation data; S2. Input the clothing segmentation data into the segmentation model and train the clothing segmentation data using an open-source image segmentation algorithm. S3. After performing target detection on the human body using a human body detection algorithm, perform image preprocessing on the human body detection bounding box. S4. Use a segmentation model to segment human clothing; S5. Take the bounding rectangle of the segmented clothes and pants, and fill the background with 255 pixels. S6. Use the data in S5 and its amplified data to train a color recognition classifier to recognize clothing colors; S7. Classify and identify the actual scene data to obtain monitoring results.
[0007] As a preferred embodiment, the image preprocessing of the human body detection bounding box in S3 includes the following steps: scaling the human body bounding box proportionally to 512*512 and filling the edges with 128 pixels.
[0008] As a preferred method, the process of extracting the bounding rectangle in S5 includes the following steps: First, traverse the pixels in S4 and extract the pixels corresponding to the clothes and pants; then, use the OpenCV function boundingRect to obtain the bounding rectangles of the clothes and pants respectively, and fill the background pixels with 255 white pixels.
[0009] As a preferred method, the data amplification method used in S6 is to perform random rotation and image mirroring operations from -15° to 15°, ultimately amplifying the data to three times its original value.
[0010] Compared with the prior art, the present invention has the following beneficial effects: (1) The dress code monitoring method of the present invention first detects the human body and then segments it, which greatly improves the segmentation accuracy; after segmentation, the background is filled with fixed pixels and then color recognition is performed, which can reduce the influence of the background and improve the color recognition accuracy.
[0011] (2) The dress code monitoring method of the present invention classifies and identifies eight common colors: red, orange, yellow, green, blue, purple, white and black. More colors can be added according to the needs of the scene, which greatly improves the accuracy of color recognition. Attached Figure Description
[0012] Figure 1 This is a flowchart of the technical processing of the present invention; Figure 2 This is a schematic diagram of the image after processing the human body frame according to an embodiment of the present invention; Figure 3 This is a schematic diagram of an image segmentation according to an embodiment of the present invention; Figure 4 This is a schematic diagram of an embodiment of the present invention after the image background is filled with 255 white pixels; Figure 5 This is a schematic diagram illustrating how a scene diagram is input to obtain the final monitoring result, according to an embodiment of the present invention. Detailed Implementation
[0013] The technical solution of this invention patent will be clearly and completely described below. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of this invention.
[0014] In the description of this invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention.
[0015] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0016] See attached document Figure 1-5 A method for monitoring dress code compliance includes the following steps: Step 1: Label the segmentation data for clothes and pants; Step 2: Train clothing segmentation data using an open-source image segmentation algorithm; Step 3: After performing target detection on the human body using a human detection algorithm such as YOLOv6, the human body bounding box is processed as follows: the human body bounding box is proportionally enlarged to a certain size. In this invention, the human body bounding box is proportionally scaled to 512*512, and the edges are filled with 128 pixels. The human body image after the above processing is shown in the attached figure. Figure 2 As shown; Step 4: If we directly use the image from step 3 for clothing color classification, the background outside the clothing and pants within the human body frame will significantly affect the classification. Therefore, the method of this invention uses the segmentation model trained in step 2 to segment the image from step 3. The results are shown in the appendix. Figure 3 ; Step 5: Obtain the bounding rectangles for the segmented clothing and pants. The method for obtaining the bounding rectangles is as follows: First, iterate through the four pixels and extract the corresponding pixels for the clothing and pants; then, use the OpenCV function `boundingRect` to obtain the bounding rectangles for the clothing and pants respectively, and fill the background pixels with 255 white pixels. This reduces the influence of the background, resulting in the image shown below. Figure 4 The image shown; Step 6: Train a color classifier using the data from Step 5 and its amplified data, and then classify and recognize real-world scene data. This invention classifies and recognizes eight common colors: red, orange, yellow, green, blue, purple, white, and black. More colors can be added as needed for different scenarios. The data amplification methods used in this invention include random rotation from -15° to 15° and image mirroring, ultimately amplifying the data to three times its original size, greatly improving the accuracy of color recognition. Step 7: The entire process uses a scene image as input, and finally obtains the monitoring results through human detection, human segmentation, and color recognition, as shown in the attached image. Figure 1 As shown.
[0017] The dress code monitoring method of this invention first detects the human body, then performs image transformation on the human body, and then uses an image segmentation algorithm to segment the human body's clothing and trousers, thereby performing human clothing analysis. This invention adopts a detection-then-segmentation approach, which has higher accuracy than full-image segmentation; finally, image classification is used to classify the segmented clothing and trousers by color, with accuracy far exceeding that of directly classifying clothing after detecting the human body.
[0018] The foregoing description of specific exemplary embodiments of the invention is for illustrative and explanatory purposes. These descriptions are not intended to limit the invention to the precise forms disclosed, and it will be apparent that many changes and variations can be made in accordance with the foregoing teachings. The exemplary embodiments were chosen and described in order to explain the specific principles of the invention and its practical application, thereby enabling those skilled in the art to implement and utilize various different exemplary embodiments of the invention, as well as various different choices and variations. The scope of the invention is intended to be defined by the claims and their equivalents.
Claims
1. A method for monitoring dress code compliance, characterized in that, Includes the following steps: S1, Label the clothing segmentation data; S2. Input the clothing segmentation data into the segmentation model and train the clothing segmentation data using an open-source image segmentation algorithm. S3. After performing target detection on the human body using a human body detection algorithm, perform image preprocessing on the human body detection bounding box. S4. Use a segmentation model to segment human clothing; S5. Take the bounding rectangle of the segmented clothes and pants, and fill the background with 255 pixels. S6. Use the data in S5 and its amplified data to train a color recognition classifier to recognize clothing colors; S7. Classify and identify the actual scene data to obtain monitoring results.
2. The dress code monitoring method according to claim 1, characterized in that, The image preprocessing for the human body detection bounding box in S3 includes the following steps: scaling the human body bounding box proportionally to 512*512 and filling the edges with 128 pixels.
3. The dress code monitoring method according to claim 1, characterized in that, The steps to extract the bounding rectangle in S5 are as follows: First, traverse the pixels in S4 and extract the pixels corresponding to the clothes and pants; then, use the OpenCV function boundingRect to obtain the bounding rectangles of the clothes and pants respectively, and fill the background pixels with 255 white pixels.
4. The dress code monitoring method according to claim 1, characterized in that, The data augmentation method used in S6 is to perform random rotations and image mirroring operations between -15° and 15°, ultimately augmenting the data to three times its original size.
Citation Information
Patent Citations
Method for comprehensively judging specified dressing based on computer vision
CN111967455A