Image processing method, image processing device, server and storage medium
By capturing the feature points and global feature relationships of objects to be processed in the image, the problem of difficulty in accurately covering image processing in the prior art is solved, and efficient and accurate image processing effects are achieved.
Patent Information
- Application Number
- CN202111399757.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-24
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2041-11-24
AI Technical Summary
It is difficult for existing image processing technologies to accurately and efficiently identify and process objects to be processed in the image, especially when covering the target area, which can easily lead to unnecessary processing of the background and affect the aesthetics and quality of the image.
By capturing multiple feature points at the edge of the local feature of the object to be processed in the image, the image capture figure is determined based on the attribute relationship between the local feature and the global feature, and the key points are determined based on the feature points, thereby determining the target area covering the object to be processed.
Accurate coverage of the to-be-processed objects in the image is achieved, the processing of the background is reduced, the accuracy and aesthetics of the image processing are improved, and the target area of the image processing is ensured that the target area of the image processing is completely covered by the to-be-processed objects and covers as little other areas as possible.
Smart Images

Figure CN114170256B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of image processing technology, and in particular to an image processing method, an image processing device, a server, and a storage medium. Background Art
[0002] The 21st century is an era full of information. Images, as the visual basis for human perception of the world, are an important means for humans to obtain, express and transmit information. Image processing is a technology that uses computers to analyze images to achieve the desired results. Image processing technology can help people understand the world more objectively and accurately, which is of great benefit to human life. Summary of the invention
[0003] Embodiments of the present invention provide an image processing method, an image processing device, a server, and a storage medium.
[0004] The image processing method provided in the first aspect of the embodiment of the present disclosure includes:
[0005] Capturing multiple feature points of local feature edges of the object to be processed in the image;
[0006] determining an image capture pattern according to an attribute relationship between the local feature and the global feature of the object to be processed;
[0007] Based on the image capture pattern, determining key points among the plurality of feature points;
[0008] According to the key points, a target area for image processing is determined.
[0009] In one embodiment, determining the target area for image processing at least includes:
[0010] The determined target area completely covers the object to be processed in the image.
[0011] In one embodiment, the attribute relationship between the local feature and the global feature includes at least one of the following:
[0012] The regional position relationship between the local features and the global features;
[0013] The area ratio relationship between the local features and the global features.
[0014] In one embodiment, determining the key point from the plurality of feature points includes:
[0015] Key points satisfying preset positions and the number of the key points satisfying the preset positions are determined from the plurality of feature points.
[0016] In one embodiment, the image capture graphics include at least one of the following:
[0017] Oval shapes, polygonal shapes, circular shapes, and triangular shapes.
[0018] In one embodiment, the method further comprises:
[0019] When it is determined that the object to be processed in the image is a human head, the local features are facial features, and the global features are all features of the head, the image capture pattern is determined to be an elliptical pattern.
[0020] In one embodiment, the method further comprises:
[0021] When it is determined that the object to be processed in the image is a human head, the local features are facial features, and the global features are all features of the head, determining the key points from the multiple feature points at least includes:
[0022] Determine the feature point located at the center of the eyebrows as the first key point;
[0023] Determine the feature point located at the temple as the second key point;
[0024] The feature point located at the bottom of the chin is determined as the third key point.
[0025] In one embodiment, determining the target area for image processing according to the key points at least includes:
[0026] Determining the first key point as the origin of the elliptical image capture figure;
[0027] Determine the distance between the third key point and the first key point as the length of the major semi-axis of the elliptical image capture figure;
[0028] Determine that the longest distance between the second key point and the first key point is the length of the minor semi-axis of the elliptical image capture figure;
[0029] The target area for image processing is determined based on the origin, the major semi-axis, and the minor semi-axis.
[0030] In one embodiment, determining the target area for image processing based on the origin, the major semi-axis, and the minor semi-axis at least includes:
[0031] Determine a first target area based on the origin, the major semi-axis, and the minor semi-axis;
[0032] Based on the first target area, a second target area is obtained symmetrically along the ellipse symmetry axis;
[0033] The first target region and the second target region are merged to obtain the target region.
[0034] According to a second aspect of the present disclosure, an image processing device includes:
[0035] A first processing unit is used to capture multiple feature points of local feature edges of the object to be processed in the image;
[0036] A second processing unit, configured to determine an image capture pattern according to an attribute relationship between the local feature and the global feature of the object to be processed;
[0037] A third processing unit, configured to determine a key point from among the plurality of feature points based on the image capture pattern;
[0038] The fourth processing unit is used to determine a target area for image processing according to the key points.
[0039] In one embodiment, the target area determined by the fourth processing unit completely covers the object to be processed in the image.
[0040] In one embodiment, the attribute relationship between the local feature and the global feature includes at least one of the following:
[0041] The regional position relationship between the local features and the global features;
[0042] The area ratio relationship between the local features and the global features.
[0043] In one embodiment, the third processing unit is specifically configured to
[0044] Key points satisfying preset positions and the number of the key points satisfying the preset positions are determined from the plurality of feature points.
[0045] In one embodiment, the image capture graphics include at least one of the following:
[0046] Oval shapes, polygonal shapes, circular shapes, and triangular shapes.
[0047] In one embodiment, the second processing unit is further configured to
[0048] When it is determined that the object to be processed in the image is a human head, the local features are facial features, and the global features are all features of the head, the image capture pattern is determined to be an elliptical pattern.
[0049] In one embodiment, the third processing unit is further configured to:
[0050] When it is determined that the object to be processed in the image is a human head, the local features are facial features, and the global features are all features of the head,
[0051] Determine the feature point located at the center of the eyebrows as the first key point;
[0052] Determine the feature point located at the temple as the second key point;
[0053] The feature point located at the bottom of the chin is determined as the third key point.
[0054] In one embodiment, the fourth processing unit is specifically configured to
[0055] Determining the first key point as the origin of the elliptical image capture figure;
[0056] Determine the distance between the third key point and the first key point as the length of the major semi-axis of the elliptical image capture figure;
[0057] Determine that the longest distance between the second key point and the first key point is the length of the minor semi-axis of the elliptical image capture figure;
[0058] The target area for image processing is determined based on the origin, the major semi-axis, and the minor semi-axis.
[0059] In one embodiment, the fourth processing unit is further configured to:
[0060] Determine a first target area based on the origin, the major semi-axis, and the minor semi-axis;
[0061] Based on the first target area, a second target area is obtained symmetrically along the ellipse symmetry axis;
[0062] The first target region and the second target region are merged to obtain the target region.
[0063] A third aspect of an embodiment of the present disclosure provides a terminal, comprising: a processor and a memory for storing a computer program that can be run on the processor, wherein the processor executes the steps of the method described in the first aspect when running the computer program.
[0064] A fourth aspect of an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in the first aspect above.
[0065] The image processing method of the disclosed embodiment captures multiple feature points of the local feature edge of the object to be processed in the image; determines an image capture pattern based on the attribute relationship between the local feature and the global feature of the object to be processed; determines key points among the multiple feature points based on the image capture pattern; and determines the target area for image processing based on the key points. In the present application, when image processing is performed by the image processing method, an image capture pattern for determining the target area is determined based on the attribute relationship between the local feature and the global feature of the object to be processed, and key points are determined specifically based on the image capture pattern as needed, and the target area for image processing is determined based on the key points. Since the attribute relationship between the local feature and the global feature of the object to be processed can be determined by the edge of the local feature and the edge of the global feature, and the key points are selected from the edge feature points, it is possible to achieve that the target area determined based on the key points can completely cover the object to be processed in the image and cover as little area as possible outside the object to be processed in the image, thereby achieving image processing to be processed in the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 is a flow chart of an image processing method according to an exemplary embodiment;
[0067] Figure 2 is a schematic diagram of capturing feature points according to an exemplary embodiment;
[0068] Figure 3 is a schematic diagram showing key point determination in an image according to an exemplary embodiment;
[0069] Figure 4 is a schematic diagram showing determination of an elliptical graphic matching a human face according to an exemplary embodiment;
[0070] Figure 5 is a schematic diagram of performing face beautification processing in an image based on an image processing method according to an exemplary embodiment;
[0071] Figure 6 is a flow chart of an image beautification method according to an exemplary embodiment;
[0072] Figure 7 is a schematic diagram showing the structure of an image processing device according to an exemplary embodiment;
[0073] Figure 8 is a schematic diagram of a terminal structure according to an exemplary embodiment. DETAILED DESCRIPTION
[0074] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0075] Figure 1 FIG. 1 is a flowchart of an image processing method according to an exemplary embodiment. Figure 1 As shown, the test method based on the protocol interface includes:
[0076] Step S100, capturing multiple feature points of local feature edges of the object to be processed in the image;
[0077] Step S110, determining an image capture pattern according to the attribute relationship between the local feature and the global feature of the object to be processed;
[0078] Step S120: determining key points from the plurality of feature points based on the image capture pattern;
[0079] Step S130: Determine a target area for image processing according to the key points.
[0080] In an exemplary embodiment, the image processing method can be applied to a captured image or to a frame image captured online. The object to be processed can be a person determined in the image or a scene or other object determined in the image. Image processing can include any processing method such as image beautification, image brightness adjustment, pixel color adjustment, etc.
[0081] In an exemplary embodiment, Figure 2 FIG. 1 is a schematic diagram of feature point capture according to an exemplary embodiment. Figure 2 As shown, the feature points of the local feature edges of the object to be processed can be captured. Figure 2 The numbers 0 to 100 shown are all feature points.
[0082] In an exemplary embodiment, the attribute relationship between the local feature and the global feature of the object to be processed may be a relative relationship between the local feature and the global feature formed by the local feature edge and the global feature edge, for example, a relative relationship of regional positions, a relative relationship of regional areas, etc.
[0083] In an exemplary embodiment, the plurality of feature points of the local feature edge of the object to be processed in the captured image include:
[0084] The image to be processed is input into the feature tracking engine, and the tracking engine is used to capture multiple feature points of the local feature edges of the object to be processed in the image.
[0085] In an exemplary embodiment, an image capture pattern is determined based on the attribute relationship between the local feature and the global feature of the object to be processed. The image capture pattern is used to determine a target area for image processing of the object to be processed.
[0086] In an exemplary embodiment, the attribute relationship between the local feature and the global feature includes at least one of the following:
[0087] The regional position relationship between the local features and the global features;
[0088] The area ratio relationship between the local features and the global features.
[0089] The image capture pattern is determined based on the regional position relationship and / or regional area ratio relationship between the local feature and the global feature.
[0090] For example, according to the regional position relationship between the local feature and the global feature, and / or the regional area ratio relationship, the region where the local feature is located and the region where the global feature is located are determined as follows:
[0091] When the global feature region is a rectangular region and the local feature region is a sub-rectangular region with the same length as one side of the global feature region, the image capture pattern can be determined to be a rectangular pattern;
[0092] When the global feature region is an elliptical region and the local feature region is a semi-elliptical region in the global feature region, the image capture pattern can be determined to be an elliptical pattern;
[0093] When the global feature region is a triangular region and the local feature region is a sub-triangular region that overlaps with two triangular edges in the global feature region, the image capture pattern can be determined to be a triangular pattern. In this way, the image capture pattern that is easy to cover the global feature region can be determined through the attribute relationship between the local feature and the global feature of the object to be processed.
[0094] When the image processing method of the disclosed embodiment performs image processing through the image processing method, an image capture pattern that is easy to cover the global feature area can be determined through the attribute relationship between the local features and the global features of the object to be processed, and key points can be determined according to the required image capture pattern, and the target area for image processing can be accurately determined according to the key points. Since the attribute relationship between the local features and the global features of the object to be processed can be determined by the edges of the local features and the edges of the global features, and the key points are selected from the edge feature points, it is possible to achieve that the target area determined according to the key points can completely cover the object to be processed in the image and cover as little area outside the object to be processed as possible, thereby achieving image processing of the image to be processed.
[0095] In one embodiment, determining the target area for image processing at least includes:
[0096] The determined target area completely covers the object to be processed in the image.
[0097] In an exemplary embodiment, after determining an image capture pattern that easily covers the global feature area through the attribute relationship between the local features and the global features of the object to be processed, an accurate and complete image capture pattern can be determined through key points. The target area captured by the image capture pattern determined by the key points can completely cover the object to be processed in the image.
[0098] In one embodiment, determining the key point from the plurality of feature points includes:
[0099] Key points satisfying preset positions and the number of the key points satisfying the preset positions are determined from the plurality of feature points.
[0100] In an exemplary embodiment, the feature points are pixel points captured by the edge of a local feature, and these feature points can construct the contours of multiple local features. Key points that meet preset positions are determined from the multiple feature points, and a target area that can completely cover the object to be processed in the image is determined based on the key points that meet the preset positions. The determination of the target area can be completed based on a specific image capture pattern constructed based on the key points.
[0101] In one embodiment, the image capture graphics include at least one of the following:
[0102] Oval shapes, polygonal shapes, circular shapes, and triangular shapes.
[0103] In an exemplary embodiment, different image capture patterns may be determined according to different attribute relationships between local features and global features of the object to be processed.
[0104] The attribute relationship between the local feature and the global feature includes at least one of the following:
[0105] The regional position relationship between the local features and the global features;
[0106] The area ratio relationship between the local features and the global features.
[0107] According to the regional position relationship between the local feature and the global feature, and / or the regional area ratio relationship, the region where the local feature is located and the region where the global feature is located are determined as follows:
[0108] When the global feature region is a rectangular region and the local feature region is a sub-rectangular region with the same length as one side of the global feature region, the image capture pattern can be determined to be a rectangular pattern;
[0109] When the global feature region is an elliptical region and the local feature region is a semi-elliptical region in the global feature region, the image capture pattern can be determined to be an elliptical pattern;
[0110] When the global feature region is a triangular region and the local feature region is a sub-triangular region that overlaps with two triangular edges in the global feature region, the image capture pattern can be determined to be a triangular pattern. In this way, the image capture pattern that is easy to cover the global feature region can be determined through the attribute relationship between the local feature and the global feature of the object to be processed.
[0111] In one embodiment, the method further comprises:
[0112] When it is determined that the object to be processed in the image is a human head, the local features are facial features, and the global features are all features of the head, the image capture pattern is determined to be an elliptical pattern.
[0113] In an exemplary embodiment, the image processing method can be applied to face image processing. It is determined that the object to be processed is a human head, all features of the head are global features, and facial features are local features. Since most human faces are semi-oval, and the face part is longer than the forehead part, when image processing is performed on the head image of a semi-oval face, the image capture pattern can be determined to be an elliptical pattern.
[0114] In addition, when the face of a person in the image is a square face, the image capture pattern can also be determined to be a rectangular pattern.
[0115] When determining key points based on the image capture figure, the key points corresponding to different figures will be different. For example, when the image capture figure is an elliptical figure, the key points need to be determined as the origin, the major axis endpoint, and the minor axis endpoint required to construct the corresponding elliptical figure. When the image capture figure is a rectangular figure, the key points need to be determined as at least three vertices required to construct the corresponding rectangular figure.
[0116] In one embodiment, the method further comprises:
[0117] When it is determined that the object to be processed in the image is a human head, the local features are facial features, and the global features are all features of the head, determining the key points from the multiple feature points at least includes:
[0118] Determine the feature point located at the center of the eyebrows as the first key point;
[0119] Determine the feature point located at the temple as the second key point;
[0120] The feature point located at the bottom of the chin is determined as the third key point.
[0121] In an exemplary embodiment, Figure 3 FIG. 1 is a schematic diagram showing how to determine key points in an image according to an exemplary embodiment. Figure 3As shown, when the face in the image is a semi-elliptical face, according to the matching degree between the face contour and the ellipse, the feature point located at the center of the eyebrows can be determined as the first key point P3;
[0122] Determine the feature point located at the temple as the second key point P1 or P2;
[0123] The feature point located at the bottom of the chin is determined to be the third key point P0.
[0124] In an exemplary embodiment, Figure 4 FIG. 1 is a schematic diagram showing how to determine an elliptical shape that matches a face according to an exemplary embodiment. Figure 4 As shown, the determining of the target area for image processing according to the key points at least includes:
[0125] Determining the first key point P3 as the origin of the elliptical image capture figure;
[0126] Determine the distance between the third key point P0 and the first key point as the length of the major semi-axis of the elliptical image capture figure;
[0127] Determine the longest distance between the second key point P1 (P2) and the first key point P3 as the length of the minor semi-axis of the elliptical image capture figure;
[0128] The target area for image processing is determined based on the origin, the major semi-axis, and the minor semi-axis.
[0129] In an exemplary embodiment, the entire elliptical figure is determined as a target area for image processing through the first key point, the second key point, and the third key point.
[0130] In an exemplary embodiment, in order to ensure that the target area completely covers the human head when the entire elliptical figure is used as the target area for image processing, when determining the first key point and the second key point, the point farthest from the central axis of the face among the captured feature points can be used as the first key point or the second key point, and the farthest distance between the first key point and the third key point and the distance between the second key point and the third key point is used as the length of the major semi-axis of the constructed ellipse. Figure 5 FIG. 1 is a schematic diagram of performing face beautification processing in an image based on an image processing method according to an exemplary embodiment. Figure 5 As shown in the figure, there are black spots on the face in the original image. The traditional method of full-image beautification processing will cause the face and background to be beautified, which easily creates a disharmony between the face and the background. Through the image processing method of the present application, the head area can be determined as the target area, so that only the head area is beautified without processing the background, making the image harmonious and beautiful.
[0131] In one embodiment, determining the target area for image processing based on the origin, the major semi-axis, and the minor semi-axis at least includes:
[0132] Determine a first target area based on the origin, the major semi-axis, and the minor semi-axis;
[0133] Based on the first target area, a second target area is obtained symmetrically along the ellipse symmetry axis;
[0134] The first target region and the second target region are merged to obtain the target region.
[0135] In an exemplary embodiment, when specifically determining the target area of the elliptical graphic, the half elliptical area corresponding to the human face part can be determined as the first target area by determining the origin, the major semi-axis, and the minor semi-axis; then, the second target area covering the human head is obtained symmetrically through the first target area and the elliptical symmetry axis; finally, the entire elliptical graphic target area is obtained by merging the first target area and the second target area.
[0136] Figure 6 FIG. 1 is a flow chart of an image beautification method according to an exemplary embodiment. Figure 6 As shown, the image beautification method includes:
[0137] Step 210: Obtain a user's face image;
[0138] Step 211, input the image to the face tracking engine to capture feature points;
[0139] Step 212: determining key points of the face from the feature points;
[0140] Step 213: Determine the target area of the lower half of the face according to the key points;
[0141] Step 214: determine the target area of the upper part of the face according to the key points;
[0142] Step 215: Perform beauty processing on the determined face target area.
[0143] The embodiment of the present disclosure also provides an image processing device. Figure 7 FIG. 1 is a schematic diagram showing the structure of an image processing device according to an exemplary embodiment. Figure 7 As shown, including:
[0144] The first processing unit 71 is used to capture multiple feature points of the local feature edges of the object to be processed in the image;
[0145] A second processing unit 72, configured to determine an image capture pattern according to an attribute relationship between the local feature and the global feature of the object to be processed;
[0146] A third processing unit 73, configured to determine a key point from among the plurality of feature points based on the image capture pattern;
[0147] The fourth processing unit 74 is used to determine a target area for image processing according to the key points.
[0148] In an exemplary embodiment, the image processing device can be applied to a captured picture or a frame image captured online. The object to be processed can be a person determined in the image or a scene or other object determined in the image. Image processing can include: image beautification, image brightness adjustment, pixel color adjustment, etc.
[0149] In an exemplary embodiment, the attribute relationship between the local feature and the global feature of the object to be processed may be a relative relationship between the local feature and the global feature formed by the local feature edge and the global feature edge, for example, a relative relationship of regional positions, a relative relationship of regional areas, etc.
[0150] In an exemplary embodiment, the plurality of feature points of the local feature edge of the object to be processed in the captured image include:
[0151] The image to be processed is input into the feature tracking engine, and the tracking engine is used to capture multiple feature points of the local feature edges of the object to be processed in the image.
[0152] In an exemplary embodiment, an image capture pattern is determined based on the attribute relationship between the local feature and the global feature of the object to be processed. The image capture pattern is used to determine a target area for image processing of the object to be processed.
[0153] In an exemplary embodiment, the attribute relationship between the local feature and the global feature includes at least one of the following:
[0154] The regional position relationship between the local features and the global features;
[0155] The area ratio relationship between the local features and the global features.
[0156] The image capture pattern is determined based on the regional position relationship and / or regional area ratio relationship between the local feature and the global feature.
[0157] For example, according to the regional position relationship between the local feature and the global feature, and / or the regional area ratio relationship, the region where the local feature is located and the region where the global feature is located are determined as follows:
[0158] When the global feature region is a rectangular region and the local feature region is a sub-rectangular region with the same length as one side of the global feature region, the image capture pattern can be determined to be a rectangular pattern;
[0159] When the global feature region is an elliptical region and the local feature region is a semi-elliptical region in the global feature region, the image capture pattern can be determined to be an elliptical pattern;
[0160] When the global feature region is a triangular region and the local feature region is a sub-triangular region that overlaps with two triangular edges in the global feature region, the image capture pattern can be determined to be a triangular pattern. In this way, the image capture pattern that is easy to cover the global feature region can be determined through the attribute relationship between the local feature and the global feature of the object to be processed.
[0161] When the image processing device of the disclosed embodiment performs image processing through the image processing device, the image capture pattern that is easy to cover the global feature area can be determined through the attribute relationship between the local features and the global features of the object to be processed, and the key points can be determined according to the required image capture pattern, and the target area for image processing can be accurately determined according to the key points. Since the attribute relationship between the local features and the global features of the object to be processed can be determined by the edges of the local features and the edges of the global features, it can be achieved that the target area determined according to the key points can completely cover the object to be processed in the image and cover as little area outside the object to be processed as possible, thereby achieving image processing of the image to be processed in the image.
[0162] In one embodiment, the target area determined by the fourth processing unit completely covers the object to be processed in the image.
[0163] In an exemplary embodiment, after determining an image capture pattern that easily covers the global feature area through the attribute relationship between the local features and the global features of the object to be processed, an accurate and complete image capture pattern can be determined through key points. The target area captured by the image capture pattern determined by the key points can completely cover the object to be processed in the image.
[0164] In one embodiment, the third processing unit is specifically configured to
[0165] Key points satisfying preset positions and the number of the key points satisfying the preset positions are determined from the plurality of feature points.
[0166] In an exemplary embodiment, after determining an image capture pattern that easily covers the global feature area through the attribute relationship between the local features and the global features of the object to be processed, an accurate and complete image capture pattern can be determined through key points. The target area captured by the image capture pattern determined by the key points can completely cover the object to be processed in the image.
[0167] In one embodiment, the image capture graphics include at least one of the following:
[0168] Oval shapes, polygonal shapes, circular shapes, and triangular shapes.
[0169] In an exemplary embodiment, different image capture patterns may be determined according to different attribute relationships between local features and global features of the object to be processed.
[0170] The attribute relationship between the local feature and the global feature includes at least one of the following:
[0171] The regional position relationship between the local features and the global features;
[0172] The area ratio relationship between the local features and the global features.
[0173] According to the regional position relationship between the local feature and the global feature, and / or the regional area ratio relationship, the region where the local feature is located and the region where the global feature is located are determined as follows:
[0174] When the global feature region is a rectangular region and the local feature region is a sub-rectangular region with the same length as one side of the global feature region, the image capture pattern can be determined to be a rectangular pattern;
[0175] When the global feature region is an elliptical region and the local feature region is a semi-elliptical region in the global feature region, the image capture pattern can be determined to be an elliptical pattern;
[0176] When the global feature region is a triangular region and the local feature region is a sub-triangular region that overlaps with two triangular edges in the global feature region, the image capture pattern can be determined to be a triangular pattern. In this way, the image capture pattern that is easy to cover the global feature region can be determined through the attribute relationship between the local feature and the global feature of the object to be processed.
[0177] In one embodiment, the second processing unit is further configured to
[0178] When it is determined that the object to be processed in the image is a human head, the local features are facial features, and the global features are all features of the head, the image capture pattern is determined to be an elliptical pattern.
[0179] In an exemplary embodiment, the image processing method can be applied to face image processing. It is determined that the object to be processed is a human head, all features of the head are global features, and facial features are local features. Since most human faces are semi-oval, and the face part is longer than the forehead part, when image processing is performed on the head image of a semi-oval face, the image capture pattern can be determined to be an elliptical pattern.
[0180] In addition, when the face of a person in the image is a square face, the image capture pattern can also be determined to be a rectangular pattern.
[0181] When determining key points based on the image capture figure, the key points corresponding to different figures will be different. For example, when the image capture figure is an elliptical figure, the key points need to be determined as the origin, the major axis endpoint, and the minor axis endpoint required to construct the corresponding elliptical figure. When the image capture figure is a rectangular figure, the key points need to be determined as at least three vertices required to construct the corresponding rectangular figure.
[0182] In one embodiment, the third processing unit is further configured to:
[0183] When it is determined that the object to be processed in the image is a human head, the local features are facial features, and the global features are all features of the head,
[0184] Determine the feature point located at the center of the eyebrows as the first key point;
[0185] Determine the feature point located at the temple as the second key point;
[0186] The feature point located at the bottom of the chin is determined as the third key point.
[0187] In an exemplary embodiment, when the face in the image is a semi-elliptical face, the feature point located at the center of the eyebrows may be determined as the first key point according to the matching degree between the face contour and the ellipse;
[0188] Determine the feature point located at the temple as the second key point;
[0189] The feature point located at the bottom of the chin is determined as the third key point.
[0190] In an exemplary embodiment, determining a target area for image processing according to the key points at least includes:
[0191] Determining the first key point as the origin of the elliptical image capture figure;
[0192] Determine the distance between the third key point and the first key point as the length of the major semi-axis of the elliptical image capture figure;
[0193] Determine that the longest distance between the second key point and the first key point is the length of the minor semi-axis of the elliptical image capture figure;
[0194] The target area for image processing is determined based on the origin, the major semi-axis, and the minor semi-axis.
[0195] In an exemplary embodiment, the entire elliptical figure is determined as a target area for image processing through the first key point, the second key point, and the third key point.
[0196] In an exemplary embodiment, in order to ensure that the target area completely covers the human head when the entire elliptical figure is used as the target area for image processing, when determining the first key point and the second key point, the point farthest from the central axis of the face among the captured feature points can be used as the first key point or the second key point, and the farthest distance between the first key point and the third key point and the distance between the second key point and the third key point is used as the length of the major semi-axis of the constructed ellipse.
[0197] In one embodiment, the fourth processing unit is specifically configured to
[0198] Determining the first key point as the origin of the elliptical image capture figure;
[0199] Determine the distance between the third key point and the first key point as the length of the major semi-axis of the elliptical image capture figure;
[0200] Determine that the longest distance between the second key point and the first key point is the length of the minor semi-axis of the elliptical image capture figure;
[0201] The target area for image processing is determined based on the origin, the major semi-axis, and the minor semi-axis.
[0202] In an exemplary embodiment, the entire elliptical figure is determined as a target area for image processing through the first key point, the second key point, and the third key point.
[0203] In an exemplary embodiment, in order to ensure that the target area completely covers the human head when the entire elliptical figure is used as the target area for image processing, when determining the first key point and the second key point, the point farthest from the central axis of the face among the captured feature points can be used as the first key point or the second key point, and the farthest distance between the first key point and the third key point and the distance between the second key point and the third key point is used as the length of the major semi-axis of the constructed ellipse.
[0204] In one embodiment, the fourth processing unit is further configured to:
[0205] Determine a first target area based on the origin, the major semi-axis, and the minor semi-axis;
[0206] Based on the first target area, a second target area is obtained symmetrically along the ellipse symmetry axis;
[0207] The first target region and the second target region are merged to obtain the target region.
[0208] In an exemplary embodiment, when specifically determining the target area of the elliptical graphic, the half elliptical area corresponding to the human face part can be determined as the first target area by determining the origin, the major semi-axis, and the minor semi-axis; then, the second target area covering the human head is obtained symmetrically through the first target area and the elliptical symmetry axis; finally, the entire elliptical graphic target area is obtained by merging the first target area and the second target area.
[0209] The present application also provides a server. Figure 8 FIG. 1 is a schematic diagram of a server structure according to an exemplary embodiment. Figure 8 As shown, the server provided in an embodiment of the present application includes: a processor 530 and a memory 520 for storing a computer program that can be run on the processor, wherein the processor 530 is used to execute the steps of the method provided in the above embodiments when running the computer program.
[0210] The present application also provides a computer-readable storage medium. The computer-readable storage medium provided in the embodiments of the present application stores a computer program, which, when executed by a processor, implements the steps of the method provided in the above embodiments.
[0211] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0212] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0213] In addition, all functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0214] In some cases, if any two of the above technical features do not conflict with each other, they can be combined into a new method technical solution.
[0215] In some cases, if any two of the above technical features do not conflict with each other, they can be combined into a new equipment technical solution.
[0216] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks or optical disks, etc., various media that can store program codes.
[0217] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. An image processing method, characterized in that: include: Capturing multiple feature points of local feature edges of the object to be processed in the image; An image capture pattern is determined according to the attribute relationship between the local feature and the global feature of the object to be processed; the image capture pattern is used to cover the area where the global feature is located; the attribute relationship between the local feature and the global feature includes at least one of the following: the regional position relationship between the local feature and the global feature; the regional area ratio relationship between the local feature and the global feature; Key points are determined based on the image capture pattern, wherein when the image capture pattern is an elliptical image capture pattern corresponding to a human face, the key points include: a first key point corresponding to a feature point at the position of the center of the eyebrows, a second key point corresponding to a feature point at the position of a temple, and a third key point corresponding to a feature point at the position of the bottom of the chin; the first key point corresponds to the origin of the elliptical image capture pattern, and the distance between the second key point and the first key point is the short semi-axis length of the elliptical image capture pattern; the distance between the third key point and the first key point is the long semi-axis length of the elliptical image capture pattern; According to the key points, a target area for image processing is determined, including: according to the origin, the short semi-axis and the long semi-axis, a first target area is determined and a second target area symmetrical to the first target area is determined; the first target area and the second target area are combined to obtain a target area for a face to be processed; the first target area and the second target area are both half elliptical areas.
2. The image processing method according to claim 1, characterized in that: The step of determining the target area for image processing further includes: The determined target area completely covers the object to be processed in the image.
3. The image processing method according to claim 1, characterized in that: The determining of key points based on the image capture graphics further includes: Key points that meet preset positions and the number of key points that meet preset positions are determined among the edge feature points.
4. The image processing method according to claim 1, characterized in that: The image capture graphics include at least one of the following: Oval shapes, polygonal shapes, circular shapes, and triangular shapes.
5. An image processing device, characterized in that: include: A first processing unit is used to capture multiple feature points of local feature edges of the object to be processed in the image; A second processing unit is used to determine an image capture pattern according to the attribute relationship between the local feature and the global feature of the object to be processed; the image capture pattern is used to cover the area where the global feature is located; the attribute relationship between the local feature and the global feature includes at least one of the following: the regional position relationship between the local feature and the global feature; the regional area ratio relationship between the local feature and the global feature; A third processing unit is used to determine key points based on the image capture pattern; wherein, when the image capture pattern is an elliptical image capture pattern corresponding to a human face, the key points include: a first key point corresponding to a feature point at the position of the center of the eyebrows, a second key point corresponding to a feature point at the position of a temple, and a third key point corresponding to a feature point at the position of the bottom of the chin; the first key point corresponds to the origin of the elliptical image capture pattern, and the distance between the second key point and the first key point is the short semi-axis length of the elliptical image capture pattern; the distance between the third key point and the first key point is the long semi-axis length of the elliptical image capture pattern; The fourth processing unit is used to determine the target area for image processing based on the key points, including: determining a first target area and a second target area symmetrical to the first target area based on the origin, the short semi-axis and the long semi-axis; merging the first target area and the second target area to obtain a target area for the face to be processed; the first target area and the second target area are both half elliptical areas.
6. The image processing device according to claim 5, characterized in that: The fourth processing unit is further configured to determine that the target area completely covers the object to be processed in the image.
7. The image processing device according to claim 5, characterized in that: The third processing unit is specifically configured to determine key points that meet preset positions among edge feature points, and the number of key points that meet preset positions.
8. The image processing device according to claim 5, characterized in that: The image capture graphics include at least one of the following: Oval shapes, polygonal shapes, circular shapes, and triangular shapes.
9. A server, characterized in that: include: A processor and a memory for storing a computer program that can be run on the processor, wherein the processor executes the steps of the method according to any one of claims 1 to 4 when running the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Positioning method and device for face feature points
CN104239843A
Object property recognizing method, device and system
CN107784282A
Image processing method and device
CN107862673A
Image processing method and device, and electronic device
CN108346130A
Image processing method and device and electronic device
CN108399599A
