Image processing, clothing recognition method, device, equipment and storage medium
By detecting the overlap ratio and posture similarity between the clothing area and the human body area, removing unnecessary clothing areas, and using texture features and rationality conditions to select candidate styles, it solves the problem of accurate recognition of clothing recognition technology in non-rigid objects and occlusion situations. It solves the problem of low rate and improves the accuracy and reliability of clothing recognition.
Patent Information
- Application Number
- CN202111164022.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-09-30
AI Technical Summary
Existing clothing recognition technology has low recognition accuracy under conditions such as non-rigid objects, deformation, occlusion and incomplete exposure, and is difficult to meet the requirements of more than 90% of actual application scenarios.
By detecting the clothing area and human body area of the image to be processed, combined with the overlap ratio and posture similarity, unnecessary clothing areas are removed, the texture features of the effective clothing area are extracted, and candidate styles are selected according to the preset rationality conditions to improve the accuracy of clothing recognition. Accuracy.
It improves the accuracy of clothing identification, reduces low-quality clothing areas that affect identification, provides a better identification basis, and enhances the reliability and accuracy of clothing identification.
Smart Images

Figure CN113869435B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to an image processing, clothing recognition method, device, equipment and storage medium. Background Art
[0002] Clothing is an indispensable item in people's daily life. With the emergence of online shopping platforms, people often buy clothing on online shopping platforms, which greatly facilitates people's lives. In related technologies, in order to further provide convenience for people, clothing that appears in the video can be identified through clothing recognition technology to provide people with information about related clothing. Existing clothing recognition technology is still in the development stage, and the recognition accuracy is still low, which makes it difficult to meet the recognition requirements of actual application scenarios. For example, the maximum accuracy of most clothing recognition technologies based on open source data sets is less than 70%, which is difficult to meet the recognition requirements of the actual application scenarios with an accuracy higher than 90%. In particular, clothing is a non-rigid object, and deformation, occlusion, incomplete exposure, etc. will affect the accuracy of clothing recognition, which is a common challenge in actual application scenarios. Summary of the invention
[0003] The purpose of the embodiments of the present invention is to provide an image processing, clothing recognition method, device, equipment and storage medium to improve the accuracy of clothing recognition. The specific technical solution is as follows:
[0004] In a first aspect of the present invention, an image processing method is provided, comprising:
[0005] Perform clothing area and human body area detection on the image to be processed;
[0006] In response to detecting at least one clothing region and at least one human body region, comparing the clothing region with each of the human body regions, and determining whether the clothing region is a clothing region to be removed based on the comparison result, and whether the overlapping ratio between the clothing region to be removed and the human body region reaches a first threshold and the posture similarity does not exceed a second threshold;
[0007] The clothing area other than the clothing area to be removed in the image to be processed is determined as a valid clothing area.
[0008] In one embodiment, comparing the clothing region with each of the human body regions and determining whether the clothing region is a clothing region to be removed based on the comparison result includes:
[0009] Calculating the intersection-over-union ratio of the clothing area and each of the human body areas;
[0010] Based on the calculation result, the clothing area is determined to be a clothing area that needs to be removed.
[0011] In one implementation, the determining, based on the calculation result, that the clothing area is a clothing area that needs to be removed includes:
[0012] In response to the maximum value of each intersection-over-union ratio being greater than or equal to the first threshold and the posture similarity corresponding to the maximum value not exceeding the second threshold, the clothing region is determined to be a clothing region that needs to be removed.
[0013] In one implementation, the image to be processed includes more than two human body regions, and determining the clothing region as the clothing region to be removed based on the calculation result includes:
[0014] In response to two or more of the intersection-and-union ratios being greater than or equal to a first threshold, the clothing region is determined to be a clothing region that needs to be removed.
[0015] In one embodiment, the human body region includes at least one key node of human body posture;
[0016] The determining, based on the calculation result, that the clothing area is a clothing area that needs to be removed includes:
[0017] Determine the human body region corresponding to the maximum value of each intersection-over-union ratio as the target human body region;
[0018] Obtaining the style category of the identified clothing area;
[0019] Acquire at least one human posture key node included in the wearing part of the identified style category that is preset;
[0020] Counting the number of the same human posture key nodes contained in the wearing parts of the identified style category and the target human body region;
[0021] In response to the statistical number not exceeding the second threshold, the clothing area is determined as a clothing area that needs to be removed.
[0022] In one embodiment, it further includes:
[0023] Extracting texture features of the effective clothing area;
[0024] Calculating the similarity between the texture features of each candidate style pre-extracted from the database and the texture features of the valid clothing area respectively as a first similarity;
[0025] At least one candidate style having the highest first similarity is selected for the valid clothing area.
[0026] In one embodiment, it further includes:
[0027] For at least one of the candidate styles in the valid clothing area, the candidate styles that do not meet the preset rationality conditions are removed.
[0028] In one embodiment, the preset rationality condition includes at least one of the following items:
[0029] The first similarity is greater than or equal to a third threshold;
[0030] The second similarity is greater than or equal to a fourth threshold, wherein the second similarity is the similarity between the style category of the candidate style and the style category pre-identified for the valid clothing area;
[0031] The third similarity is greater than or equal to a fifth threshold, and the third similarity is the similarity between the color feature of the candidate style and the color feature of the valid clothing area.
[0032] In a second aspect of the present invention, a clothing recognition method is provided, comprising:
[0033] Get the picture frame in the currently playing video as the image to be processed;
[0034] Processing the image to be processed using any image processing method as described in the first aspect;
[0035] Based on the processing result, clothing information of the image to be processed is determined.
[0036] In a third aspect of the present invention, there is provided an image processing device, comprising:
[0037] A region detection module, used for detecting clothing regions and human body regions in the image to be processed;
[0038] A first determination module is configured to, in response to detecting at least one clothing region and at least one human body region, compare the clothing region with each of the human body regions, and determine, based on the comparison result, whether the clothing region is a clothing region to be removed, and whether the overlapping ratio between the clothing region to be removed and the human body region reaches a first threshold and the posture similarity does not exceed a second threshold;
[0039] The second determining module is used to determine the clothing area other than the clothing area to be removed in the image to be processed as a valid clothing area.
[0040] In one implementation, the first determination module is specifically configured to calculate an intersection-over-union ratio between the clothing region and each of the human body regions; and based on the calculation result, determine that the clothing region is a clothing region that needs to be removed.
[0041] In one embodiment, the first determination module is specifically configured to determine that the clothing area is a clothing area that needs to be removed in response to the maximum value of each intersection-over-union ratio being greater than or equal to the first threshold and the posture similarity corresponding to the maximum value not exceeding the second threshold.
[0042] In one embodiment, the image to be processed contains more than two human body regions, and the first determination module is specifically used to determine that the clothing region is a clothing region that needs to be removed in response to more than two of the intersection-and-union ratios being greater than or equal to a first threshold.
[0043] In one embodiment, the human body region includes at least one key node of human body posture;
[0044] The first determination module is specifically used to determine the human body area corresponding to the maximum value of each intersection-over-union ratio as the target human body area; obtain the style category of the identified clothing area; obtain at least one human body posture key node contained in the wearing part of the identified style category that is preset; count the number of human body posture key nodes that are the same as those contained in the wearing part of the identified style category and the target human body area; in response to the statistical number and not exceeding the second threshold, determine the clothing area as a clothing area that needs to be removed.
[0045] In one embodiment, it further includes:
[0046] The clothing recognition module is used to extract the texture features of the effective clothing area; calculate the similarity between the texture features of each candidate style pre-extracted in the database and the texture features of the effective clothing area as the first similarity; and select at least one candidate style with the highest first similarity for the effective clothing area.
[0047] In one embodiment, it further includes:
[0048] The style removal module is used to remove the candidate styles that do not meet the preset rationality conditions from at least one of the candidate styles in the effective clothing area.
[0049] In one embodiment, the preset rationality condition includes at least one of the following items:
[0050] The first similarity is greater than or equal to a third threshold;
[0051] The second similarity is greater than or equal to a fourth threshold, wherein the second similarity is the similarity between the style category of the candidate style and the style category pre-identified for the valid clothing area;
[0052] The third similarity is greater than or equal to a fifth threshold, and the third similarity is the similarity between the color feature of the candidate style and the color feature of the valid clothing area.
[0053] In a fourth aspect of the present invention, a clothing recognition device is provided, comprising:
[0054] An image acquisition module is used to acquire a picture frame in a currently playing video as an image to be processed;
[0055] An image processing module, used to process the image to be processed by using any image processing method as described in the first aspect;
[0056] The information determination module is used to determine the clothing information of the image to be processed based on the processing result.
[0057] In another aspect of the present invention, there is provided an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0058] Memory, used to store computer programs;
[0059] The processor is used to implement any of the above-mentioned method steps when executing the program stored in the memory.
[0060] In another aspect of the present invention, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes any of the above-described methods.
[0061] In yet another aspect of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-described methods.
[0062] In the solution provided by the embodiment of the present invention, after the clothing region detection is performed on the image to be processed, the clothing region is compared with each human body region, based on which it is determined whether the clothing region is a clothing region that needs to be removed, and the overlapping ratio between the clothing region that needs to be removed and the human body region reaches a first threshold and the posture similarity does not exceed a second threshold. In this way, in combination with at least one human body region in the image, that is, in combination with contextual information, some clothing regions that affect recognition due to factors such as occlusion by passing human bodies are removed, and clothing regions other than the clothing regions that need to be removed in the image to be processed are determined as valid clothing regions. In this way, low-quality clothing regions that affect recognition are removed. Overall, the cardinality of clothing regions involved in subsequent clothing recognition is reduced, laying a good foundation for subsequent clothing recognition, thereby improving the accuracy of clothing recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0064] Figure 1 FIG. 4 is an exemplary system architecture diagram in an embodiment of the present invention.
[0065] Figure 2 The figure is a flowchart of an exemplary image processing method in an embodiment of the present invention.
[0066] Figure 3 The figure is a flowchart of an exemplary clothing recognition method in an embodiment of the present invention.
[0067] Figure 4 The figure is a flowchart of an exemplary image processing method in an embodiment of the present invention.
[0068] Figure 5 Schematic diagram of the structure of an exemplary clothing recognition device in an embodiment of the present invention.
[0069] Figure 6 Schematic diagram of the structure of an exemplary clothing recognition device in an embodiment of the present invention.
[0070] Figure 7 It is a schematic diagram of the structure of an exemplary electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0071] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0072] The embodiment of the present invention provides an image processing and clothing recognition method, which can be executed by a server or a user terminal. Taking the execution of the server as an example, Figure 1This is a system architecture diagram in an embodiment of the present invention. The system includes a server and a user terminal. In practical applications, the server can execute the method provided in the embodiment of the present invention, apply it to scenes such as clothing recognition or clothing recommendation, and send the result to the user terminal, so that the user of the user terminal can understand the clothing information based on this. In the method provided in the embodiment of the present invention, the effectiveness of the detected clothing area is judged to filter out some clothing areas that affect the recognition, such as ambiguous clothing areas (such as overlapping areas of multiple human bodies, etc.), thus laying a good foundation for subsequent clothing recognition, thereby improving the accuracy of subsequent clothing recognition. The scheme of the embodiment of the present invention is described in more detail below.
[0073] Figure 2 FIG. 1 is a flowchart of an exemplary image processing method provided by an embodiment of the present invention. Figure 2 As shown, the image processing method may at least include the following steps:
[0074] Step 201: Perform clothing area and human body area detection on the image to be processed.
[0075] Step 202: In response to detecting at least one clothing region and at least one human body region, the clothing region is compared with each human body region, and based on the comparison result, it is determined whether the clothing region is a clothing region that needs to be removed, and the overlap ratio between the clothing region that needs to be removed and the human body region reaches a first threshold and the posture similarity does not exceed a second threshold.
[0076] Step 203: Determine the clothing area other than the clothing area to be removed in the image to be processed as a valid clothing area.
[0077] The image to be processed is an image to be used for clothing recognition. In practical applications, after clothing region detection is performed on the image to be processed, one or more clothing regions detected may not all be suitable for clothing recognition, because these clothing regions may contain some ambiguous clothing regions and other clothing regions that affect recognition. If clothing recognition is performed based on these low-quality clothing regions that affect recognition, the recognition result is not accurate, resulting in a decrease in the overall accuracy of the clothing recognition result.
[0078] The context information of an image can reflect the relationship between objects in the image. In the spatial domain of the image, that is, the space where the pixels of the image are located, for a clothing area, the clothing area and the area related to the clothing area form the context information. It can be understood that for a clothing area, the area related to the clothing area can at least include the human body area wearing the clothing, that is, the clothing area and the human body area can form the context information.
[0079] If the overlapping ratio of the clothing area and the human body area reaches the first threshold, it can be considered that the clothing contained in the clothing area may be worn on the human body contained in the human body area. Further, if the posture similarity between the clothing area and the human body area does not exceed the second threshold, it can be considered that the posture of the clothing contained in the clothing area and the posture of the human body contained in the human body area may be different. At this time, the possibility that the clothing contained in the clothing area is worn on the human body contained in the human body area is excluded, and it is considered that the clothing area is not worn on the human body contained in the human body area. This situation may be caused by factors such as the clothing area being blocked by the human body passing by, which may affect the clothing recognition result, and it is determined as the clothing area that needs to be removed, and then the clothing area that needs to be removed in the image to be processed is removed. Among them, the specific values of the first threshold and the second threshold can be set according to actual conditions, and are not specifically limited here.
[0080] Based on this, in this embodiment, after the clothing area detection is performed on the image to be processed, the clothing area is compared with each human body area, and based on this, it is determined whether the clothing area is a clothing area that needs to be removed, and the overlapping ratio between the clothing area that needs to be removed and the human body area reaches a first threshold and the posture similarity does not exceed a second threshold. In this way, in combination with at least one human body area in the image, that is, in combination with contextual information, some clothing areas that affect recognition due to factors such as occlusion by passing human bodies are removed, and clothing areas other than the clothing areas that need to be removed in the image to be processed are determined as valid clothing areas. In this way, low-quality clothing areas that affect recognition are removed. From an overall perspective, the cardinality of clothing areas involved in subsequent clothing recognition is reduced, laying a good foundation for subsequent clothing recognition, thereby improving the accuracy of clothing recognition.
[0081] The posture can be in a wearing state or a non-wearing state (such as a flat state). For the clothing in the wearing state, it may be blocked by other passing human bodies. For the clothing in the non-wearing state, it may also be blocked by other passing human bodies. In this case, the clothing area will affect the clothing recognition result and needs to be removed.
[0082] It should be noted that if no valid clothing area is finally obtained, the subsequent clothing recognition step may not be performed. A prompt message indicating that no clothing is recognized may be issued. In addition, after performing clothing area detection on the image to be processed, if no clothing area is detected from the image, no valid clothing area can be finally obtained.
[0083] In the above step 202, the clothing area is compared with each human body area, and based on the comparison result, it is determined whether the clothing area is a clothing area that needs to be removed. The specific implementation method may include: calculating the intersection and union ratio of the clothing area and each human body area; based on the calculation result, determining that the clothing area is a clothing area that needs to be removed.
[0084] In practical applications, the human body region can be detected in advance on the image to be processed, and the detected human body region is framed by a rectangular frame.
[0085] The intersection-over-union ratio is the ratio of the intersection and the union of two frames. The intersection-over-union ratio can measure the overlap ratio of two frames. Here, the intersection-over-union ratio of the clothing area and the human body area can reflect the overlap ratio of the clothing area and the human body area, that is, the relative size of the overlap. This can reflect whether the clothing contained in the clothing area is likely to be worn on the human body contained in the human body area. Based on this, some rationality judgments can be made to determine whether the clothing area is a clothing area that needs to be removed, thereby removing some detected unreasonable clothing areas.
[0086] In one embodiment, the above-mentioned determination of the clothing area as the clothing area that needs to be removed based on the calculation results may be specifically implemented as follows: in response to the maximum value of each intersection ratio being greater than or equal to a first threshold and the posture similarity corresponding to the maximum value not exceeding a second threshold, determining the clothing area as the clothing area that needs to be removed.
[0087] In this embodiment, if the maximum value of the above-mentioned intersection-and-union ratios is greater than or equal to the first threshold, and the posture similarity corresponding to the maximum value does not exceed the second threshold, it means that there is at least one human body that blocks the clothing area, so the clothing area can be removed to improve the accuracy of subsequent clothing recognition.
[0088] Exemplarily, the value of the first threshold may be less than or equal to 0.5. It is understandable that the first threshold may be set to other values according to actual conditions.
[0089] In one embodiment, the image to be processed contains more than two human body regions, and based on the calculation results, a clothing region is determined to be a clothing region that needs to be removed. The specific implementation method may include: in response to more than two intersection-and-union ratios among the intersection-and-union ratios being greater than or equal to a first threshold, determining the clothing region as a clothing region that needs to be removed.
[0090] In actual applications, for clothing that is in a worn state, if more than two of the above-mentioned intersection-and-union ratios are greater than or equal to the first threshold, it means that the clothing contained in the detected clothing area may be worn on the human bodies contained in multiple human body areas. However, in fact, a piece of clothing can only be worn on one human body, which is inconsistent with the reality, indicating that the detected clothing area is problematic and is likely to be an overlapping area caused by occlusion between multiple human bodies. For clothing that is not worn, if more than two of the above-mentioned intersection-and-union ratios are greater than or equal to the first threshold, it means that at least two human bodies simultaneously occlude the clothing area. This clothing area is ambiguous, so the clothing area can be removed to improve the accuracy of subsequent clothing recognition.
[0091] Further, in response to two or more intersections and unions among the intersections and unions being greater than or equal to the first threshold and the posture similarity corresponding to at least one of the two or more intersections and unions not exceeding the second threshold, the clothing area is determined to be a clothing area that needs to be removed. For clothing in a worn state, if the posture of the clothing contained in the clothing area is different from the posture of the human body contained in at least one of the multiple human body areas that may be worn, then at least one human body has caused an occlusion. In this embodiment, the accuracy of the determined clothing area that needs to be removed is further improved by combining the factor of posture similarity.
[0092] Furthermore, in response to two or more intersections and unions among the intersections and unions being greater than or equal to the first threshold and the posture similarities corresponding to the two or more intersections and unions not exceeding the second threshold, the clothing area is determined to be a clothing area that needs to be removed. For clothing in a non-worn state, if at least two people are blocking it at the same time, since the clothing is not worn on the human body, the posture of the clothing contained in the clothing area is different from the posture of the human body contained in each human body area. Combined with the factor of posture similarity, the accuracy of determining the clothing area that needs to be removed is further improved.
[0093] In one embodiment, the human body region contains at least one human body posture key node; based on the calculation result, the clothing region is determined to be the clothing region that needs to be removed, and its specific implementation method may include: determining the human body region corresponding to the maximum value in each intersection ratio as the target human body region; obtaining the style category of the identified clothing region; obtaining at least one human body posture key node contained in the wearing part of the pre-set identified style category; counting the number of human body posture key nodes that are the same as those contained in the wearing part of the identified style category and the target human body region; in response to the counted number and not exceeding the second threshold, determining the clothing region as the clothing region that needs to be removed.
[0094] In practical applications, the human body region detected is a rectangular frame containing at least one key human body posture node. The key human body posture node may be a left eye, a right eye, a left ear, a right ear, a nose, a neck, a left shoulder, a right shoulder, a left elbow, a right elbow, a left wrist, a right wrist, a left hip, a right hip, a left knee, a right knee, a left foot, a right foot, or the like. Specifically, the human body region detection model trained in advance may be used for detection, and reference may be made to the relevant technology, which will not be described in detail herein. By selecting different combinations of key human body posture nodes, different parts of the human body may be formed. For example, the upper body part of the human body may be formed by the neck, the left shoulder, the right shoulder, the left elbow, the right elbow, the left wrist, the right wrist, the left hip, and the right hip.
[0095] The human body region corresponding to the maximum value in each intersection-and-union ratio is taken as the target human body region, that is, it is considered that the clothing included in the clothing region is worn on the human body included in the target human body region.
[0096] In addition, the style category of the clothing area can be identified in advance. The style category may include short-sleeved tops, long-sleeved tops, vests, shorts, trousers, skirts, dresses, etc. Specifically, the style category of the clothing area can be identified by a pre-trained category classifier.
[0097] In this embodiment, the number of the same human posture key nodes contained in the wearing parts of the identified style category and the target human body area does not exceed the second threshold, indicating that the wearing parts of the clothing contained in the clothing area are inconsistent with the human body parts formed by the human posture key nodes contained in the target human body area, that is, there is a conflict. For example, the human posture key nodes contained in the target human body area belong to the upper body of the human body, and the identified style category is trousers. In fact, trousers are worn on the lower body of the human body. Then, there is a conflict between the two. The recognition result of this clothing area may be ambiguous and needs to be removed to improve the accuracy of subsequent clothing recognition.
[0098] In an exemplary embodiment, clothing area and human body area detection is performed on the image to be identified, and its specific implementation method may include: clothing area detection is performed on the image to be identified; in response to detecting at least one clothing area, posture category recognition is performed on each clothing area, and the posture category includes wearing state and not wearing state; in response to the posture category of the clothing area being the wearing state, human body area detection is performed on the image to be identified. In this way, the clothing area that needs to be removed can be determined for the clothing area in the wearing state.
[0099] Accordingly, based on the calculation result, the clothing area is determined to be a clothing area that needs to be removed, and its specific implementation method may also include: in response to the maximum value of each intersection ratio being less than the first threshold, determining the clothing area as the clothing area that needs to be removed. In practical applications, if the maximum values of the above-mentioned intersection ratios are all less than the first threshold, it means that each intersection ratio is relatively small, then the clothing in the detected clothing area may not be worn on the human body in any human body area, which is inconsistent with the posture category previously identified as wearing state, indicating that the detected clothing area is problematic and is likely to be an invalid area without any clothing. Therefore, the clothing area can be filtered out to improve the accuracy of subsequent clothing recognition.
[0100] In one embodiment, the above method may also include: extracting texture features of the effective clothing area; respectively calculating the similarity between the texture features of each candidate style pre-extracted in the database and the texture features of the effective clothing area as the first similarity; and selecting at least one candidate style with the highest first similarity for the effective clothing area.
[0101] Among them, the texture features of the image can reflect the surface structure organization and arrangement properties of the object surface with slow or periodic changes, which is a global feature.
[0102] In practical applications, the database contains various candidate styles, and texture features of the various candidate styles can be extracted in advance. Texture features can be extracted through a pre-trained texture feature extraction model.
[0103] In this embodiment, based on the global feature of texture feature, the first similarity between the effective clothing area and the candidate styles is calculated, and at least one candidate style with the highest first similarity is selected, so that clothing recognition is very accurate.
[0104] In order to further improve the accuracy of clothing recognition in the effective clothing area, the clothing recognition method may further include: for at least one candidate style in the effective clothing area, removing the candidate style that does not meet the preset rationality condition. In this way, unreasonable candidate styles are further removed through rationality constraints to improve the accuracy of clothing recognition.
[0105] In practical applications, the above preset rationality conditions can be set according to actual conditions. Several of them are listed below.
[0106] 1. The first similarity is greater than or equal to the third threshold. In this way, a candidate style with a higher first similarity is further selected from at least one candidate style to improve the accuracy of clothing recognition.
[0107] Among them, if the posture category of the effective clothing area is not worn, the third threshold is the first value. If the posture category of the effective clothing area is worn, the third threshold is the second value, and the second value is less than the first value. Considering that the effective clothing area with the posture category of the worn state has been processed, the recognition accuracy has been improved. Here, the third threshold can be set to be relatively small. For the effective clothing area with the posture category of the unworn state, considering that it has not been processed, the third threshold can be set to be relatively large, so as to strengthen the rationality constraint of the candidate style and improve the accuracy of the recognition result.
[0108] Exemplarily, the first value ranges from 0.6 to 1, and optionally 0.8. The second value ranges from 0.4 to 0.1, and optionally 0.6. It is understood that the first value and the second value here are only examples, and other values can be set according to actual conditions.
[0109] 2. The second similarity is greater than or equal to the fourth threshold value, and the second similarity is the similarity between the style category of the candidate style and the style category pre-identified for the effective clothing area. In practical applications, the style category of the effective clothing area can be identified in advance. Here, the fourth threshold value can be set to 1, that is, the style category of the candidate style is the same as the style category pre-identified for the effective clothing area. For example, if the style category identification of the effective clothing area results in trousers, and the style category of the candidate style is also trousers, then the candidate style can be selected, and if the style category of the candidate style is a dress, it needs to be removed. In this way, a more accurate style category can be selected, which further improves the accuracy of clothing recognition, and some candidate styles with similar categories can be excluded.
[0110] 3. The third similarity is greater than or equal to the fifth threshold value, and the third similarity is the similarity between the color features of the candidate style and the color features of the effective clothing area. In practical applications, the color features of the effective clothing area can be extracted in advance. And the color features of the candidate styles in the database can be extracted in advance. When extracting color features, M main color components can be extracted, that is, M main colors can be extracted. The value of M can be set according to actual conditions. For example, M is set to 3-5.
[0111] Although texture features contain a certain amount of color features, they are not obvious. Here, we further remove candidate styles through color features, that is, using color features as display features, which can increase the proportion of color features, eliminate errors caused by color, and improve recognition accuracy.
[0112] Exemplarily, the value range of the fifth threshold is 0.3-1, and optionally 0.3. It can be understood that the value of the fifth threshold here is only an example, and other values can be set according to actual conditions.
[0113] During implementation, you can choose to implement one of the above settings of the preset rationality conditions, or you can choose to implement multiple settings of the preset rationality conditions to perform more comprehensive removal.
[0114] Figure 3 FIG. 1 is a flowchart of an exemplary clothing recognition method provided by an embodiment of the present invention. Figure 3 As shown, the clothing recognition method may at least include the following steps:
[0115] Step 301: Obtain a picture frame in the currently playing video as an image to be processed.
[0116] Step 302: Use the image processing method in any of the above embodiments to process the image to be processed.
[0117] Step 303: Determine the clothing information of the image to be processed based on the processing result.
[0118] If the processing result includes at least one candidate style, then in this step, the information of each candidate style can be obtained to generate clothing information of the image to be processed.
[0119] If the processing result includes a valid clothing area but does not include a candidate style, in this step, the texture features of the valid clothing area can be extracted; the similarity between the texture features of each candidate style pre-extracted in the database and the texture features of the valid clothing area is calculated respectively as the first similarity; at least one candidate style with the highest first similarity is selected for the valid clothing area. Then, the information of each candidate style is obtained to generate clothing information of the image to be processed.
[0120] The clothing information of the image to be processed may include: information such as the style, price, purchase link, etc. of the same clothing, and / or information such as the style, price, purchase link, etc. of similar clothing.
[0121] The image processing method can refer to the corresponding description in the above-mentioned image processing method embodiment, which will not be repeated here.
[0122] The solution provided by the embodiment of the present invention is further described in more detail below through specific application scenarios.
[0123] In this embodiment, a solution is proposed that combines the spatial context information of the image, combines the human body posture near the clothing area, adds the validity judgment step of the clothing area relative to the related technology, filters invalid and ambiguous clothing areas, and improves the accuracy of clothing recognition, especially the accuracy of clothing recognition of multiple people. In addition, considering the limitations of the accuracy of the model that extracts texture features alone, the style category information and color information are used as explicit constraints to confirm the rationality of the clothing retrieval results and improve the interpretability of the clothing recognition results. The recognition of the same and similar clothing styles is achieved.
[0124] See also Figure 4 The solution of this embodiment mainly includes the following steps:
[0125] Get a frame from the currently playing video as the image to be processed. After the image (i.e. the image to be processed) is input, the first step, clothing area detection, is performed.
[0126] This step is used to generate coordinate frame information of the clothing area in the input image. This step can be implemented by referring to related technologies.
[0127] The second step is to identify clothing categories.
[0128] In this step, a clothing category classifier is pre-trained, and the clothing category classifier is used to output the posture category and style category of clothing.
[0129] The posture categories may include a flat state (ie, an unworn state) and a worn state.
[0130] Among them, style categories may include short-sleeved tops, long-sleeved tops, vests, shorts, trousers, skirts, dresses, and the like.
[0131] The third step is human body region detection. That is, human body region detection is performed on the image. This step can refer to the above related embodiments and will not be described in detail here.
[0132] Step 4: Determine the regional effectiveness of clothing. Details are as follows:
[0133] (i) For the clothing area identified as being worn, the intersection-and-union ratios of the clothing area and each human body area are calculated to generate an intersection-and-union ratio list.
[0134] (ii) removing clothing regions whose maximum intersection-over-union ratio in the intersection-over-union ratio list is less than the first threshold, and considering them as clothing region false detections, that is, they are not actually clothing regions. The value of the first threshold may be 0.5.
[0135] (III) filtering the clothing regions whose second largest I / O value and the largest I / O value in the I / O list are greater than the first threshold, and considering them as ambiguous clothing regions belonging to multiple overlapping human body regions.
[0136] (iv) combining the target human body area corresponding to the maximum intersection-and-union ratio in the intersection-and-union ratio list, and counting the number of human body posture key nodes that are the same as those contained in the target human body area and the wearing parts of the identified style category; in response to the statistical number and the number not exceeding the second threshold, removing the clothing area.
[0137] Step 5: Extract texture features and color features from the remaining effective clothing area after removing the clothing area from the image to be processed in step 4.
[0138] Here, the remaining valid clothing area includes a clothing area whose posture category is a wearing state and / or a clothing area whose posture category is a not-wearing state.
[0139] The texture feature extraction method can refer to the relevant technology, which will not be described here. Texture features are more sensitive to changes in clothing texture.
[0140] Extract M main color components of the clothing area. The extraction can be based on the histogram statistics. The value of M can be 5.
[0141] Step 6: Clothing search.
[0142] In this step, the similarity between the texture features of each candidate style pre-extracted in the database and the texture features of the effective clothing area is calculated as the first similarity; at least one candidate style with the highest first similarity is selected for the effective clothing area. For example, five candidate styles with the highest first similarity are selected.
[0143] In practice, a database may be pre-built, and the same methods as in the second and fifth steps may be used to perform category recognition, extraction and storage of texture features and color features on each candidate style.
[0144] Step 7: Confirmation of rationality.
[0145] In this step, the candidate styles in the sixth step are reasonably confirmed, and the styles that meet the category, texture, and color similarity are output as the same style or similar style recognition results.
[0146] (I) For the clothing area whose posture category is flat, a first value is used as a threshold of texture similarity (ie, first similarity), wherein the first value may be 0.8.
[0147] (ii) For the clothing area whose posture category is wearing, the second value is used as the threshold of texture similarity. The first value may be 0.6.
[0148] (III) Confirm the second similarity between the style category of the candidate style and the style category of the clothing area output in the second step. Select the candidate styles whose style category is the same as the style category pre-identified for the valid clothing area. Specifically, if the categories are the same, the second similarity can be recorded as 1, and if the categories are different, the second similarity can be recorded as 0. For example, the category similarity between tops and bottoms is 0. Use the fourth threshold as the threshold of the second similarity. The fourth threshold can be set to 0.5. In this way, the candidate styles of the same category with a second similarity greater than 0.5 can be selected.
[0149] (IV) Calculate the third similarity between the color feature of the candidate style and the color feature of the effective clothing area, and use the fifth threshold as the threshold of the color similarity (ie, the third similarity). The value of the fifth threshold may be 0.4.
[0150] The candidate styles whose similarity does not meet (ie, is less than) one or more of the threshold constraints (i.e., one) to (iv) are filtered as unreasonable recognition results and are not output.
[0151] The solution provided by the embodiment of the present invention can identify clothing information with the same or similar styles in the product library, so as to be used in application scenarios such as clothing recommendation and sales. Compared with related technologies, this solution can effectively improve the accuracy of clothing style identification and improve user experience.
[0152] Figure 5 FIG. 1 is a schematic diagram of the structure of an image processing device provided by an embodiment of the present invention. Figure 5 As shown, the device 500 comprises:
[0153] The region detection module 501 is used to detect clothing regions and human body regions on the image to be processed;
[0154] A first determination module 502 is used for, in response to detecting at least one clothing region and at least one human body region, comparing the clothing region with each human body region, and determining whether the clothing region is a clothing region to be removed based on the comparison result, and whether the overlapping ratio of the clothing region to be removed and the human body region reaches a first threshold and the posture similarity does not exceed a second threshold;
[0155] The second determining module 503 is used to determine the clothing area other than the clothing area to be removed in the image to be processed as a valid clothing area.
[0156] In one implementation, the first determination module is specifically configured to calculate an intersection-over-union ratio between the clothing region and each human body region; based on the calculation result, determine that the clothing region is a clothing region that needs to be removed.
[0157] In one embodiment, the first determination module is specifically configured to determine that the clothing region is a clothing region to be removed in response to the maximum value of each intersection-over-union ratio being greater than or equal to a first threshold and the posture similarity corresponding to the maximum value not exceeding a second threshold.
[0158] In one embodiment, the image to be processed includes more than two human body regions, and the first determination module is specifically used to determine that the clothing region is the clothing region to be removed in response to more than two intersection-and-union ratios among the intersection-and-union ratios being greater than or equal to a first threshold.
[0159] In one embodiment, the human body region includes at least one key node of human body posture;
[0160] The first determination module is specifically used to determine the human body area corresponding to the maximum value in each intersection-and-union ratio as the target human body area; obtain the style category of the identified clothing area; obtain at least one human body posture key node contained in the wearing part of the pre-set identified style category; count the number of human body posture key nodes that are the same as those contained in the wearing part of the identified style category and the target human body area; in response to the counted number and not exceeding the second threshold, determine the clothing area as the clothing area that needs to be removed.
[0161] In one embodiment, it further includes:
[0162] The clothing recognition module is used to extract texture features of the effective clothing area; calculate the similarity between the texture features of each candidate style pre-extracted in the database and the texture features of the effective clothing area as the first similarity; and select at least one candidate style with the highest first similarity for the effective clothing area.
[0163] In one embodiment, it further includes:
[0164] The style removal module is used to remove candidate styles that do not meet preset rationality conditions from at least one candidate style in the effective clothing area.
[0165] In one embodiment, the preset rationality condition includes at least one of the following items:
[0166] The first similarity is greater than or equal to a third threshold;
[0167] The second similarity is greater than or equal to a fourth threshold, the second similarity being the similarity between the style category of the candidate style and the style category pre-identified for the valid clothing area;
[0168] The third similarity is greater than or equal to the fifth threshold, and the third similarity is the similarity between the color feature of the candidate style and the color feature of the valid clothing area.
[0169] The functions of the modules in the devices provided in the embodiments of the present invention can be found in the corresponding descriptions in the above-mentioned image processing method embodiments, which will not be described in detail here.
[0170] Figure 6 FIG. 1 is a schematic diagram of a clothing recognition device provided by an embodiment of the present invention. Figure 6 As shown, the device 600 comprises:
[0171] The image acquisition module 601 is used to acquire the picture frame in the currently played video as the image to be processed;
[0172] An image processing module 602 is used to process the image to be processed by using the image processing method in any of the above embodiments;
[0173] The information determination module 603 is used to determine the clothing information of the image to be processed based on the processing result.
[0174] The functions of the modules in the devices provided in the embodiments of the present invention can be found in the corresponding descriptions in the above-mentioned clothing recognition method embodiments, which will not be described in detail here.
[0175] The embodiment of the present invention further provides an electronic device, such as Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.
[0176] Memory 703, used for storing computer programs;
[0177] The processor 701 is used to execute the program stored in the memory 703 to implement the following steps:
[0178] Perform clothing area and human body area detection on the image to be processed; in response to detecting at least one clothing area and at least one human body area, compare the clothing area with each human body area, and determine whether the clothing area is a clothing area to be removed based on the comparison result, and whether the overlapping ratio between the clothing area to be removed and the human body area reaches a first threshold and the posture similarity does not exceed a second threshold; determine the clothing area other than the clothing area to be removed in the image to be processed as a valid clothing area;
[0179] Alternatively, a picture frame in the currently playing video is obtained as the image to be processed; the image to be processed is processed using the image processing method in any of the above embodiments; and the clothing information of the image to be processed is determined based on the processing result.
[0180] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0181] The communication interface is used for communication between the above terminal and other devices.
[0182] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0183] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0184] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer executes any of the methods described in the above embodiments.
[0185] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer is enabled to execute any of the methods described in the above embodiments.
[0186] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0187] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0188] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0189] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. An image processing method, characterized in that: include: Perform clothing area and human body area detection on the image to be processed; In response to detecting at least one clothing region and at least one human body region, the clothing region is compared with each of the human body regions, and based on the comparison result, it is determined whether the clothing region is a clothing region that needs to be removed, the overlapping ratio of the clothing region that needs to be removed and the human body region reaches a first threshold and the posture similarity does not exceed a second threshold, two or more intersection-and-union ratios of the clothing region that needs to be removed and each of the human body regions are greater than or equal to the first threshold, and the posture similarity refers to the similarity between the posture of the clothing contained in the clothing region and the posture of the human body contained in the human body region; The clothing area other than the clothing area to be removed in the image to be processed is determined as a valid clothing area.
2. The method according to claim 1, characterized in that The step of comparing the clothing region with each of the human body regions and determining whether the clothing region is a clothing region to be removed based on the comparison result includes: Calculating the intersection-over-union ratio of the clothing area and each of the human body areas; Based on the calculation result, the clothing area is determined to be a clothing area that needs to be removed.
3. The method according to claim 2, characterized in that The determining, based on the calculation result, that the clothing area is a clothing area that needs to be removed includes: In response to the maximum value of each intersection-over-union ratio being greater than or equal to the first threshold and the posture similarity corresponding to the maximum value not exceeding the second threshold, the clothing region is determined to be a clothing region that needs to be removed.
4. The method according to claim 2, characterized in that: The human body region contains at least one key node of human body posture; The determining, based on the calculation result, that the clothing area is a clothing area that needs to be removed includes: Determine the human body region corresponding to the maximum value of each intersection-over-union ratio as the target human body region; Obtaining the style category of the identified clothing area; Acquire at least one human posture key node included in the wearing part of the identified style category that is preset; Counting the number of the same human posture key nodes contained in the wearing parts of the identified style category and the target human body region; In response to the statistical number not exceeding the second threshold, the clothing area is determined as a clothing area that needs to be removed.
5. The method according to any one of claims 1 to 4, characterized in that: Also includes: Extracting texture features of the effective clothing area; Calculating the similarity between the texture features of each candidate style pre-extracted from the database and the texture features of the valid clothing area respectively as a first similarity; At least one candidate style having the highest first similarity is selected for the valid clothing area.
6. The method according to claim 5, characterized in that Also includes: For at least one of the candidate styles in the valid clothing area, the candidate styles that do not meet the preset rationality conditions are removed.
7. The method according to claim 6, characterized in that The preset rationality condition includes at least one of the following items: The first similarity is greater than or equal to a third threshold; The second similarity is greater than or equal to a fourth threshold, wherein the second similarity is the similarity between the style category of the candidate style and the style category pre-identified for the valid clothing area; The third similarity is greater than or equal to a fifth threshold, and the third similarity is the similarity between the color feature of the candidate style and the color feature of the valid clothing area.
8. A clothing recognition method, characterized in that: include: Get the picture frame in the currently playing video as the image to be processed; Processing the image to be processed using the image processing method as described in any one of claims 1 to 7; Based on the processing result, the clothing information of the image to be processed is determined.
9. An image processing device, characterized in that: include: A region detection module, used for detecting clothing regions and human body regions in the image to be processed; a first determination module, configured to, in response to detecting at least one clothing region and at least one human body region, compare the clothing region with each of the human body regions, and determine whether the clothing region is a clothing region to be removed based on the comparison result, the overlapping ratio between the clothing region to be removed and the human body region reaches a first threshold and the posture similarity does not exceed a second threshold, two or more intersection-and-union ratios of the clothing region to be removed and each of the human body regions are greater than or equal to the first threshold, and the posture similarity refers to the similarity between the posture of the clothing contained in the clothing region and the posture of the human body contained in the human body region; The second determining module is used to determine the clothing area other than the clothing area to be removed in the image to be processed as a valid clothing area.
10. A clothing recognition device, characterized in that: include: An image acquisition module is used to acquire a picture frame in a currently playing video as an image to be processed; An image processing module, configured to process the image to be processed using the image processing method according to any one of claims 1 to 7; The information determination module is used to determine the clothing information of the image to be processed based on the processing result.
11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 8 when executing a program stored in a memory.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Image evaluation device, image evaluation method, program, and integrated circuit
CN103098088A
Cross-scene clothes retrieval method based on image rendering
CN108109055A
Clothing identification method, system and terminal based on human body key node prediction
CN110188701A
Costume identification method and device, equipment and medium
CN111553327A
Image fusion method and device, computer equipment and storage medium
CN111768507A
