Work Uniform Recognition Method, Device, Electronic Device and Storage Medium
By detecting the image face and body, determining the work clothes area and performing pixel value statistics and sign detection, the automatic recognition of the work clothes is realized, solving the problem of high manual review costs in the prior art, improving the recognition efficiency and reducing the cost.
Patent Information
- Application Number
- CN202111566352.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-20
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2041-12-20
AI Technical Summary
In the prior art, work clothes identification relies on manual audits, which have high time and labor costs, which cannot meet the current audit needs.
By performing face detection and/or human body detection on the image to be recognized, the target detection frame is determined, the area where the work clothes are located is determined according to the detection frame, the pixel values in the area are counted, and whether the preset proportional threshold is reached. If it is reached, the work clothes sign detection is carried out to determine the recognition result.
Automatic recognition of work clothes is realized, the recognition efficiency is improved, the recognition cost is reduced, and it is more efficient and economical than manual review.
Smart Images

Figure CN114387640B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular, to a work uniform recognition method, device, electronic device, and storage medium. Background Art
[0002] With the rapid development of China's economy and the rapid improvement of people's living standards, there has been a huge demand for improving the quality of life and domestic services. As a result, the domestic service industry has developed rapidly. The development of the domestic service industry is related to every family. The integration of the domestic service industry and the Internet helps to improve the development speed of the industry and the service efficiency of domestic workers. In order to create a scientific domestic service operation and management model, the domestic service platform needs to identify the work uniforms of the on-site service personnel to verify their identities and improve the service quality.
[0003] In the prior art, when performing work uniform recognition, the domestic service personnel upload personal self-taken photos, and the domestic service platform conducts manual review of the photos by operation review personnel. Manual review has certain time costs and labor costs and cannot meet the current review requirements. Summary of the Invention
[0004] Embodiments of the present invention provide a work uniform recognition method, device, electronic device, and storage medium, which help to improve the work uniform recognition efficiency and reduce costs.
[0005] In a first aspect, an embodiment of the present invention provides a work uniform recognition method, including:
[0006] Performing face detection and / or human body detection on the image to be recognized to obtain a target detection frame;
[0007] Determining the area where the work uniform is located according to the target detection frame;
[0008] Counting the pixel values in the area where the work uniform is located, and determining the proportion of the number of pixel points whose pixel values are within a preset pixel value range as a first proportion;
[0009] If the first proportion is greater than or equal to a first proportion threshold, performing work uniform logo detection on the area where the work uniform is located;
[0010] If the area where the work uniform is located includes a target work uniform logo, determining that the work uniform recognition is successful.
[0011] In a second aspect, an embodiment of the present invention provides a work uniform recognition device, including:
[0012] An image detection module, configured to perform face detection and / or human body detection on the image to be recognized to obtain a target detection frame;
[0013] The work uniform area determination module is used to determine the area where the work uniform is located according to the target detection frame;
[0014] The pixel value statistics module is used to count the pixel values within the area where the work uniform is located, and determine the proportion of the number of pixels whose pixel values are within a preset pixel value range as the first proportion;
[0015] The logo detection module is used to perform work uniform logo detection on the area where the work uniform is located if the first proportion is greater than or equal to the first proportion threshold;
[0016] The recognition result determination module is used to determine that the work uniform recognition is successful if the area where the work uniform is located includes the target work uniform logo.
[0017] In a third aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the steps of the work uniform recognition method described in the first aspect are implemented.
[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the work uniform recognition method described in the first aspect are implemented.
[0019] The work uniform recognition method, device, electronic device, and storage medium provided by the embodiments of the present invention perform face detection and / or human body detection on the image to be recognized to obtain a target detection frame, determine the area where the work uniform is located according to the target detection frame, count the pixel values within the area where the work uniform is located, determine the first proportion of the number of pixels whose pixel values are within a preset pixel value range. If the first proportion is greater than or equal to the first proportion threshold, determine to perform work uniform logo detection on the area where the work uniform is located. If the area where the work uniform is located includes the target work uniform logo, determine that the work uniform recognition is successful. After determining the area where the work uniform is located, through the judgment of pixel values and the detection of work uniform logos, the automatic recognition of work uniforms is realized, which improves the work uniform recognition efficiency and reduces the recognition cost compared with manual review. Description of the Drawings
[0020] Figure 1 is a flowchart of a work uniform recognition method provided by an embodiment of the present invention;
[0021] Figure 2 is a flowchart of another work uniform recognition method provided by an embodiment of the present invention;
[0022] Figure 3It is a schematic diagram of the target detection frame and the area where the work clothes are located when the second ratio is less than or equal to the second ratio threshold in the embodiments of the present invention;
[0023] Figure 4 It is a schematic diagram of the target detection frame and the area where the work clothes are located when the second ratio is greater than or equal to the third ratio threshold in the embodiments of the present invention;
[0024] Figure 5 It is a flowchart of another work clothes recognition method provided by the embodiments of the present invention;
[0025] Figure 6 It is a schematic structural diagram of a work clothes recognition device provided by the embodiments of the present invention. Detailed implementation manners
[0026] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0027] Figure 1 It is a flowchart of a work clothes recognition method provided by the embodiments of the present invention. This work clothes recognition method can be executed by a server or a computer. As Figure 1 shown, this work clothes recognition method includes:
[0028] Step 101: Perform face detection and / or human body detection on the image to be recognized to obtain a target detection frame.
[0029] When a domestic service personnel or other service personnel needs to perform work clothes recognition, the camera can be aimed at the person whose work clothes are to be recognized to take a photo, and the taken photo is uploaded to the server. The photo received by the server is the image to be recognized. Perform face detection and / or human body detection on the image to be recognized to determine whether the image to be recognized is a portrait photo. If a target detection frame including a face or a human body is obtained through the detection, it is determined that the image to be recognized is a portrait photo, and subsequent work clothes recognition can be performed. If it is determined through the detection that the image to be recognized does not include a face and a human body, it is determined that the image to be recognized is not a portrait photo, and subsequent detection steps are not executed.
[0030] Step 102: Determine the area where the work clothes are located according to the target detection frame.
[0031] Among them, the area where the work clothes are located is generally an area including the area where the upper garment is located.
[0032] When the target detection box is a face detection box, the area within a certain position range below the target detection box can be determined as the work uniform area based on the relationship between the face and the upper body. When the target detection box is a human body detection box, the human body detection box can be determined as the work uniform area, or the upper body area can be intercepted from the human body detection box based on the relationship between the human body and the upper body, and the intercepted upper body area can be determined as the work uniform area.
[0033] Step 103: Count the pixel values within the work uniform area, and determine the proportion of the number of pixels whose pixel values are within the preset pixel value range as the first proportion.
[0034] Among them, the preset pixel value range is the pixel value range corresponding to the preset color. For example, the preset color can be green, cyan, yellow, etc. The pixel value can be the pixel value in the HSV color space, which is convenient for counting pixel values by color. HSV (Hue, Saturation, Value) is a color space represented according to the intuitive characteristics of colors, also known as the Hexcone Model.
[0035] When the pixel values within the work uniform area are represented in RGB, convert the pixel values represented in RGB to HSV pixel values, so that the pixel values within the work uniform area can be counted by color, count the number of pixels whose pixel values are within the preset pixel value, and determine the proportion of the number of such pixels to the total number of pixels within the work uniform area. The proportion of the number of pixels whose pixel values are within the preset pixel value range is determined as the first proportion.
[0036] Step 104: If the first proportion is greater than or equal to the first proportion threshold, perform work uniform logo detection on the work uniform area.
[0037] Within the work uniform area, if the first proportion of the number of pixels whose pixel values are within the preset pixel value range is greater than or equal to the first proportion threshold, it is determined that the work uniform area includes the work uniform color. At this time, in order to determine whether the work uniform area is a work uniform, the work uniform area can be further subjected to work uniform logo detection to obtain the work uniform logo detection result, so as to determine whether the target work uniform logo is included in the work uniform area. The work uniform area can be subjected to work uniform logo recognition through a target detection model. Among them, the first proportion threshold can be set according to requirements, for example, it can be 0.3, etc.
[0038] If the first proportion of the number of pixels whose pixel values are within the preset pixel value range is less than the first proportion threshold, it is determined that the image to be recognized does not include a work uniform, that is, it is determined that the work uniform recognition fails.
[0039] In an embodiment of the present invention, the detection of work uniform signs in the area where the work uniform is located includes: inputting the area where the work uniform is located into a work uniform sign detection model, and performing work uniform sign detection on the area where the work uniform is located through the work uniform sign detection model to obtain a work uniform sign detection result, where the work uniform sign detection model is a deep learning model.
[0040] Among them, the work uniform sign detection model can be an object detection model, which is trained based on a large number of sample images including target work uniform sign annotations, and can detect one type of target work uniform sign or multiple types of target work uniform signs.
[0041] After determining the area where the work uniform is located, the area where the work uniform is located can be intercepted from the image to be recognized, the intercepted area where the work uniform is located is input into the work uniform sign detection model, and the work uniform sign detection model performs work uniform sign detection on the area where the work uniform is located, obtains the output of the work uniform sign detection model, and obtains a work uniform sign detection result. When the work uniform sign detection model can detect multiple types of target work uniform signs, the work uniform sign detection result can include the confidence corresponding to each specific type of target work uniform sign.
[0042] Step 105, if the area where the work uniform is located includes a target work uniform sign, it is determined that the work uniform recognition is successful.
[0043] According to the work uniform sign detection result, it is determined whether the area where the work uniform is located includes a target work uniform sign. If the confidence of the target work uniform sign in the area where the work uniform is located is greater than or equal to the confidence threshold, it is determined that the area where the work uniform is located includes a target work uniform sign. If the confidence of the target work uniform sign in the area where the work uniform is located is less than the confidence threshold, it is determined that the area where the work uniform is located does not include a target work uniform sign.
[0044] If the area where the work uniform is located includes a target work uniform sign, it is determined that the work uniform recognition is successful. If the area where the work uniform is located does not include a target work uniform sign, it is determined that the work uniform recognition fails.
[0045] The work uniform recognition method provided in this embodiment obtains a target detection frame by performing face detection and / or human body detection on the image to be recognized, determines the area where the work uniform is located according to the target detection frame, counts the pixel values within the area where the work uniform is located, and determines the first proportion of the number of pixels with pixel values within a preset pixel value range. If the first proportion is greater than or equal to the first proportion threshold, it is determined to perform work uniform logo detection on the area where the work uniform is located. If the area where the work uniform is located includes the target work uniform logo, it is determined that the work uniform recognition is successful. After determining the area where the work uniform is located, through the judgment of pixel values and the detection of work uniform logos, the automatic recognition of work uniforms is realized. Compared with manual review, the work uniform recognition efficiency is improved and the recognition cost is reduced.
[0046] Figure 2 It is a flowchart of another work uniform recognition method provided by an embodiment of the present invention. This work uniform recognition method can be executed by a server or a computer. As Figure 2 shown, this work uniform recognition method includes:
[0047] Step 201: Perform face detection on the image to be recognized, and determine the face detection frame as the target detection frame.
[0048] After obtaining the image to be recognized, use a face detector to perform face detection on the image to be recognized to determine whether the image to be recognized includes a face. When the image to be recognized includes a face, a face detection frame can be obtained through face detection. The maximum value principle can be followed to select the detected face detection frame, select the face detection frame with the largest face area, and determine the selected face detection frame as the target detection frame.
[0049] Step 202: Determine the proportion of the target detection frame in the image to be recognized as the second proportion.
[0050] The area of the target detection frame can be calculated, and the area of the image to be recognized can be calculated. Calculate the proportion of the area of the target detection frame to the area of the image to be recognized, and determine this proportion as the second proportion; or, the number of pixels of the target detection frame can also be calculated, and the number of pixels of the image to be recognized can be calculated. Determine the proportion of the number of pixels of the target detection frame to the number of pixels of the image to be recognized, and determine this proportion as the second proportion.
[0051] Step 203: Determine the area where the work uniform is located according to the second proportion and the target detection frame.
[0052] According to the second proportion, determine whether the image to be recognized is a headshot or a full-body photo, and then adopt different methods according to the relative position of the target detection frame coordinates to determine the area where the work uniform is located. The area where the work uniform is located generally refers to the area where the upper garment is located.
[0053] In one embodiment of the present invention, determining the area where the work clothes are located according to the second ratio and the target detection frame includes:
[0054] If the second ratio is less than or equal to the second ratio threshold, determine the upper boundary of the area where the work clothes are located according to the lower boundary and height of the target detection frame, determine the lower boundary of the area where the work clothes are located according to the upper boundary and the height, determine the left boundary of the area where the work clothes are located according to the left boundary and width of the target detection frame, and determine the right boundary of the area where the work clothes are located according to the right boundary and the width of the target detection frame;
[0055] If the second ratio is greater than or equal to the third ratio threshold, determine the upper boundary of the area where the work clothes are located according to the lower boundary and height of the target detection frame, determine the lower boundary of the area where the work clothes are located according to the height of the image to be recognized, determine the left boundary of the area where the work clothes are located according to the left boundary and width of the target detection frame, and determine the right boundary of the area where the work clothes are located according to the right boundary and the width of the target detection frame;
[0056] Wherein, the second ratio threshold is less than the third ratio threshold.
[0057] If the second ratio is less than or equal to the second ratio threshold, it can be determined that the image to be recognized is a full-body photo. As Figure 3 shown, at this time, according to the lower boundary and height of the target detection frame 1, determine the upper boundary of the area 2 where the work clothes are located. The determined upper boundary of the area 2 where the work clothes are located is y up = y_face bottom - 1 / 8 * H m , where y up is the upper boundary of the area where the work clothes are located, y_face bottom is the lower boundary of the target detection frame, and H m is the height of the target detection frame; according to the upper boundary of the area 2 where the work clothes are located and the height of the target detection frame 1, determine the lower boundary of the area 2 where the work clothes are located. The determined lower boundary of the area 2 where the work clothes are located is y bottom = y up + 2 * H m , where y bottom is the lower boundary of the area where the work clothes are located; according to the left boundary of the target detection frame 1 and the width of the target detection frame 1, determine the left boundary of the area 2 where the work clothes are located. The determined left boundary of the area 2 where the work clothes are located is x left = x_face left - W m / 2, where x 1eft is the left boundary of the area where the work clothes are located, and x_face leftis the left boundary of the target detection box, W m is the width of the target detection box; determine the right boundary of the work uniform area 2 based on the right boundary and the width of the target detection box 1, and the determined right boundary of the work uniform area 2 is x right = x_face right + W m / 2, where x right is the right boundary of the work uniform area, x_face right is the right boundary of the target detection box. Among them, the second ratio threshold can be 0.1 for example.
[0058] If the second ratio is greater than or equal to the third ratio threshold, it can be determined that the image to be recognized is a headshot. As Figure 4 shown, at this time, the upper boundary of the work uniform area 2 can be determined according to the lower boundary and the height of the target detection box 1, and the determined upper boundary of the work uniform area 2 is y up = y_face bottom - 1 / 8 * H m , where y up is the upper boundary of the work uniform area, y_face bottom is the lower boundary of the target detection box, H m is the height of the target detection box; since the image to be recognized is a headshot, in order to avoid the inaccurate detection situation where only the collar part is captured in the image to be recognized, the lower boundary of the work uniform area 2 can be determined according to the height of the image to be recognized. For example, the lower boundary of the image to be recognized can be determined as the lower boundary of the work uniform area. In order to improve the detection accuracy, the lower boundary of the work uniform area can be determined as y bottom = H - 1, where y bottom is the lower boundary of the work uniform area, H is the height of the image to be recognized; determine the left boundary of the work uniform area according to the left boundary and the width of the target detection box 1, and the determined left boundary of the work uniform area is x left = x_face left - W m / 2, where x left is the left boundary of the work uniform area, x_face left is the left boundary of the target detection box, W m is the width of the target detection box; determine the right boundary of the work uniform area according to the right boundary and the width of the target detection box 1, and the determined right boundary of the work uniform area is x right = x_face right + W m / 2, where x right is the right boundary of the work uniform area, x_faceright is the right boundary of the target detection box. If the left boundary of the area where the work clothes are located, calculated, exceeds the left boundary of the image to be recognized, then the left boundary of the image to be recognized is determined as the left boundary of the area where the work clothes are located; if the right boundary of the area where the work clothes are located, calculated, exceeds the right boundary of the image to be recognized, then the right boundary of the image to be recognized is determined as the right boundary of the area where the work clothes are located.
[0059] By classifying different situations based on the comparison of the second ratio with the second ratio threshold and the third ratio threshold to determine the area where the work clothes are located, the accuracy of the determined area where the work clothes are located can be improved, and further the accuracy of the work clothes recognition result can be improved.
[0060] In an embodiment of the present invention, after performing face detection on the image to be recognized, it further includes: if no face is detected, then performing human body detection on the image to be recognized, and determining the human body detection box as the target detection box;
[0061] The determining the area where the work clothes are located according to the target detection box includes: determining the target detection box as the area where the work clothes are located.
[0062] When performing face detection on the image to be recognized, if no face is detected, the image to be recognized may be an image obtained by a person wearing work clothes taking a photo with their back to the camera. At this time, human body detection can be performed on the image to be recognized again to determine whether the image to be recognized is a portrait photo. If it is determined through human body detection that the image to be recognized does not include a human body, then it is determined that the image to be recognized is not a portrait photo, and the recognition of work clothes is no longer performed. If it is determined through human body detection that the image to be recognized includes a human body, that is, the human body detection box is obtained, then the human body detection box is determined as the target detection box. When determining the area where the work clothes are located, the entire target detection box can be determined as the area where the work clothes are located.
[0063] By further performing human body detection on the image to be recognized when no face is detected, and determining the area where the work clothes are located based on the human body detection result, and then performing work clothes recognition, the problem that work clothes cannot be recognized when no face is captured in the image to be recognized can be avoided, and the accuracy of work clothes recognition can be improved.
[0064] Step 204, statistically analyze the pixel values within the area where the work clothes are located, and determine the proportion of the number of pixels whose pixel values are within a preset pixel value range as the first ratio.
[0065] Step 205, if the first ratio is greater than or equal to the first ratio threshold, then perform work clothes logo detection on the area where the work clothes are located.
[0066] It should be noted that when the target detection box is a face detection box and a human body detection box, the first ratio threshold is different. The first ratio threshold when the target detection box is a face detection box is greater than the first ratio threshold when the target detection box is a human body detection box, because the area where the work clothes are located determined based on the face detection box is the area where the upper garment is located, while the area where the work clothes are located determined based on the human body detection box is the area of the entire human body, and the proportion of the area where the upper garment is located in the area of the entire human body is relatively small.
[0067] Step 206, if the area where the work clothes are located includes the target work clothes logo, it is determined that the work clothes are successfully recognized.
[0068] The work clothes recognition method provided in this embodiment performs face detection on the image to be recognized. When a face is detected, the face detection box is determined as the target detection box, and the second ratio of the target detection box in the image to be recognized is determined. According to the second ratio and the target detection box, the area where the work clothes are located is determined. When no face is detected, the image to be recognized can also be subjected to human body detection, and the human body detection box is determined as the area where the work clothes are located, so as to judge the color value and detect the work clothes logo based on the area where the work clothes are located, realizing the automatic recognition of work clothes, improving the work clothes recognition efficiency, and being able to adapt to different scenarios and changes in different image scales, with strong recognition robustness.
[0069] Figure 5 It is a flowchart of another work clothes recognition method provided by an embodiment of the present invention. This work clothes recognition method can be executed by a server or a computer, as Figure 5 shown. This work clothes recognition method includes:
[0070] Step 501, perform human body detection on the image to be recognized, and determine the human body detection box as the target detection box.
[0071] Perform human body detection on the image to be recognized to determine whether the image to be recognized is a portrait photo. If it is determined through human body detection that the image to be recognized does not include a human body, it is determined that the image to be recognized is not a portrait photo, and the recognition of work clothes is no longer performed. If it is determined through human body detection that the image to be recognized includes a human body, that is, the human body detection box is obtained, then the human body detection box is determined as the target detection box. A human body detection model can be used to perform human body detection on the image to be recognized.
[0072] Step 502, determine the target detection box as the area where the work clothes are located.
[0073] When determining the area where the work clothes are located, the entire target detection box can be determined as the area where the work clothes are located.
[0074] Step 503: Statistically analyze the pixel values within the area where the work uniform is located, and determine the proportion of the number of pixels whose pixel values fall within a preset pixel value range as the first proportion.
[0075] Step 504: If the first proportion is greater than or equal to the first proportion threshold, perform work uniform logo detection on the area where the work uniform is located.
[0076] Step 505: If the area where the work uniform is located includes the target work uniform logo, determine that the work uniform recognition is successful.
[0077] The work uniform recognition method provided in this embodiment realizes the automatic recognition of the work uniform by performing human body detection on the image to be recognized, determining the human body detection frame as the area where the work uniform is located, and then judging the color and recognizing the work uniform logo in the area where the work uniform is located, improving the recognition efficiency of the work uniform and reducing the recognition cost.
[0078] Figure 6 It is a schematic structural diagram of a work uniform recognition device provided by an embodiment of the present invention. As Figure 6 shown, the work uniform recognition device includes:
[0079] An image detection module 601, configured to perform face detection and / or human body detection on the image to be recognized to obtain a target detection frame;
[0080] A work uniform area determination module 602, configured to determine the area where the work uniform is located according to the target detection frame;
[0081] A pixel value statistics module 603, configured to statistically analyze the pixel values within the area where the work uniform is located, and determine the proportion of the number of pixels whose pixel values fall within a preset pixel value range as the first proportion;
[0082] A logo detection module 604, configured to perform work uniform logo detection on the area where the work uniform is located if the first proportion is greater than or equal to the first proportion threshold;
[0083] An identification result determination module 605, configured to determine that the work uniform recognition is successful if the area where the work uniform is located includes the target work uniform logo.
[0084] Optionally, the image detection module includes:
[0085] A face detection unit, configured to perform face detection on the image to be recognized and determine the face detection frame as the target detection frame;
[0086] The work uniform area determination module includes:
[0087] A second ratio determination unit, configured to determine the ratio of the target detection frame in the image to be recognized as the second ratio;
[0088] A first work uniform area determination unit, configured to determine the area where the work uniform is located according to the second ratio and the target detection frame.
[0089] Optionally, the first work uniform area determination unit is specifically configured to:
[0090] If the second ratio is less than or equal to a second ratio threshold, determine the upper boundary of the area where the work uniform is located according to the lower boundary and height of the target detection frame, determine the lower boundary of the area where the work uniform is located according to the upper boundary and the height, determine the left boundary of the area where the work uniform is located according to the left boundary and width of the target detection frame, and determine the right boundary of the area where the work uniform is located according to the right boundary and the width of the target detection frame;
[0091] If the second ratio is greater than or equal to a third ratio threshold, determine the upper boundary of the area where the work uniform is located according to the lower boundary and height of the target detection frame, determine the lower boundary of the area where the work uniform is located according to the height of the image to be recognized, determine the left boundary of the area where the work uniform is located according to the left boundary and width of the target detection frame, and determine the right boundary of the area where the work uniform is located according to the right boundary and the width of the target detection frame;
[0092] Wherein, the second ratio threshold is less than the third ratio threshold.
[0093] Optionally, the image detection module further includes:
[0094] A first human body detection unit, configured to perform human body detection on the image to be recognized if no face is detected after face detection on the image to be recognized, and determine the human body detection frame as the target detection frame;
[0095] The work uniform area determination module includes:
[0096] A second work uniform area determination unit, configured to determine the target detection frame as the area where the work uniform is located.
[0097] Optionally, the image detection module includes:
[0098] A second human body detection unit, configured to perform human body detection on the image to be recognized and determine the human body detection frame as the target detection frame;
[0099] The work uniform area determination module includes:
[0100] The third work uniform area determination unit is configured to determine the target detection frame as the area where the work uniform is located.
[0101] Optionally, the logo detection module is specifically configured to:
[0102] Input the area where the work uniform is located into the work uniform logo detection model, and perform work uniform logo detection on the area where the work uniform is located through the work uniform logo detection model to obtain a work uniform logo detection result. The work uniform logo detection model is a deep learning model.
[0103] The work uniform recognition device provided by the embodiments of the present invention is used to implement each step of the work uniform recognition method described in the embodiments of the present invention. For the specific implementation manners of the modules of the device, refer to the corresponding steps and will not be elaborated here.
[0104] The work uniform recognition device provided in this embodiment obtains a target detection frame by performing face detection and / or human body detection on the image to be recognized, determines the area where the work uniform is located according to the target detection frame, counts the pixel values in the area where the work uniform is located, and determines the first proportion of the number of pixels whose pixel values are within a preset pixel value range. If the first proportion is greater than or equal to the first proportion threshold, it is determined that the area where the work uniform is located is subjected to work uniform logo detection. If the area where the work uniform is located includes the target work uniform logo, it is determined that the work uniform recognition is successful. After determining the area where the work uniform is located, through the judgment of pixel values and the detection of work uniform logos, the automatic recognition of work uniforms is realized. Compared with manual review, the work uniform recognition efficiency is improved and the recognition cost is reduced.
[0105] Preferably, an electronic device is further provided in the embodiments of the present invention, including: a processor, a memory, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, it implements each process of the above-mentioned work uniform recognition method embodiment and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0106] The embodiments of the present invention further provide a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by the processor, it implements each process of the above-mentioned work uniform recognition method embodiment and can achieve the same technical effect. To avoid repetition, it will not be elaborated here. Among them, the computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc.
[0107] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "including a..." does not exclude the presence of additional identical elements in the process, method, article or device including such element.
[0108] From the description of the above embodiments, those skilled in the art can clearly understand that the above-described method of the embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc) and includes several instructions for causing a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0109] The embodiments of the present invention have been described above in conjunction with the accompanying drawings. However, the present invention is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the spirit and scope protected by the present invention and the claims, and all of them belong to the protection scope of the present invention.
[0110] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in connection with the embodiments disclosed in the embodiments of the present invention can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0111] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described systems, devices and units can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0112] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.
[0113] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0114] In addition, in each embodiment of the present invention, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0115] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical discs that can store program codes.
[0116] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A work uniform recognition method, characterized in that, it includes: Performing face detection and / or human body detection on the image to be recognized to obtain a target detection frame; Determining the area where the work uniform is located according to a second ratio and the target detection frame, where the second ratio is the ratio of the area of the target detection frame to the area of the image to be recognized, or the ratio of the number of pixels of the target detection frame to the number of pixels of the image to be recognized; Counting the pixel values within the area where the work uniform is located, and determining the ratio of the number of pixels whose pixel values are within a preset pixel value range as a first ratio, where the preset pixel value range refers to the pixel value range corresponding to a preset color; If the first ratio is greater than or equal to a first ratio threshold, then performing work uniform logo detection on the area where the work uniform is located, where the work uniform logo detection is performed by inputting the area where the work uniform is located into a work uniform logo detection model, the work uniform logo detection model is a deep learning model, and the output result of the work uniform logo detection model includes the confidence level corresponding to each target work uniform logo; If the area where the work uniform is located includes a target work uniform logo, it is determined that the work uniform recognition is successful; Wherein, the upper boundary of the area where the work uniform is located is determined according to the lower boundary and height of the target detection frame. When the second ratio is less than or equal to a second ratio threshold, the lower boundary of the area where the work uniform is located is determined according to the upper boundary and the height. When the second ratio is greater than or equal to a third ratio threshold, the lower boundary of the area where the work uniform is located is determined according to the height of the image to be recognized, and the second ratio threshold is less than the third ratio threshold.
2. The method according to claim 1, characterized in that, the performing face detection and / or human body detection on the image to be recognized to obtain a target detection frame includes: Performing face detection on the image to be recognized and determining the face detection frame as the target detection frame; the determining the area where the work uniform is located according to the target detection frame includes: Determining the ratio of the target detection frame in the image to be recognized as a second ratio; Determining the area where the work uniform is located according to the second ratio and the target detection frame.
3. The method according to claim 2, characterized in that, the determining the area where the work uniform is located according to the second ratio and the target detection frame includes: If the second ratio is less than or equal to a second ratio threshold, then determining the upper boundary of the area where the work uniform is located according to the lower boundary and height of the target detection frame, determining the lower boundary of the area where the work uniform is located according to the upper boundary and the height, determining the left boundary of the area where the work uniform is located according to the left boundary and width of the target detection frame, and determining the right boundary of the area where the work uniform is located according to the right boundary and the width of the target detection frame; If the second ratio is greater than or equal to the third ratio threshold, determine the upper boundary of the area where the work clothes are located according to the lower boundary and height of the target detection frame, determine the lower boundary of the area where the work clothes are located according to the height of the image to be recognized, determine the left boundary of the area where the work clothes are located according to the left boundary and width of the target detection frame, and determine the right boundary of the area where the work clothes are located according to the right boundary of the target detection frame and the width; Wherein, the second ratio threshold is less than the third ratio threshold.
4. The method according to claim 2, characterized in that, after performing face detection on the image to be recognized, further comprising: if no face is detected, perform human body detection on the image to be recognized, and determine the human body detection frame as the target detection frame; The determining the area where the work clothes are located according to the target detection frame includes: determining the target detection frame as the area where the work clothes are located.
5. The method according to claim 1, characterized in that, the performing face detection and / or human body detection on the image to be recognized to obtain a target detection frame includes: performing human body detection on the image to be recognized, and determining the human body detection frame as the target detection frame; The determining the area where the work clothes are located according to the target detection frame includes: determining the target detection frame as the area where the work clothes are located.
6. The method according to any one of claims 1-5, characterized in that, the performing work clothes logo detection on the area where the work clothes are located includes: inputting the area where the work clothes are located into a work clothes logo detection model, and performing work clothes logo detection on the area where the work clothes are located through the work clothes logo detection model to obtain a work clothes logo detection result, and the work clothes logo detection model is a deep learning model.
7. A work clothes recognition device, characterized in that, comprising: an image detection module, configured to perform face detection and / or human body detection on an image to be recognized to obtain a target detection frame; a work clothes area determination module, configured to determine the area where the work clothes are located according to a second ratio and the target detection frame, where the second ratio is the ratio of the area of the target detection frame to the area of the image to be recognized, or the ratio of the number of pixels of the target detection frame to the number of pixels of the image to be recognized; a pixel value statistics module, configured to count the pixel values within the area where the work clothes are located, and determine the proportion of the number of pixels whose pixel values are within a preset pixel value range as a first ratio, where the preset pixel value range refers to the pixel value range corresponding to a preset color; a logo detection module, configured to perform work clothes logo detection on the area where the work clothes are located if the first ratio is greater than or equal to a first ratio threshold, where the work clothes logo detection is performed by inputting the area where the work clothes are located into a work clothes logo detection model, the work clothes logo detection model is a deep learning model, and the output result of the work clothes logo detection model includes the confidence level corresponding to each target work clothes logo; a recognition result determination module, configured to determine that the work clothes recognition is successful if the area where the work clothes are located includes a target work clothes logo; Among them, the upper boundary of the area where the work clothes are located is determined according to the lower boundary and height of the target detection frame. When the second ratio is less than or equal to the second ratio threshold, the lower boundary of the area where the work clothes are located is determined according to the upper boundary and the height. When the second ratio is greater than or equal to the third ratio threshold, the lower boundary of the area where the work clothes are located is determined according to the height of the image to be recognized. The second ratio threshold is less than the third ratio threshold.
8. The device according to claim 7, wherein, the image detection module includes: a face detection unit, configured to perform face detection on the image to be recognized and determine the face detection frame as the target detection frame; the work clothes area determination module includes: a second ratio determination unit, configured to determine the ratio of the target detection frame in the image to be recognized as the second ratio; a first work clothes area determination unit, configured to determine the area where the work clothes are located according to the second ratio and the target detection frame.
9. An electronic device, wherein, it includes: a processor, a memory, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the steps of the work clothes recognition method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium, wherein, a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps of the work clothes recognition method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Uniform wearing identification method for power construction site staff
CN106778609A
Automatic identification method and alarm system for wearing state of work clothes and hats based on video
CN109117827A