Work clothes wearing identification method and device, electronic equipment and storage medium
By detecting key points in surveillance images and extracting images of the torso and upper limbs, and using re-identification features to identify work clothes, the problem of high equipment consumption and high false detection rate in existing technologies is solved, achieving more efficient and accurate work clothes identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies that segment operators into different parts using segmentation networks to identify work clothes consume significant equipment resources and lack the ability to resist interference from fixed-position occlusion, resulting in a high false detection rate.
A key point detection model is used to detect key points in the upper body region of surveillance images, and images of the torso and upper limb regions are extracted. Re-identification features are used to determine whether work clothes are worn, thus avoiding the use of segmentation networks.
It improves recognition accuracy, reduces equipment performance consumption, and reduces false detection rate, especially its anti-interference ability against fixed-position occlusion of work clothes in special scenarios.
Smart Images

Figure CN121640508A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a workwear wearing recognition method and device, electronic equipment and a storage medium. BACKGROUND
[0002] With the continuous development of the chemical industry, the safety problem of the chemical industry is also concerned, especially the safety problem of the operating personnel in the production workshop of the chemical industry is more concerned. For the safety protection of the operating personnel, the operating personnel generally need to wear workwear during work to protect safety, thereby reducing safety accidents. Therefore, in the actual production process, it is particularly important to identify whether the operating personnel wear workwear.
[0003] In related technologies, the whole body of the operating personnel is first imaged, and then each part of the operating personnel is segmented in the collected image through a segmentation network, and then the torso part is found from each part, and whether the torso part wears workwear is identified to determine whether the operating personnel wear workwear.
[0004] However, the above technology has the problem of large performance consumption of the device. SUMMARY
[0005] The present application provides a workwear wearing recognition method, device, electronic equipment and storage medium to solve the defect that the performance consumption of the device is large in the prior art by segmenting each part of the operating personnel through a segmentation network, and then obtaining the torso part to identify whether the operating personnel wear workwear. The present application realizes that the torso region image and the upper limb region image are intercepted in the monitoring image by detecting the key points, and the wearing of workwear is determined by the re-identification features of the intercepted images, without using a segmentation network to segment each part, so as to reduce the performance consumption of the device.
[0006] The present application provides a workwear wearing recognition method, comprising: obtaining a monitoring image corresponding to a to-be-recognized object; the monitoring image comprises an upper body region of the to-be-recognized object, and the upper body region comprises a torso region and an upper limb region; detecting key points of the upper body region in the monitoring image by using a preset key point detection model to determine at least two key points corresponding to the upper body region; the key point detection model is obtained by training a first training image based on a plurality of labeled key points; According to the position information of the at least two key points, a first target region image corresponding to the torso region and a second target region image corresponding to the upper limb region are intercepted in the monitoring image; According to the first target region image and the second target region image, a target recognition result of the to-be-recognized object is determined; the target recognition result includes whether the to-be-recognized object wears a work uniform or not.
[0007] According to the method for identifying work uniform wearing provided by the application, the second target region image corresponding to the upper limb region is intercepted in the monitoring image according to the position information of the at least two key points, which comprises: For any sub-region in the upper limb region, two key points corresponding to any sub-region in the at least two key points are connected to obtain the center line of any sub-region; According to the position information of the center line, an outer rectangle including the center line is determined, and the image of the region corresponding to the outer rectangle in the monitoring image is subjected to edge detection processing to determine at least one candidate edge line; According to the candidate edge line and the center line, the region corresponding to any sub-region in the monitoring image is determined, and the image of the region corresponding to any sub-region is intercepted in the monitoring image to obtain the second target region image corresponding to any sub-region.
[0008] According to the method for identifying work uniform wearing provided by the application, the image of the region corresponding to the outer rectangle in the monitoring image is subjected to edge detection processing to determine at least one candidate edge line, which comprises: The image of the region corresponding to the outer rectangle in the monitoring image is subjected to edge detection processing to obtain a plurality of undetermined edge lines; The first included angle between the center line and the target axis is calculated, and the second included angle between the plurality of undetermined edge lines and the target axis is calculated; According to the first included angle and the second included angle, the plurality of undetermined edge lines are subjected to screening processing to determine at least one candidate edge line.
[0009] According to the method for identifying work uniform wearing provided by the application, the second included angle between the plurality of undetermined edge lines and the target axis is calculated, which comprises: Each undetermined edge line is divided into a plurality of line segments, and the second included angle between the tangent of each segment of each undetermined edge line and the target axis is calculated to obtain a plurality of second included angles corresponding to each undetermined edge line; According to the first included angle and the second included angle, the plurality of undetermined edge lines are subjected to screening processing to determine at least one candidate edge line, which comprises: For each undetermined edge line, the difference between the plurality of second included angles of the undetermined edge line and the first included angle is calculated to obtain a plurality of second differences corresponding to the undetermined edge line; The first number of the second differences less than the preset difference threshold value in the plurality of second differences of the undetermined edge line is counted, and if the first number is greater than the first preset number threshold value, the undetermined edge line is determined as the candidate edge line.
[0010] According to the workwear wearing recognition method provided by the present invention, the at least one candidate edge line includes two candidate edge lines that are close to the edge of the circumscribed rectangle and do not intersect with the center line. The method for determining the region corresponding to any sub-region in the monitoring image based on the candidate edge lines and the center line includes: Determine the target edge line that is closest to the center line from the two candidate edge lines; Along the center line, construct a second number of parallel lines parallel to the center line in the direction toward the target edge line, and construct a second number of parallel lines parallel to the center line in the direction away from the target edge line; The area covered by the parallel lines in the monitoring image is defined as the area corresponding to any sub-region in the monitoring image.
[0011] According to a workwear wearing recognition method provided by the present invention, the above-mentioned determination of the target recognition result of the object to be recognized based on a first target region image and a second target region image includes: Both the first target region image and the second target region image are subjected to re-identification feature extraction processing to determine the first re-identification feature corresponding to the first target region image and the second re-identification feature corresponding to the second target region image; The first template region image corresponding to the first target region image and the second template region image corresponding to the second target region image are obtained from the preset template library. The first template region image and the second template region image are subjected to re-identification feature extraction processing to determine the third re-identification feature corresponding to the first template region image and the fourth re-identification feature corresponding to the second template region image. The preset template library includes template region images corresponding to the work clothes worn by the object to be identified. Each template region image is a region image corresponding to the standard work clothes worn. Calculate the first similarity between the first recognition feature and the corresponding third recognition feature, and calculate the second similarity between the second recognition feature and the corresponding fourth recognition feature; The first similarity and the second similarity are input into a preset decision network for recognition to determine the target recognition result of the object to be recognized. The decision network is trained based on the similarity between the re-recognition features of each training region image and the corresponding template region image in each second training image, as well as the labeled recognition results corresponding to each second training image. Each second training image includes images occluded by fixed positions of work clothes.
[0012] According to the work clothes wearing recognition method provided by the present invention, the method further includes: If the target recognition result is that the object to be identified is not wearing work clothes, then obtain the third number of similarities that are greater than the preset similarity threshold between the first similarity and the second similarity. If the third quantity is greater than the second preset quantity threshold, the monitoring image of the object to be identified is added to the warning set, and the warning set and prompt message are output; the above prompt message is used to indicate that the monitoring image of the object to be identified may have a false detection due to the work clothes being blocked in a fixed position. The system receives the judgment results input by the user based on the warning set. If the judgment results determine that the monitoring image is a real monitoring image of a worker's uniform being occluded at a fixed position, then the monitoring image is used as the second training image for the decision network to fine-tune the decision network.
[0013] The present invention also provides a workwear wearing recognition device, comprising the following modules: The acquisition module is used to acquire the monitoring image corresponding to the object to be identified; the monitoring image includes the upper body region of the object to be identified, and the upper body region includes the trunk region and the upper limb region. The detection module is used to detect key points in the upper body region of the surveillance image using a preset key point detection model, and to determine at least two key points corresponding to the upper body region; the key point detection model is trained on a first training image with multiple labeled key points. The cropping module is used to crop the first target region image corresponding to the torso region and the second target region image corresponding to the upper limb region from the monitoring image based on the location information of at least two key points. The recognition module is used to determine the target recognition result of the object to be recognized based on the first target area image and the second target area image; the target recognition result includes whether the object to be recognized is wearing work clothes or not.
[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the work clothes wearing recognition method as described above.
[0015] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the work clothes wearing recognition method as described above.
[0016] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the work clothes wearing recognition method as described above.
[0017] The present invention provides a method, device, electronic device, and storage medium for identifying work clothes. This method acquires a monitoring image including the torso and upper limb regions of the upper body of the object to be identified. A preset keypoint detection model is used to detect key points in the upper body region of the monitoring image, determining at least two key points corresponding to the upper body region. Then, based on the position information of the at least two key points, a first target region image corresponding to the torso region and a second target region image corresponding to the upper limb region are cropped from the monitoring image. Finally, the target identification result of the object to be identified is determined based on the first and second target region images. The target identification result includes whether the object is wearing work clothes or not. The keypoint detection model is trained on a first training image with multiple labeled keypoints. In this method, since the upper limb and torso regions of the object to be identified can be comprehensively identified from the monitoring image, more information is referenced during identification, the granularity is finer, and therefore the obtained identification result is more accurate. Meanwhile, since the upper limb and torso regions can be extracted from the monitoring image by detecting key points in the upper body region of the subject, the identification of whether the subject is wearing work clothes can be based on the comprehensive identification of each region, without the need to use a segmentation network to segment each region of the human body. This avoids causing significant performance consumption to the equipment, thereby reducing or minimizing the equipment's performance consumption. At the same time, separating the torso region and upper limb region to identify whether work clothes are worn can also improve the recognition effect. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 This is one of the flowcharts of the work clothes wearing recognition method provided by the present invention.
[0020] Figure 2 This is a schematic diagram of the workwear area division provided by the present invention.
[0021] Figure 3 This is a schematic diagram of the key points marked in the frontal training image provided by the present invention.
[0022] Figure 4 This is a schematic diagram of torso region image extraction provided by the present invention.
[0023] Figure 5 This is the second flowchart of the work clothes wearing recognition method provided by the present invention.
[0024] Figure 6 This is a schematic diagram of upper limb region image extraction provided by the present invention.
[0025] Figure 7 This is a schematic diagram of the process of selecting undetermined edge lines by angle, provided by the present invention.
[0026] Figure 8 This is a schematic diagram of the process of filtering undetermined edge lines based on length and position provided by the present invention.
[0027] Figure 9 This is the third flowchart of the work clothes wearing recognition method provided by the present invention.
[0028] Figure 10 This is a schematic diagram of the work clothes wearing recognition device provided by the present invention.
[0029] Figure 11 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0031] Currently, the identification of whether operators are wearing work clothes is generally based on video sequences. The specific process includes: detecting the human body in the video, obtaining the torso region of the human body, and using it for work clothes classification or comparison. However, the clothing recognition only focuses on the features of the torso region, neglecting the features of the arms, or using the entire limb area as the matching object, and the recognition effect is greatly affected by posture. In addition, in actual work, the fixed areas of the work clothes are often obscured by other devices, which can easily lead to a large number of false detections or false alarms. For example, in some special work scenarios such as kitchens and coal mines, in addition to work clothes, other equipment (self-rescue devices) or auxiliary clothing (sleeves) are also worn. The features of wearing work clothes will be partially obscured by the auxiliary clothing, and general feature extraction and matching schemes will fail. In specific scenarios, auxiliary clothing appears frequently, causing a large number of false alarms. One related technology segments a person's image using a segmentation network, then further segments the person into different parts, identifies the torso from these parts, obtains local information, compares it with a feature database, and issues an alarm based on the judgment result. However, this method, which obtains different regions of the human body through a segmentation network, consumes significant device resources and lacks anti-interference capabilities for fixed-position occlusion. Therefore, this invention provides a workwear wearing recognition method, device, electronic device, and storage medium that can solve the above-mentioned technical problems.
[0032] The following is combined with Figures 1-9 This invention describes a method for recognizing work clothes worn according to an embodiment of the present invention.
[0033] It should be noted that the execution subject of the embodiments of the present invention may be a work clothes wearing recognition device, an electronic device including a work clothes wearing recognition device, or other devices or systems including a work clothes wearing recognition device or an electronic device. No specific limitation is made here. The following embodiments will use an electronic device as the execution subject for description.
[0034] Figure 1 This is one of the flowcharts illustrating the workwear wearing recognition method provided by the present invention, such as... Figure 1 As shown, the method includes the following steps: S102, acquire the monitoring image corresponding to the object to be identified; the monitoring image includes the upper body area of the object to be identified, and the upper body area includes the torso area and the upper limb area.
[0035] The object to be identified can be a human body. The surveillance image of the object to be identified can be a two-dimensional image, which may include one or more two-dimensional images. If it includes multiple two-dimensional images, these multiple two-dimensional images may include the front image, back image, left image, and right image corresponding to the upper body area of the object to be identified.
[0036] One method for acquiring surveillance images of the object to be identified is for the object to stand in front of an image acquisition device (such as a camera or video camera) as instructed, so that the image acquisition device can capture images of the upper body area of the object to be identified, thus obtaining surveillance images. For example, the object to be identified can face the camera in four different positions in sequence: front, left, back, and right, so that the camera can capture surveillance images of the upper body area of the object to be identified from the front, left, back, and right sides.
[0037] The aforementioned surveillance images include the upper body region of the object to be identified, which is the area where work clothes may be worn. Current clothing recognition solutions often only focus on the feature recognition of the torso region, ignoring the arm features. However, arm features are important features of work clothes. In some special scenarios, such as kitchens, people wear various aprons, making it difficult to determine whether they are wearing work clothes using only torso information. Arm information, however, can provide effective identification. Therefore, in this embodiment of the invention, the upper body region in the acquired surveillance images may include both the torso region and the upper limb region. This adds upper limb information as a basis for identifying whether work clothes are worn, thereby improving the recognition effect and accuracy.
[0038] Furthermore, current clothing recognition solutions generally treat the entire work uniform as a single feature for feature extraction and matching. This introduces environmental information, leading to a decrease in feature matching accuracy. Therefore, this invention proposes dividing the work uniform area into multiple regions before performing subsequent feature extraction and matching steps. See [link to relevant documentation]. Figure 2 The diagram showing the division of the work uniform area (the three images shown are the front monitoring image, the back monitoring image, and the left monitoring image; the right monitoring image is not shown) pre-divides the work uniform area into 16 regions: chest, abdomen, upper back, lower back, upper arms (3 on each side, 6 in total), and forearms (3 on each side, 6 in total). The features within each region are rigid and do not change with limb movement. Regions numbered 0-5 represent the 6 regions divided in the front monitoring image: front right forearm, front right upper arm, abdomen, chest, front left forearm, and front left upper arm.
[0039] S104, a preset key point detection model is used to detect key points in the upper body region of the monitoring image to determine at least two key points corresponding to the upper body region; the above key point detection model is trained on a first training image with multiple labeled key points.
[0040] This process involves pre-collecting multiple first training images and then pre-annotating the positions of key points in each image. The key points annotated in each first training image can be determined based on whether the image is frontal, back-side, or left / right side-view. For example, if a first training image is frontal, key points such as shoulder (including left and right shoulder key points), chest (including left and right chest key points), hip (including left and right hip key points), right wrist, right elbow, left elbow, and left wrist key points can be annotated. Similarly, if a first training image is left-side-view, key points such as left shoulder, left elbow, and left wrist key points can be annotated. See the example below. Figure 3 The diagram shows key points marked in the frontal training image. It lists 1 to 10 key points, representing the locations of the key points for the right wrist, right elbow, right shoulder, left shoulder, left elbow, left wrist, right chest, left chest, right hip, and left hip (for illustrative purposes only). It is understood that the locations of these key points can be the center point of the respective area, or other preset locations.
[0041] It should be noted that the aforementioned multiple first training images include frontal training images, back training images, left-side training images, and right-side training images, and the first training images here may include the upper body region of the training subject, wherein the upper body region includes the trunk region and the upper limb region.
[0042] After labeling the keypoint locations in each of the first training images, the labeled first training images can be used to train the initial keypoint detection model. The reference input to this initial keypoint detection model can be the first training image, and the reference output can be the locations of the labeled keypoints on that first training image. The keypoint detection model can be trained in this way.
[0043] After obtaining the trained keypoint detection model, the surveillance image can be input into the keypoint detection model. The keypoint detection model detects the keypoints in the upper body region of the object to be identified in the surveillance image, and obtains the keypoints and their location information in the upper body region of the surveillance image. The keypoints obtained here are usually multiple keypoints.
[0044] It can be understood that key points and their location information can be obtained from different surveillance images (including front surveillance images, rear surveillance images, and left and right surveillance images), and the key points may be different in different surveillance images.
[0045] In addition, the key point detection model mentioned above can be a neural network model or other network models, without specific limitations here.
[0046] S106, based on the location information of at least two key points, extract the first target area image corresponding to the torso region and the second target area image corresponding to the upper limb region from the monitoring image.
[0047] In this step, after obtaining the key points and their location information corresponding to the upper body region, the images corresponding to the torso region and the upper limb region can be extracted from the monitoring image based on the location information of these key points.
[0048] For images cropped to the torso region, taking a frontal surveillance image as an example, see [link to relevant documentation]. Figure 4 The diagram shown illustrates the extraction of torso region information. The keypoint detection process described above obtains keypoints for the shoulders, chest, and hips in the frontal surveillance image. Connecting the keypoints of the shoulders and chest yields a quadrilateral feature region corresponding to the chest. Similarly, connecting the keypoints of the chest and hips yields a quadrilateral feature region corresponding to the abdomen. The quadrilateral feature region of the chest can then be mapped to the corresponding position / area in the frontal surveillance image, and the image at that position / area is cropped to obtain the chest region image. The same applies to obtaining the abdomen region image. Both the chest and abdomen region images obtained here are images of the torso region and can be designated as the first target region image.
[0049] For capturing images corresponding to the upper limb regions, the same method used for capturing images of the torso region can be employed to obtain images corresponding to each upper limb region, all of which can be recorded as the second target region images. Alternatively, other methods can be used, such as connecting lines based on the location information of key points in the upper limb regions to obtain regions including these lines, and then capturing images of the corresponding regions from the monitoring image based on these regions to obtain the second target region images corresponding to each upper limb region.
[0050] In this step, the target region images of the torso and upper limb regions are quickly captured by using the location information of key points. This method is relatively fast and accurate, thus improving the efficiency and accuracy of obtaining images of the torso and upper limb regions, and consequently improving the efficiency and accuracy of subsequent feature extraction from these region images.
[0051] S108, determine the target recognition result of the object to be identified based on the first target region image and the second target region image; the target recognition result includes whether the object to be identified is wearing work clothes or not.
[0052] In this step, the corresponding regions are cropped from the monitoring images. For example, in the front monitoring image, six regions can be cropped: chest, abdomen, upper left arm, left forearm, upper right arm, and right forearm. Similarly, in the back monitoring image, six regions can be cropped: upper back, lower back, upper left arm, left forearm, upper right arm, and right forearm. In the left monitoring image, the left upper arm and left forearm can be cropped. In the right monitoring image, the right upper arm and right forearm can be cropped. The number of first target region images is 4, the number of second target region images is 12, and a total of 16 region images can be cropped.
[0053] Subsequently, the first and second target region images can be separately identified to determine whether the target is wearing work clothes. The results of the two types of image recognition are then combined to obtain the final target recognition result. For example, if both the first and second target region images indicate that the target is wearing work clothes, the target recognition result is that the target is wearing work clothes. Alternatively, feature re-identification can be performed on the first and second target region images, and the re-identified features can then be used to separately identify whether the target is wearing work clothes. The results of the two types of image recognition are then combined to obtain the final target recognition result. Other methods can also be used; the key is to ultimately obtain a target recognition result.
[0054] The method described above for identifying whether work clothes are being worn can be achieved by comparing the first target region image, the second target region image, and the standard image of the region where work clothes are being worn separately to obtain the identification result. Alternatively, other methods can be used, which are not specifically limited here.
[0055] In this embodiment, a monitoring image including the torso and upper limb regions of the upper body of the object to be identified is acquired. A preset keypoint detection model is used to detect key points in the upper body region of the monitoring image, determining at least two key points corresponding to the upper body region. Then, based on the position information of the at least two key points, a first target region image corresponding to the torso region and a second target region image corresponding to the upper limb region are cropped from the monitoring image. The target identification result of the object to be identified is then determined based on the first and second target region images. The target identification result includes whether the object to be identified is wearing work clothes or not. The keypoint detection model is trained on a first training image with multiple labeled key points. In this method, since the upper limb and torso regions of the object to be identified can be cropped from the monitoring image to comprehensively identify whether the object is wearing work clothes, more information is referenced during identification, the granularity is finer, and therefore the obtained identification result is more accurate. Meanwhile, since the upper limb and torso regions can be extracted from the monitoring image by detecting key points in the upper body region of the subject, the identification of whether the subject is wearing work clothes can be based on the comprehensive identification of each region, without the need to use a segmentation network to segment each region of the human body. This avoids causing significant performance consumption to the equipment, thereby reducing or minimizing the equipment's performance consumption. At the same time, separating the torso region and upper limb region to identify whether work clothes are worn can also improve the recognition effect.
[0056] The following examples illustrate the process of specifically cropping images of the upper limb region.
[0057] Figure 5 This is the second flowchart of the work clothes wearing recognition method provided by the present invention, as shown below. Figure 5 As shown, the step S106 above, "extracting the second target region image corresponding to the upper limb region from the monitoring image based on the location information of at least two key points," may include the following steps: S202, for any sub-region in the upper limb region, connect the two key points corresponding to any sub-region among at least two key points to obtain the center line of any sub-region.
[0058] The upper limb region can be divided into multiple sub-regions. For example, in a frontal monitoring image, the right upper limb / arm region can be divided into the sub-region corresponding to the right upper arm and the sub-region corresponding to the right forearm. Other locations are similar.
[0059] For any sub-region within the upper limb region, taking the right upper arm sub-region in a frontal surveillance image as an example, see... Figure 6The diagram shown illustrates the image cropping / extraction of the upper limb region. Through the key point detection processing in S104 above, key points in the frontal monitoring image can be obtained. For the right upper arm sub-region, the position information of the right shoulder key point (such as the center point of the right shoulder) and the position information of the right elbow key point (such as the center point of the right elbow) corresponding to the right upper arm sub-region can be obtained. Then, the right shoulder key point and the right elbow key point are connected to form a straight line, which is recorded as the center line corresponding to the right upper arm sub-region (such as the red line in the second figure of the first row).
[0060] Understandably, for other sub-regions in the upper limb region, it is also possible to obtain two key points corresponding to each of the other sub-regions and connect them for subsequent steps.
[0061] S204, determine the circumscribed rectangle including the center line based on the position information of the center line, and perform edge detection processing on the image of the area corresponding to the circumscribed rectangle in the monitoring image to determine at least one candidate edge line.
[0062] In this step, we continue to take the upper right arm sub-region in the upper limb region of the frontal surveillance image as an example. After obtaining the center line corresponding to the upper right arm sub-region, we can take the center point of the center line as the geometric center and construct a circle with the geometric center as the center and the center line as the diameter. Then, we construct the minimum bounding rectangle of the circle. The minimum bounding rectangle includes the center line mentioned above, such as the black rectangle in the third and fourth figures in the first row of the figure.
[0063] Subsequently, as an optional embodiment, edge detection processing can be performed on the image of the region corresponding to the bounding rectangle (i.e., the aforementioned minimum bounding rectangle) in the monitoring image to obtain multiple undetermined edge lines; that is, the aforementioned minimum bounding rectangle can be mapped to the corresponding position / region in the front monitoring image, and then an edge detection algorithm (such as the Canny operator) is used to perform edge detection processing on the image of the region (or an extended portion of the region) corresponding to the minimum bounding rectangle in the front monitoring image to obtain the detected edge lines, and each detected edge line is recorded as an undetermined edge line (e.g., multiple edge lines in the first image of the second row of the figure).
[0064] Since there are many undetermined edge lines to be detected, some of them may not meet the requirements, so edge line screening is necessary. As an optional embodiment, a first angle between the center line and the target axis can be calculated, and a second angle between the multiple undetermined edge lines and the target axis can be calculated; based on the first and second angles, the multiple undetermined edge lines are screened to determine at least one candidate edge line.
[0065] The target axis can be an axis that is nearly perpendicular to the center line. For example, if the center line in the figure is nearly vertical, the target axis can be a horizontal axis that is perpendicular to the vertical axis. After obtaining the center line, the angle between the center line and the horizontal axis can be calculated using the position information of the two key points on the center line. The angle obtained is denoted as the first angle α.
[0066] Then, the angle between each undetermined edge line and the horizontal axis can be calculated and denoted as the second angle. Since the undetermined edge lines are obtained from edge detection, they may contain curves. Since the angle between curves and the horizontal axis cannot be directly calculated, to facilitate the calculation of the angle between the undetermined edge line and the horizontal axis, the undetermined edge line can be segmented before calculating the angle. As an optional embodiment, each undetermined edge line can be divided into multiple segments, and the second angle between the tangent of each segment and the target axis can be calculated, obtaining multiple second angles corresponding to each undetermined edge line. See, for example... Figure 7 The diagram illustrates the process of filtering undetermined edge lines. For each undetermined edge line, it can be divided into multiple segments (e.g., 11 segments) from top to bottom and from left to right. Then, the second angle between the tangent at each dividing point and the horizontal axis can be calculated. Each undetermined edge line can obtain the number of second angles equal to the number of segments minus 1 (e.g., 10 second angles). The multiple second angles of each undetermined edge line can then be placed into a set S for subsequent statistics.
[0067] Subsequently, as an optional embodiment, for each undetermined edge line, the differences between multiple second included angles and the first included angle of the undetermined edge line are calculated to obtain multiple second differences corresponding to the undetermined edge line; that is, the differences between each second included angle and the first included angle in the S set of each undetermined edge line are calculated to obtain the differences corresponding to each second included angle in the S set of each undetermined edge line, all of which are recorded as second differences. Then, count the number of second differences less than a preset difference threshold among the multiple second differences of the undetermined edge line. If the first number is greater than the first preset number threshold, the undetermined edge line is determined as a candidate edge line. That is, for each undetermined edge line, it can be determined whether the second difference corresponding to each second angle in the S set of the undetermined edge line is less than the preset difference threshold (e.g., 5°). The judgment result corresponding to each second angle in the S set of the undetermined edge line is obtained. The judgment result of each second angle includes being less than the preset difference threshold or not less than the preset difference threshold. In this way, the number of second angles / second differences less than the preset difference threshold in the S set of the undetermined edge line can be counted. Then, it can be determined whether the number is greater than the first preset number threshold (e.g., half the number of segmented lines + 1, such as 6). If it is greater, the undetermined edge line is taken as a candidate edge line; otherwise, the undetermined edge line is discarded.
[0068] The above method can filter out some undetermined edge lines with significant angular deviations from the center line. Furthermore, to obtain the desired edge lines more accurately, further length and position filtering can be applied to the undetermined edge lines after angle filtering. Length filtering filters edge lines whose length is less than the length of the center line (i.e., retaining undetermined edge lines whose length is greater than or equal to the length of the center line). Position filtering retains the two undetermined edge lines whose positions are closest to the two opposite edges of the smallest bounding rectangle (e.g., two edges approximately parallel to the center line), filtering all other undetermined edge lines. For example, see... Figure 8 The diagram illustrates the process of filtering edge lines based on length and position. Through length and position filtering, a smaller number of edges remain (such as the left and right edges of the upper right arm). Figure 6 The white edge line in the second image of the second row.
[0069] Through the above angle filtering, length filtering, and position filtering, the remaining undetermined edge lines can be used as candidate edge lines, which can greatly reduce the amount of computation required to determine any sub-region of the upper limb region.
[0070] S206, determine the region corresponding to any sub-region in the monitoring image based on the candidate edge line and the center line, and extract the image of the region corresponding to any sub-region in the monitoring image to obtain the second target region image corresponding to any sub-region.
[0071] In this step, after obtaining the candidate edge lines as described above, the at least one candidate edge line includes two candidate edge lines that are close to the edge of the circumscribed rectangle (i.e., the minimum circumscribed rectangle) and do not intersect with the center line. As an optional embodiment, the target edge line closest to the center line can be determined from the two candidate edge lines, i.e., the candidate edge line whose position is closer to the center line is selected; then, along the center line, a second number of parallel lines parallel to the center line are constructed in the direction toward the target edge line (e.g., ...). Figure 6 The yellow line to the left of the red line in the third image of the second row) and constructing a second number of parallel lines parallel to the center line in a direction away from the target edge line (e.g. Figure 6 (The yellow line to the right of the red line in the third image of the second row); Then, the area covered by the parallel lines in the monitoring image can be determined as the area corresponding to any sub-region in the monitoring image, that is, the... Figure 6The area covered by the yellow parallel lines and red lines in the frontal surveillance image is designated as the region corresponding to the upper right arm sub-region. Constructing the same number of parallel lines on both sides of the central line avoids excessive cropping of images that do not belong to any sub-region, thus introducing redundant features and ensuring the accuracy of subsequent wearable recognition for any sub-region.
[0072] Continuing with the example of the right upper arm sub-region within the upper limb area of a frontal surveillance image, after determining the corresponding region of the right upper arm sub-region in the frontal surveillance image, for example... Figure 6 The area within the green rectangle in the fourth image of the second row is used as a reference. Based on the location information of this area, the corresponding region image can be cropped from the frontal monitoring image. This obtained region image is the image corresponding to the right upper arm sub-region, denoted as the second target region image. The second target region image can be obtained by cropping any sub-region within the upper limb region using the above method.
[0073] Furthermore, after capturing the second target region image corresponding to any sub-region, an affine transformation can be performed on the second target region image to convert each second target region image into a feature region of size w*h (the sizes of w and h can be determined according to subsequent network parameters), facilitating subsequent wearable recognition processing. Similarly, an affine transformation can also be performed on the first target region image to convert each first target region image into a feature region of size w*h, facilitating subsequent wearable recognition processing.
[0074] In this embodiment, edge detection is performed by connecting two key points of any sub-region of the upper limb region and constructing an enclosing rectangle to extract the corresponding region image in the monitoring image. This method of determining the edge detection region using the enclosing rectangle reduces the computational load of the edge detection operator and subsequent edge information filtering. Furthermore, the extraction of the sub-region image of the upper limb region utilizes only key point information and the edge detection algorithm, eliminating the need for fine-tuning with extensive workwear data, thus exhibiting stronger generalization and minimizing GPU resource consumption. Additionally, edge lines with unsuitable angles are filtered by calculating the angle difference between the detected edge line and the center line. This eliminates the need to traverse the entire monitoring image for parameter adaptation and connected component matching to obtain suitable edge lines, simplifying the calculation process and improving edge filtering efficiency. Further, by constructing parallel lines along the center line towards the nearest edge line and the same number of parallel lines in the opposite direction, the corresponding region in the monitoring image for any sub-region is determined. This avoids excessive cropping of images that do not belong to any sub-region, preventing the introduction of redundant features and ensuring the accuracy of subsequent wearable recognition of any sub-region image.
[0075] The following examples illustrate how to identify whether someone is wearing work clothes by using a first target region image of the torso region and a second target region image of the upper limb region.
[0076] Figure 9 This is the third flowchart of the work clothes wearing recognition method provided by the present invention, as shown below. Figure 9 As shown, the above S108 may include the following steps: S302, perform re-identification feature extraction processing on both the first target region image and the second target region image to determine the first re-identification feature corresponding to the first target region image and the second re-identification feature corresponding to the second target region image.
[0077] Specifically, a re-identification network can be used to extract re-identification features from the image of the first target region, obtaining the re-identification features (denoted as reid features) corresponding to the first target region image, which are referred to as the first re-identification features. Similarly, a re-identification network can be used to extract re-identification features from the image of the second target region, obtaining the re-identification features corresponding to the second target region image, which are referred to as the second re-identification features. The re-identification network here (such as a pedestrian re-identification network) can be a neural network model or other network models; no specific limitation is made here.
[0078] S304, obtain the first template region image corresponding to the first target region image and the second template region image corresponding to the second target region image from the preset template library, and perform re-identification feature extraction processing on both the first template region image and the second template region image to determine the third re-identification feature corresponding to the first template region image and the fourth re-identification feature corresponding to the second template region image.
[0079] The aforementioned preset template library includes images of template regions corresponding to the work clothes worn by the object to be identified. Each template region image corresponds to a region image under standard work clothing wearing conditions. Specifically, for the situation where personnel wear work clothes in a set scenario (such as a kitchen scenario), images can be captured after personnel are wearing standard work clothes in this scenario. Then, the captured images are divided into work clothing regions. For example, according to the same division method as in S102 above, the images are divided into 16 regions. The images of these 16 regions are then cropped from the captured images, numbered, and saved to the preset template library.
[0080] Understandably, different preset template libraries can be set for different scenarios, that is, to set the area image after the standard work clothes are worn in different scenarios.
[0081] Specifically, after obtaining the first target region image of the torso area of the object to be identified, if there are multiple first target region images, each first target region image can carry its corresponding number (the number can represent the body part; for example, if the number of a first target region image is 1, it indicates that it belongs to the chest area on the front; the body part corresponding to the specific number can be preset). Then, based on the number of each first target region image, the standard region image corresponding to the number in the preset template library corresponding to the type of work clothes worn by the object to be identified can be found, and all of them are recorded as the first template region image. Similarly, the standard region image corresponding to each second target region image can be found in the preset template library, and all of them are recorded as the second template region image.
[0082] Subsequently, the aforementioned re-identification network can be used to extract re-identification features from the first template region image to obtain the re-identification features corresponding to the first template region image, denoted as the third re-identification feature. Similarly, the aforementioned re-identification network can be used to extract re-identification features from the second template region image to obtain the re-identification features corresponding to the second template region image, denoted as the fourth re-identification feature.
[0083] S306, calculate the first similarity between the first recognition feature and the corresponding third recognition feature, and calculate the second similarity between the second recognition feature and the corresponding fourth recognition feature.
[0084] In this step, the similarity between each first-level recognition feature and its corresponding third-level recognition feature in the region image can be calculated, and the obtained similarity can be recorded as the first similarity. Similarly, the similarity between each second-level recognition feature and its corresponding fourth-level recognition feature in the region image can be calculated, and the obtained similarity can be recorded as the second similarity. Following this calculation process, multiple first and second similarities can be obtained. For example, if the region is divided into 16 areas as described above, then 4 first similarities belonging to the trunk region and 12 second similarities belonging to the upper limb region can be calculated.
[0085] S308, the first similarity and the second similarity are input into a preset decision network for recognition, and the target recognition result of the object to be recognized is determined; the decision network is trained based on the similarity between the re-recognition features of each training region image and the corresponding template region image in each second training image, as well as the labeled recognition result corresponding to each second training image, and each second training image includes an image occluded by a fixed position of work clothes.
[0086] In this step, due to the varying complexity of features across different regions, the similarity thresholds for different regions of the work uniform differ significantly (i.e., the matching difficulty varies greatly between different regions). Therefore, it is impossible to directly determine whether the object to be identified is currently wearing a work uniform using weighted methods. Based on this, this embodiment of the invention proposes using a decision network to perform the identification process for whether the object is wearing a work uniform.
[0087] The decision network can be a neural network model, such as a back propagation (BP) neural network model, or other network models, without specific limitations. The decision network can be pre-trained, and during training, it can collect various second training images. These second training images include, but are not limited to: images that falsely report work clothes due to fixed-position occlusion (i.e., images where work clothes are worn but falsely reported due to fixed-position occlusion), positive report images (i.e., images where work clothes are not worn), and images where work clothes are worn and there is no occlusion.
[0088] During specific training, all images falsely reported as wearing work clothes due to fixed-position occlusion can be collected, divided into multiple work clothes regions, and re-identification features of each work clothes region can be extracted. Then, the feature similarity between each work clothes region and the corresponding standard region image in the preset template library can be calculated (e.g., a 16-dimensional feature similarity vector is obtained for each image), and placed into set W. Simultaneously, multiple positive report images of people not wearing work clothes (e.g., 500 images) can be collected, and the feature similarity vector between each region image of each image and the corresponding standard region image in the preset template library can be calculated in the same way, and placed into set R. Additionally, multiple unoccluded images of people wearing work clothes (e.g., 500 images) can be collected, and the feature similarity vector between each region image of each image and the corresponding standard region image in the preset template library can be calculated in the same way, and placed into set S.
[0089] The feature similarity between the 16 uniform regions in each of the second training images and the corresponding regions in the preset template library can be denoted as x1, x2, ..., x16, respectively. Furthermore, after collecting each second training image, a corresponding recognition result (denoted as the labeled recognition result) can be assigned to each second training image, that is, each second training image can be labeled with its actual result of whether or not the uniform is worn (e.g., wearing a uniform is labeled as 1, not wearing a uniform is labeled as 0). For example, the actual recognition results of the above three types of second training images are labeled as follows: B(x1,x2,x3...,x16) =1 (x∈W); B(x1,x2,x3...,x16) =1 (x∈S); B(x1,x2,x3...,x16) =0 (x∈R).
[0090] Then, the 16-dimensional similarity vector of each second training image is input into the initial decision network for recognition, obtaining the predicted recognition result of whether the object in each second training image is wearing work clothes. Afterwards, the loss between the predicted recognition result and its corresponding labeled recognition result for each second training image can be calculated, and the parameters of the initial decision network can be adjusted using the calculated loss to finally obtain the trained decision network. The loss here can include cross-entropy loss and L1 regularization loss, for example, the loss can be calculated using the following formula: Loss = cross Entropy loss + L1 regularization.
[0091] The above method trains the decision network using images of work clothes occluded at fixed positions, images of people not wearing work clothes, and images of people wearing work clothes without occlusion. This allows the decision network to continuously reduce the weight of similarity in occluded regions and continuously increase the weight of similarity in unoccluded regions. This achieves the goal of automatically filtering occluded regions and reducing the classification weight of regions with only a few occlusions, thus realizing adaptive processing of the work clothes occlusion problem and ultimately improving the recognition accuracy of images with work clothes occluded at fixed positions. Furthermore, this method eliminates the need for manual sifting through large amounts of data to identify invalid regions; instead, the decision network automatically determines the regions to be filtered during its learning and training process, thereby achieving automated processing of the occlusion problem.
[0092] Based on the trained decision network, after obtaining the four first similarities corresponding to the torso region and the twelve second similarities corresponding to the upper limb region in the surveillance image, these 16 similarities can be arranged into a 16-dimensional vector according to the similarity order during the training of the decision network. This 16-dimensional vector is then input into the trained decision network to obtain the target recognition result of whether the object to be identified is wearing work clothes. For example, if the output result is 1, it means that the target recognition result is that the object to be identified is wearing work clothes; if the output result is 0, it means that the target recognition result is that the object to be identified is not wearing work clothes.
[0093] Furthermore, since fixed-position occlusion of work clothes in real-world situations affects the similarity of image features in the affected area (i.e., the similarity decreases), but has no impact on the similarity of image features in unoccluded areas (i.e., the similarity remains high), and this situation also affects the recognition performance of the decision network, images that are actually occluded in fixed positions of work clothes and are misidentified can be added to the second training images of the decision network in real time to update and adjust the parameters of the decision network online in real time, thereby optimizing the recognition accuracy of the decision network.
[0094] In this scenario, as an optional embodiment, if the target identification result indicates that the object to be identified is not wearing work clothes, then a third number of similarities greater than a preset similarity threshold is obtained from the first and second similarity categories. The preset similarity threshold can be set according to actual conditions, for example, it can be 0.8. As described above, when the decision network determines that the object to be identified is not wearing work clothes, all 16 similarities corresponding to the monitoring image of the object to be identified can be obtained. Then, it is determined whether each similarity is greater than the preset similarity threshold, in order to find the similarities greater than the preset similarity threshold, and count the number of similarity pairs greater than the preset similarity threshold, which is recorded as the third number.
[0095] Then, it can be determined whether the third quantity is greater than the second preset quantity threshold. The size of the second quantity threshold can also be set according to the actual situation, such as 12. If the third quantity is less than or equal to the second preset quantity threshold, the monitoring image of the object to be identified is determined to be an image of someone not wearing a uniform, and the process ends. If the third quantity is greater than the second preset quantity threshold, the monitoring image of the object to be identified is added to the warning set, and the warning set and prompt message are output. The prompt message is used to indicate that the monitoring image of the object to be identified is suspected of being a false detection due to a fixed position of a uniform obstructing it. That is, when the third quantity is greater than the second preset quantity threshold, the monitoring image of the object to be identified is an image suspected of being obstructed by a fixed position of a uniform, and it can be added to the warning set and output to the user, prompting the user that the monitoring image is suspected of being obstructed by a fixed position of a uniform and may be falsely detected as someone not wearing a uniform. After receiving the prompt, the user can judge whether the monitoring image is a real monitoring image with a fixed position of uniform obstruction, and input the judgment result into the electronic device after the judgment. The judgment result includes whether the monitoring image is a real monitoring image with a fixed position of uniform obstruction, or whether the monitoring image is not a real monitoring image with a fixed position of uniform obstruction.
[0096] The electronic device can then receive the judgment results input by the user based on the warning set. If the judgment results determine that the monitoring image is a genuine image of work clothes obstructing a fixed position, the monitoring image is used as the second training image for the decision network to fine-tune the network. In other words, if a human judges that the monitoring image of the object to be identified is a genuine image of work clothes obstructing a fixed position and is a false detection, it is added to the second training image of the decision network to fine-tune the network's parameters online in real time.
[0097] In this embodiment, re-identification feature extraction and similarity calculation are performed between the torso region image and the upper limb region image of the object to be identified and the corresponding region images in the template library. Multiple similarity scores are then input into the decision network to identify whether work clothes are worn. This approach, using multiple similarity scores and the decision network, improves recognition efficiency and accuracy. Furthermore, since the decision network is trained on images with fixed-position occlusion of the work clothes, the recognition accuracy for images with fixed-position occlusion is improved. Further, images with fixed-position occlusion that are falsely detected by the decision network in real time can be added to the network's training. This reduces false detections of fixed-position occlusion of work clothes, improves recall for such cases, enhances the anti-interference capability of the work clothes wearing recognition process, and improves the generalization ability of the decision network.
[0098] The work clothes wearing recognition device provided by the present invention is described below. The work clothes wearing recognition device described below can be referred to in correspondence with the work clothes wearing recognition method described above.
[0099] Figure 10 This is a schematic diagram of the work clothes wearing recognition device provided by the present invention. (See attached diagram) Figure 10 As shown, the above-mentioned device may include: The acquisition module 410 is used to acquire a monitoring image corresponding to the object to be identified; the monitoring image includes the upper body region of the object to be identified, and the upper body region includes the trunk region and the upper limb region. The detection module 420 is used to detect key points in the upper body region of the monitoring image using a preset key point detection model, and to determine at least two key points corresponding to the upper body region; the key point detection model is trained on a first training image with multiple labeled key points. The cropping module 430 is used to crop a first target region image corresponding to the torso region and a second target region image corresponding to the upper limb region from the monitoring image based on the location information of at least two key points. The recognition module 440 is used to determine the target recognition result of the object to be recognized based on the first target area image and the second target area image; the target recognition result includes whether the object to be recognized is wearing work clothes or not.
[0100] In some embodiments, the interception module 430 includes: The connecting unit is used to connect two key points corresponding to any sub-region in the upper limb region to obtain the center line of any sub-region. The detection unit is used to determine the circumscribed rectangle including the center line based on the position information of the center line, and to perform edge detection processing on the image of the area corresponding to the circumscribed rectangle in the monitoring image to determine at least one candidate edge line. The cropping unit is used to determine the region corresponding to any sub-region in the monitoring image based on the candidate edge line and the center line, and to crop the image of the region corresponding to any sub-region in the monitoring image to obtain the second target region image corresponding to any sub-region.
[0101] Optionally, the above-mentioned detection unit is specifically used for
[0102] Edge detection processing is performed on the image corresponding to the bounding rectangle in the monitoring image to obtain multiple undetermined edge lines; the first angle between the center line and the target axis is calculated, and the second angle between the multiple undetermined edge lines and the target axis is calculated; based on the first angle and the second angle, the multiple undetermined edge lines are filtered to determine at least one candidate edge line.
[0103] Optionally, the above-mentioned detection unit is specifically used for
[0104] Each undetermined edge line is divided into multiple segments, and the second included angle between the tangent of each segment of the undetermined edge line and the target axis is calculated to obtain multiple second included angles corresponding to each undetermined edge line. For each undetermined edge line, the difference between the multiple second included angles of the undetermined edge line and the first included angle is calculated to obtain multiple second difference values corresponding to the undetermined edge line. The first number of second difference values of the undetermined edge line that is less than a preset difference threshold is counted. If the first number is greater than a first preset number threshold, the undetermined edge line is determined as a candidate edge line.
[0105] Optionally, the at least one candidate edge line includes two candidate edge lines that are close to the edge of the circumscribed rectangle and do not intersect with the center line. The aforementioned interception unit is specifically used for...
[0106] Determine the target edge line closest to the center line from the two candidate edge lines; construct a second number of parallel lines parallel to the center line in the direction toward the target edge line, and construct a second number of parallel lines parallel to the center line in the direction away from the target edge line; determine the area covered by the parallel lines in the monitoring image as the area corresponding to any sub-region in the monitoring image.
[0107] In some embodiments, the identification module 440 described above may include: The first feature extraction unit is used to perform re-identification feature extraction processing on both the first target region image and the second target region image to determine the first re-identification feature corresponding to the first target region image and the second re-identification feature corresponding to the second target region image. The second feature extraction unit is used to obtain a first template region image corresponding to the first target region image and a second template region image corresponding to the second target region image from a preset template library, and to perform re-identification feature extraction processing on both the first template region image and the second template region image to determine the third recognition feature corresponding to the first template region image and the fourth recognition feature corresponding to the second template region image; the preset template library includes template region images corresponding to the work clothes worn by the object to be identified, and each template region image is a region image corresponding to the standard work clothes wearing situation; The calculation unit is used to calculate the first similarity between the first recognition feature and the corresponding third recognition feature, and to calculate the second similarity between the second recognition feature and the corresponding fourth recognition feature; The recognition unit is used to input the first similarity and the second similarity into a preset decision network for recognition, and to determine the target recognition result of the object to be recognized. The decision network is trained based on the similarity between the re-recognition features of each training region image and the corresponding template region image in each second training image, as well as the labeled recognition results corresponding to each second training image. Each second training image includes an image occluded by a fixed position of work clothes.
[0108] Optionally, the above-mentioned device may further include: The quantity acquisition module is used to acquire a third quantity of similarity scores that are greater than a preset similarity threshold between the first similarity score and the second similarity score if the target recognition result is that the object to be identified is not wearing work clothes. The output module is used to add the monitoring image of the object to be identified to the warning set if the third quantity is greater than the second preset quantity threshold, and output the warning set and the prompt message; the prompt message is used to indicate that the monitoring image of the object to be identified is suspected to be a false detection due to the fixed position of the work clothes blocking the view. The determination module is used to receive the judgment result input by the user based on the warning set. If the judgment result determines that the monitoring image is a real monitoring image of the work clothes being occluded at a fixed position, then the monitoring image is used as the second training image of the decision network to fine-tune the decision network.
[0109] It should be noted that the apparatus provided in this embodiment of the invention can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.
[0110] Figure 11 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 11As shown, the electronic device may include: a processor 510, a communications interface 520, a memory 530, and a communications bus 540, wherein the processor 510, the communications interface 520, and the memory 530 communicate with each other through the communications bus 540. The processor 510 can call logical instructions in the memory 530 to execute a work clothes wearing recognition method. This method includes: acquiring a monitoring image corresponding to the object to be identified; the monitoring image includes the upper body region of the object to be identified, which includes a torso region and an upper limb region; using a preset key point detection model to detect key points in the upper body region of the monitoring image, determining at least two key points corresponding to the upper body region; the key point detection model is trained on a first training image with multiple labeled key points; based on the position information of the at least two key points, cropping a first target region image corresponding to the torso region and a second target region image corresponding to the upper limb region from the monitoring image; and determining the target recognition result of the object to be identified based on the first target region image and the second target region image; the target recognition result includes whether the object to be identified is wearing work clothes or not.
[0111] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, 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 a part of the 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 to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0112] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the work clothes wearing recognition method provided by the above methods. The method includes: acquiring a monitoring image corresponding to the object to be identified; the monitoring image includes an upper body region of the object to be identified, the upper body region including a torso region and an upper limb region; using a preset key point detection model to detect key points in the upper body region of the monitoring image, and determining at least two key points corresponding to the upper body region; the key point detection model is trained based on a first training image with multiple labeled key points; according to the position information of at least two key points, cropping a first target region image corresponding to the torso region and a second target region image corresponding to the upper limb region from the monitoring image; and determining the target recognition result of the object to be identified based on the first target region image and the second target region image; the target recognition result includes whether the object to be identified is wearing work clothes or not.
[0113] In another aspect, the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the work clothes wearing recognition method provided by the above methods. The method includes: acquiring a monitoring image corresponding to an object to be identified; the monitoring image includes an upper body region of the object to be identified, the upper body region including a torso region and an upper limb region; using a preset key point detection model to detect key points in the upper body region of the monitoring image, determining at least two key points corresponding to the upper body region; the key point detection model is trained based on a first training image with multiple labeled key points; based on the position information of the at least two key points, cropping a first target region image corresponding to the torso region and a second target region image corresponding to the upper limb region from the monitoring image; and determining the target recognition result of the object to be identified based on the first target region image and the second target region image; the target recognition result includes whether the object to be identified is wearing work clothes or not.
[0114] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0115] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, 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 can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for recognizing work uniform wear, characterized in that, The method comprises the following steps: obtaining a monitoring image corresponding to a to-be-identified object; the monitoring image comprises an upper body region of the to-be-identified object, and the upper body region comprises a trunk region and an upper limb region; detecting key points of the upper body region in the monitoring image by using a preset key point detection model to determine at least two key points corresponding to the upper body region; the key point detection model is obtained by training a plurality of first training images with labeled key points; according to position information of the at least two key points, a first target region image corresponding to the trunk region and a second target region image corresponding to the upper limb region are obtained from the monitoring image; according to the first target region image and the second target region image, a target identification result of the to-be-identified object is determined; the target identification result comprises whether the to-be-identified object wears a work uniform or not.
2. The workwear recognition method according to claim 1, characterized in that, the second target region image corresponding to the upper limb region is obtained from the monitoring image according to the position information of the at least two key points, comprising: for any sub-region in the upper limb region, two key points corresponding to the any sub-region are connected to obtain a center line of the any sub-region; an outer rectangle including the center line is determined according to position information of the center line, and an edge detection process is performed on an image of a region corresponding to the outer rectangle in the monitoring image to determine at least one candidate edge line; according to the candidate edge line and the center line, a region corresponding to the any sub-region in the monitoring image is determined, and an image of a region corresponding to the any sub-region in the monitoring image is obtained to obtain a second target region image corresponding to the any sub-region.
3. The workwear recognition method according to claim 2, characterized in that, the edge detection process is performed on the image of the region corresponding to the outer rectangle in the monitoring image to determine at least one candidate edge line, comprising: an edge detection process is performed on the image of the region corresponding to the outer rectangle in the monitoring image to obtain a plurality of to-be-determined edge lines; a first included angle between the center line and a target axis is calculated, and a second included angle between the plurality of to-be-determined edge lines and the target axis is calculated; according to the first included angle and the second included angle, the plurality of to-be-determined edge lines are screened to determine at least one candidate edge line.
4. The workwear recognition method according to claim 3, characterized in that, the second included angle between the plurality of to-be-determined edge lines and the target axis is calculated, comprising: each to-be-determined edge line is divided into a plurality of line segments, and a second included angle between a tangent line of each segment of each to-be-determined edge line and the target axis is calculated to obtain a plurality of second included angles corresponding to each to-be-determined edge line; according to the first included angle and the second included angle, the plurality of to-be-determined edge lines are screened to determine at least one candidate edge line, comprising: for each to-be-determined edge line, a plurality of second differences between the plurality of second included angles of the to-be-determined edge line and the first included angle are calculated to obtain a plurality of second differences corresponding to the to-be-determined edge line; The first quantity of second differences less than the preset difference threshold value is counted from the second differences of the undetermined edge line, and if the first quantity is greater than a first preset quantity threshold value, the undetermined edge line is determined as the candidate edge line.
5. The workwear recognition method according to any one of claims 2 to 4, characterized in that, The at least one candidate edge line includes two candidate edge lines close to edges of the circumscribed rectangle and not intersecting with the center connecting line, and the region corresponding to the any sub-region in the monitoring image is determined according to the candidate edge line and the center connecting line, including: A target edge line closest to the center connecting line is determined from the two candidate edge lines; Along the center connecting line, a second quantity of parallel lines parallel to the center connecting line are constructed in a direction towards the target edge line, and a second quantity of parallel lines parallel to the center connecting line are constructed in a direction away from the target edge line; The range covered by the parallel lines in the monitoring image is determined as the region corresponding to the any sub-region in the monitoring image.
6. The workwear recognition method according to any one of claims 1 to 4, characterized in that, The target recognition result of the to-be-recognized object is determined according to the first target region image and the second target region image, including: The first target region image and the second target region image are both subjected to re-identification feature extraction processing to determine a first re-identification feature corresponding to the first target region image and a second re-identification feature corresponding to the second target region image; A first template region image corresponding to the first target region image and a second template region image corresponding to the second target region image are obtained from a preset template library, and the first template region image and the second template region image are both subjected to re-identification feature extraction processing to determine a third re-identification feature corresponding to the first template region image and a fourth re-identification feature corresponding to the second template region image; the preset template library includes various template region images corresponding to the work clothes worn by the to-be-recognized object, and each template region image is a region image corresponding to a standard work clothes condition; A first similarity between the first re-identification feature and the corresponding third re-identification feature is calculated, and a second similarity between the second re-identification feature and the corresponding fourth re-identification feature is calculated; The first similarity and the second similarity are input into a preset decision network for identification to determine the target recognition result of the to-be-recognized object; the decision network is trained based on the similarities between the re-identification features of each training region image in each second training image and the corresponding template region image, and the annotation recognition result corresponding to each second training image; each second training image includes an image in which a work clothes fixed position is blocked.
7. The workwear recognition method according to claim 6, characterized in that, The method further includes: If the target recognition result is that the to-be-recognized object does not wear work clothes, a third quantity of similarities greater than a preset similarity threshold value is obtained from the two types of similarities of the first similarity and the second similarity. If the third quantity is greater than a second preset quantity threshold, the monitoring image of the to-be-identified object is added to a pre-warning set, and the pre-warning set and a prompt message are output; the prompt message is used to prompt that the monitoring image of the to-be-identified object is suspected to be mis-detected as the cover of the fixed position of the work clothes; A judgment result input by a user according to the pre-warning set is received, and if it is determined according to the judgment result that the monitoring image is a real monitoring image of the cover of the fixed position of the work clothes, the monitoring image is taken as a second training image of the decision network, and the decision network is fine-tuned.
8. A work uniform wearing recognition device, characterized in that, Comprise: An acquisition module is configured to acquire a monitoring image corresponding to a to-be-identified object; the monitoring image includes an upper body region of the to-be-identified object, and the upper body region includes a trunk region and an upper limb region; A detection module is configured to detect a key point of the upper body region in the monitoring image by using a preset key point detection model, and determine at least two key points corresponding to the upper body region; The key point detection model is obtained by training a plurality of first training images with labeled key points; A cutting module is configured to cut a first target region image corresponding to the trunk region and a second target region image corresponding to the upper limb region from the monitoring image according to position information of the at least two key points; An identification module is configured to determine a target identification result of the to-be-identified object according to the first target region image and the second target region image; the target identification result includes whether the to-be-identified object wears work clothes or not.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the work clothes wearing identification method in any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the work clothes wearing identification method in any one of claims 1 to 7.