Method and system for determining shooting angle of clothing
By extracting the target area and color blocks from the clothing shooting images and calculating the clothing shooting angle, the problem of high time and economic costs in the prior art is solved, and efficient clothing shooting angle determination is achieved.
Patent Information
- Application Number
- CN202110008371.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-05
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2041-01-05
AI Technical Summary
In the non-contact anthropometric measurement in the prior art, determining the angle of clothing shooting requires training models, resulting in high time and economic costs.
By extracting the target area, color block and dividing line from the clothing photographed image, calculate the angle between the target dividing line and the reference line, combine the recognition of color blocks and Hough transformation, calculate the shooting angle of the clothing, avoiding the training model dependency.
It greatly saves time and economic costs, realizes the determination of the clothing shooting angle, and reduces the computational complexity and cost.
Smart Images

Figure CN112734856B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of non-contact human body measurement, and in particular to a method and system for determining a shooting angle of clothing. Background Art
[0002] In recent years, the latest research results of computer vision graphics and geometry have also been applied to the construction of virtual mannequins. In the prior art, the mannequin on the measuring table is rotated to a certain angle and then photographed with a digital camera. The photographed image is input into a training model, and the shooting angle is obtained through the training model. Then, the characteristic points and corresponding dimensions of the human body corresponding to the shooting angle are obtained according to the shooting angle, and then the virtual mannequin is constructed. However, such a method requires training the model, which is time-consuming and economically expensive. Summary of the invention
[0003] The purpose of the present application is to provide a method and system for determining the shooting angle of clothing, so as to solve the technical problems of high time and economic cost in non-contact human body measurement.
[0004] The present application provides a method for determining a shooting angle of clothing, comprising: obtaining an image of a target area from a clothing shooting image, as a first image, the clothing shooting image includes a mannequin, a part of a turntable fixed to the mannequin, and a reference position, the reference position is located on the outer edge of the top surface of the turntable, a plurality of color blocks are evenly arranged along the circumference of the turntable, and the target area includes a part of the turntable; processing the first image to obtain a second image, obtaining a color block near the reference position and a target dividing line and an angle between the target dividing line and a front center line of the mannequin from the second image, as a first angle, the front center line of the mannequin is the intersection of an axial symmetric plane from the face to the back of the mannequin and the top surface of the turntable; calculating the angle between the target dividing line and the reference line, as a second angle, the reference line is a line connecting the reference position and the center point of the top surface of the turntable; calculating the sum or difference of the first angle and the second angle, as the shooting angle of the clothing.
[0005] Preferably, obtaining the color blocks and target dividing lines near the reference position from the second image includes the following steps: determining each color block of the second image by identifying color values; taking the line connecting the pixel points where the color value changes between two adjacent color blocks as the dividing line of the color blocks; calculating the first distance value between the reference position and each dividing line; taking the dividing line whose first distance value is less than the first distance threshold as the dividing line of the color blocks near the reference position; taking any dividing line of the dividing lines of the color blocks near the reference position as the target dividing line; and taking the color block between the target dividing line and the dividing line adjacent to it as the color block near the reference position.
[0006] Preferably, calculating the second angle includes the following steps: constructing a virtual coordinate system, in which the reference line is parallel to the longitudinal axis of the virtual coordinate system; detecting the slope of the target dividing line; calculating the angle between the target dividing line and the horizontal axis of the virtual coordinate system according to the slope as the third angle; if the slope is positive, calculating the complementary angle of the third angle as the second angle; if the slope is negative, calculating the complementary angle of the supplementary angle of the third angle as the second angle.
[0007] Preferably, the boundary line with the smallest first distance value among the boundary lines of the color block near the reference position is used as the target boundary line.
[0008] Preferably, if the slope is positive, the sum of the first angle and the second angle is used as the shooting angle of the clothing; if the slope is negative, the difference between the first angle and the second angle is used as the shooting angle of the clothing.
[0009] Preferably, the captured clothing image also includes a reference line; obtaining a color block near the reference position and a target dividing line from the second image includes the following steps: determining the pixel coordinates of each color block, the reference position and the reference line of the second image by identifying the color value; detecting the reference line and multiple dividing lines in the second image by Hough transform, wherein the multiple dividing lines intersect with the reference line after the Hough transform, and the intersection points are all the center points of the top surface of the turntable; calculating the second distance value between the first pixel point on the reference line and the second pixel point on each dividing line, wherein the first pixel point and the second pixel points of all the dividing lines are located on the same straight line, and the first pixel point and the second pixel point do not overlap; taking the dividing line with the smallest second distance value as the target dividing line; and taking the color block between the target dividing line and the dividing line adjacent to it as the color block near the reference position.
[0010] Preferably, the second angle is obtained by detecting the angle between the target boundary line and the reference line after the Hough transformation.
[0011] Preferably, the image of the target area is obtained by a threshold segmentation algorithm.
[0012] Preferably, when shooting the clothing image, the shooting direction of the camera is parallel to the reference line.
[0013] The present application also provides a system for determining a shooting angle of clothing, including a processor, and the processor executes the above-mentioned method for determining a shooting angle of clothing. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0015] Figure 1 is a flow chart of a method for determining a shooting angle of clothing provided by the present application;
[0016] Figure 2 is a flow chart of obtaining a color block near a reference position and a target boundary line from a second image in an embodiment provided by the present application;
[0017] Figure 3 is a flow chart of calculating the second angle in one embodiment provided by the present application;
[0018] Figure 4 This is a flowchart of obtaining a color block near a reference position and a target boundary line from a second image in another embodiment provided by the present application. DETAILED DESCRIPTION
[0019] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0020] Embodiment 1
[0021] Figure 1 FIG. 1 is a flow chart of a method for determining a shooting angle of clothing provided by the present application. Figure 1 As shown, the method for determining the shooting angle of clothing includes the following steps:
[0022] S110: Acquire clothing shot images. The clothing shot images are images obtained by shooting the mannequin assembly in the dressed state using a camera. The mannequin assembly includes a base, a turntable and a mannequin. The turntable is rotatably arranged on the base. The turntable rotates along its vertical central axis. A plurality of fan-shaped color blocks of different colors are evenly arranged on the top surface of the turntable along the circumferential direction, that is, the arc of the fan-shaped area of each color block is the same. A reference point is provided on the outer edge of the top surface of the turntable as a reference position for the rotation of the mannequin. The color of the reference position is different from the color of the color block where it is located. The mannequin is fixed on the top surface of the turntable, and the central axis of the mannequin coincides with the central axis of the turntable. The clothing shot image includes the mannequin, a part of the turntable and the reference position. The intersection of the axial symmetry plane in the direction from the face to the back of the mannequin and the top surface of the turntable is recorded as the front center line of the mannequin. The line between the reference position and the center point of the top surface of the turntable is used as the reference line. As an embodiment, a reference line is provided on the mannequin assembly. As another embodiment, no reference line is provided on the mannequin assembly, and the reference line is a virtual line.
[0023] Preferably, when shooting the clothing image, the shooting direction of the camera is parallel to the reference line.
[0024] Specifically, in the initial state of the turntable, the front center line of the mannequin coincides with the reference line, the rotation direction of the turntable is counterclockwise, and the shooting angle of the clothing is the rotation angle of the turntable.
[0025] S120: Obtain an image of a target area from the clothing image as a first image, the target area includes a part of a turntable, and the image of the turntable in the clothing image is extracted as a basis for obtaining the shooting angle. As an embodiment, the image of the target area is obtained by a threshold segmentation algorithm.
[0026] S130: Process the first image to obtain a second image, and obtain the color block near the reference position and the target boundary line and the angle between the target boundary line and the front center line of the mannequin from the second image as the first angle. Specifically, the first angle is the angle between the target boundary line and the front center line of the mannequin in the counterclockwise direction.
[0027] Specifically, as an embodiment, the processing of the first image includes image noise reduction and image enhancement.
[0028] S140: Calculate the angle between the target boundary line and the reference line as the second angle.
[0029] S150: Calculate the sum or difference between the first angle and the second angle as the shooting angle of the clothing.
[0030] As an example, when no reference line is set on the mannequin component, Figure 2 As shown, obtaining the color block near the reference position and the target boundary line from the second image includes the following steps:
[0031] S210: Determine each color block and reference position of the second image by identifying color values.
[0032] S220: Using a line connecting the pixel points where the color values of two adjacent color blocks change as a boundary line of the color blocks.
[0033] S230: Calculate a first distance value between the reference position and each boundary line.
[0034] S240: Using a boundary line whose first distance value is less than a first distance threshold as a boundary line of a color block near the reference position.
[0035] S250: taking any boundary line of the color block near the reference position as a target boundary line.
[0036] S260: The color block between the target boundary line and the boundary line adjacent to it is used as the color block near the reference position.
[0037] The angle between each dividing line on the turntable and the relative position of the front center line of the mannequin is preset. Therefore, after obtaining the target dividing line, the first angle can be determined according to the preset value.
[0038] On this basis, if Figure 3 As shown, calculating the second angle in S140 includes the following steps:
[0039] S310: constructing a virtual coordinate system, according to the shooting direction, with the reference line being parallel to the vertical axis of the virtual coordinate system.
[0040] S320: Detect the slope of the target boundary line.
[0041] S330: Calculate the angle between the target boundary line and the horizontal axis of the virtual coordinate system according to the slope as the third angle.
[0042] S340: Determine whether the slope is positive. If yes, execute S350; otherwise, execute S360.
[0043] S350: Calculate the complementary angle of the third angle as the second angle.
[0044] S360: Calculate the complementary angle of the supplementary angle of the third angle as the second angle.
[0045] Preferably, the boundary line with the smallest first distance value among the boundary lines of the color blocks near the reference position is used as the target boundary line. On this basis, if the slope of the target boundary line is positive, the sum of the first angle and the second angle is used as the shooting angle of the clothing; if the slope of the target boundary line is negative, the difference between the first angle and the second angle is used as the shooting angle of the clothing.
[0046] As another embodiment, in the case where a reference line is provided on the mannequin component, such as Figure 4 As shown, obtaining the color block near the reference position and the target boundary line from the second image includes the following steps:
[0047] S410: Determine pixel coordinates of each color block, reference position, and reference line of the second image by identifying color values.
[0048] S420: Detecting a reference line and a plurality of boundary lines in the second image by Hough transformation. After Hough transformation, the plurality of boundary lines intersect with the reference line, and the intersection points are all the center points of the top surface of the turntable.
[0049] S430: Calculate a second distance value between a first pixel point on the reference line and a second pixel point on each boundary line, wherein the first pixel point and the second pixel points of all boundary lines are located on the same straight line, and the first pixel point and the second pixel point do not overlap.
[0050] S440: Taking the boundary line with the smallest second distance value as the target boundary line.
[0051] S450: The color block between the target boundary line and the boundary line adjacent to it is used as the color block near the reference position.
[0052] The angle between each dividing line on the turntable and the relative position of the front center line of the mannequin is preset. Therefore, after obtaining the target dividing line, the first angle can be determined according to the preset value.
[0053] On this basis, the second angle is obtained by detecting the angle between the target boundary line and the reference line after the Hough transform.
[0054] The relative position of the target dividing line and the color block near the reference position includes two situations: the target dividing line is on the side of the color block near the reference position far from or close to the front center line. If the target dividing line is on the side of the color block near the reference position far from the front center line, the difference between the first angle and the second angle is used as the shooting angle of the clothing. If the target dividing line is on the side of the color block near the reference position close to the front center line, the sum of the first angle and the second angle is used as the shooting angle of the clothing.
[0055] Embodiment 2
[0056] The present application also provides a system for determining a shooting angle of clothing, which includes a processor that executes the above-mentioned method for determining a shooting angle of clothing.
[0057] This application adds color blocks on the turntable at the bottom of the mannequin to assist in calculating the shooting angle of the clothing, without the need to train the model, greatly saving time and economic costs.
[0058] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application. Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for determining a shooting angle of clothing, characterized in that: include: An image of a target area is obtained from a clothing shot image as a first image, wherein the clothing shot image includes a mannequin, a portion of a turntable fixed to the mannequin, a reference position and a reference line, wherein the reference position is located on the outer edge of the top surface of the turntable, a plurality of color blocks are evenly arranged on the top surface of the turntable along the circumferential direction, and the plurality of color blocks are fan-shaped color blocks of different colors, and the target area includes a portion of the turntable; a reference point is arranged on the outer edge of the top surface of the turntable as a reference position for the mannequin to rotate, and the color of the reference position is different from the color of the color block where the reference position is located; Processing the first image to obtain a second image, obtaining from the second image a color block near the reference position and a target boundary line, and an angle between the target boundary line and a front center line of the mannequin as a first angle, wherein the front center line of the mannequin is an intersection line of an axial symmetry plane in a direction from the face to the back of the mannequin and a top surface of the turntable; Calculating the angle between the target dividing line and a reference line as a second angle, wherein the reference line is a line connecting the reference position and the center point of the top surface of the turntable; Calculating the sum or difference between the first angle and the second angle as the shooting angle of the clothing; Wherein, obtaining the color block and the target boundary line near the reference position from the second image comprises the following steps: Determining each color block of the second image by identifying color values; The line connecting the pixels where the color values of two adjacent color blocks change is used as the boundary line of the color blocks; Calculating a first distance value between the reference position and each dividing line; Using a boundary line whose first distance value is less than a first distance threshold as a boundary line of a color block near a reference position; Any boundary line of the color block near the reference position is used as the target boundary line; The color block between the target dividing line and the dividing line adjacent to it is used as the color block near the reference position.
2. The determination method according to claim 1, characterized in that: Calculating the second angle includes the following steps: constructing a virtual coordinate system, wherein the reference line is parallel to the longitudinal axis of the virtual coordinate system; Detecting the slope of the target dividing line; Calculate the angle between the target dividing line and the horizontal axis of the virtual coordinate system according to the slope as a third angle; If the slope is positive, the complementary angle of the third angle is calculated as the second angle; if the slope is negative, the complementary angle of the supplementary angle of the third angle is calculated as the second angle.
3. The determination method according to claim 2, characterized in that: The boundary line with the smallest first distance value among the boundary lines of the color block near the reference position is used as the target boundary line.
4. The determination method according to claim 3, characterized in that: If the slope is positive, the sum of the first angle and the second angle is used as the shooting angle of the clothing; If the slope is negative, the difference between the first angle and the second angle is used as the shooting angle of the clothing.
5. The determination method according to claim 1, characterized in that: Obtaining the color block and the target boundary line near the reference position from the second image comprises the following steps: Determine the pixel coordinates of the reference position and the reference line by identifying the color value; Detecting the reference line and multiple boundary lines in the second image by Hough transform, wherein the multiple boundary lines intersect with the reference line after Hough transform, and the intersection points are all the center points of the top surface of the turntable; Calculating a second distance value between a first pixel point on the reference line and a second pixel point on each boundary line, wherein the first pixel point and the second pixel points of all boundary lines are located on the same straight line, and the first pixel point and the second pixel point do not overlap; The boundary line with the smallest second distance value is used as the target boundary line.
6. The determination method according to claim 5, characterized in that: The second angle is obtained by detecting the angle between the target boundary line after Hough transformation and the reference line.
7. The determination method according to claim 1, characterized in that: The image of the target area is obtained through the threshold segmentation algorithm.
8. The determination method according to claim 1, characterized in that: When shooting the clothing image, the shooting direction of the camera is parallel to the reference line.
9. A system for determining the shooting angle of clothing, characterized in that: The device comprises a processor, wherein the processor executes the method for determining the shooting angle of the clothing according to any one of claims 1 to 8.
