CN117152479A - Image processing and labeling method and device, electronic equipment and storage medium - Google Patents

Image processing and labeling method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117152479A
CN117152479A CN202210551518.9A CN202210551518A CN117152479A CN 117152479 A CN117152479 A CN 117152479A CN 202210551518 A CN202210551518 A CN 202210551518A CN 117152479 A CN117152479 A CN 117152479A
Authority
CN
China
Prior art keywords
points
image
labeling
marking
basic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210551518.9A
Other languages
Chinese (zh)
Inventor
李啸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202210551518.9A priority Critical patent/CN117152479A/en
Publication of CN117152479A publication Critical patent/CN117152479A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/752Contour matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Medical Informatics (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Human Computer Interaction (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the disclosure provides an image processing and labeling method, an image processing and labeling device, electronic equipment and a storage medium. The method comprises the steps of obtaining an image to be processed comprising a target object; and labeling the face edge contour of the target object in the image to be processed based on a target face contour labeling model to obtain a target image corresponding to the image to be processed. According to the technical scheme, the problem that in the prior art, contour key points are inaccurate in identification, subsequent processing cannot be conducted, and poor user experience is caused is solved, more key points are introduced in a model training stage, so that a contour marking model with high accuracy is obtained through training, images can be processed based on the contour marking model, accuracy and marking efficiency of contour marking are improved, the effect of subsequent image processing is improved, and therefore the effect of user experience is improved.

Description

Image processing and labeling method and device, electronic equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to an image processing and labeling method, an image processing and labeling device, electronic equipment and a storage medium.
Background
With the development of special effect videos, more and more users record and generate short videos, and when shooting and creating short videos, the requirement for video content richness is gradually increased.
During short video capture and authoring, facial images of users are often processed, for example, to identify key points on the facial contours. However, the existing contour key point identification is inaccurate, namely the contour identification cannot be effectively performed, so that the follow-up processing is performed or is inaccurate, and the user experience is poor.
Disclosure of Invention
The embodiment of the disclosure provides an image processing and labeling method, an image processing and labeling device, electronic equipment and a storage medium, so as to achieve the technical effects of efficiently, effectively and accurately labeling the surface contours.
In a first aspect, an embodiment of the present disclosure provides an image processing method, including:
acquiring an image to be processed comprising a target object;
labeling the face edge contour of the target object in the image to be processed based on a target face contour labeling model to obtain a target image corresponding to the image to be processed;
the target face contour labeling model is obtained based on training of at least one training sample, the training sample comprises an original image and a corresponding labeling image, the face edge contour of an object to be labeled in the labeling image is labeled by at least three labeling points, the at least three labeling points comprise basic labeling points and at least one equipartition labeling point between two adjacent basic labeling points, the equipartition labeling points are determined according to at least one labeling straight line of the two adjacent basic labeling points, and the labeling straight line is perpendicular to a connecting line of the two adjacent basic labeling points.
In a second aspect, an embodiment of the present disclosure further provides an image labeling method, where the method includes:
acquiring an original image comprising an object to be annotated;
determining basic marking points of the face contours of the objects to be marked in the original image and average points of adjacent basic marking points;
determining equipartition marking points based on the base marking points, equipartition points of the adjacent base marking points and facial contours of the objects to be marked, wherein the equipartition marking points are determined based on marking lines associated with the adjacent base marking points, and the marking lines are perpendicular to connecting lines of the two adjacent base marking points;
and determining the marked image of the original image based on the average marked point and the basic marked point of the original image.
In a third aspect, an embodiment of the present disclosure further provides an image processing apparatus, including:
the image acquisition module to be processed is used for responding to the detection of the trigger indication and acquiring an image to be processed comprising the target object;
the target image acquisition module is used for marking the facial edge contour of the target object in the image to be processed based on the target model to obtain a target image corresponding to the image to be processed;
The target model is obtained based on training samples, the training samples comprise original images and corresponding labeling images, the facial edge contours of objects to be labeled in the labeling images are labeled by labeling points, the labeling points comprise basic labeling points and equally divided labeling points located between adjacent basic labeling points, the equally divided labeling points are determined based on labeling straight lines associated with the adjacent basic labeling points, and the labeling straight lines are perpendicular to connecting lines of the two adjacent basic labeling points.
In a fourth aspect, an embodiment of the present disclosure further provides an image labeling apparatus, including:
the image acquisition module is used for acquiring an original image comprising an object to be marked;
the average point determining module is used for determining basic marking points of the face contours of the objects to be marked in the original image and average points of adjacent basic marking points;
the equipartition annotation point determining module is used for determining equipartition annotation points based on the basic annotation points, the equipartition points of the adjacent basic annotation points and the facial contours of the objects to be annotated, wherein the equipartition annotation points are determined based on annotation lines associated with the adjacent basic annotation points, and the annotation lines are perpendicular to the connecting lines of the two adjacent basic annotation points;
The marked image determining module is used for determining the marked image of the original image based on the average marked point and the basic marked point of the original image.
In a fifth aspect, embodiments of the present disclosure further provide an electronic device, the device including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the image processing method as described in any of the embodiments of the present disclosure or to implement the image labeling method as described in any of the embodiments of the present disclosure.
In a sixth aspect, the embodiments of the present disclosure further provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the image processing method according to any of the embodiments of the present disclosure or implements the image labeling method according to any of the embodiments of the present disclosure.
According to the technical scheme, the image to be processed comprising the target object is obtained, the face edge contour of the target object in the image to be processed is marked based on the target face contour marking model, so that the target image corresponding to the image to be processed is obtained, the problem that in the prior art, contour key points are inaccurately identified, so that follow-up processing cannot be performed, and poor user experience is caused is solved. In addition, the basic marking points of the face contours of the objects to be marked and the average marking points of the adjacent basic marking points in the original image are determined by acquiring the original image comprising the objects to be marked, and the average marking points are determined based on the basic marking points, the average marking points of the adjacent basic marking points and the face contours of the objects to be marked, so that the marking efficiency is improved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
Fig. 1 is a flowchart of an image processing method according to an embodiment of the disclosure;
fig. 2 is a flowchart of an image processing method according to an embodiment of the disclosure;
FIG. 3 is a schematic diagram of equipartition annotation points provided in an embodiment of the disclosure;
fig. 4 is a flowchart of an image processing method according to an embodiment of the disclosure;
fig. 5 is a flowchart of an image labeling method according to an embodiment of the disclosure;
fig. 6 is a block diagram of an image processing apparatus according to an embodiment of the present disclosure;
fig. 7 is a block diagram of an image labeling apparatus according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
Before the present technical solution is introduced, an application scenario may be illustrated. The technical scheme of the disclosure can be applied to any scene requiring image processing, for example, in the video shooting process, and can be used for performing image processing on an image corresponding to a shot user, such as a short video shooting scene.
In many conventional facial contour labeling, the facial contours of a target user are roughly labeled, for example, the rough facial contours in an image to be processed are roughly recognized through an image recognition algorithm, and in this way, the facial contours of the target user cannot be precisely labeled. Or the facial contours of the target users are marked by adopting a manual marking method, and the accurate marking effect can be achieved by the sampling method, but the marking cost is also improved, and the marking efficiency is reduced. Meanwhile, even though the labeling is performed based on the above manner, the richness of the labeled sample is problematic, for example, the obtained sample may not cover the image data under a specific angle, such as an image taken on the side of the face or an image taken at a look-up angle, resulting in a problem of poor universality in later use. Based on the above, the existing target contour labeling has the problems of high cost and poor universality.
In this embodiment, when a user uses corresponding video capturing or making software, it is generally desired to accurately annotate a face contour in an image, and this may be achieved based on the technical solution of the embodiments of the present disclosure. Optionally, the facial contours are labeled based on basic labeling points set by a user and combined with an algorithm.
That is, the basic annotation points can be set by the user, so that the algorithm automatically calculates the equipartition points according to the basic annotation points, and further accurately annotates the facial contours in the images, and the distances between the annotation points are equal, thereby realizing the technical effect of interactive annotation of the facial contours.
Fig. 1 is a schematic flow chart of an image processing method according to an embodiment of the present disclosure, where the method may be applicable to a case of labeling an outline of a face image, and the method may be performed by an image processing apparatus, where the apparatus may be implemented in software and/or hardware, and the hardware may be an electronic device, such as a mobile terminal, a PC or a server.
As shown in fig. 1, the method of the present embodiment includes:
s110, responding to the detection of the trigger indication, and acquiring a to-be-processed image comprising the target object.
It should be noted that, the apparatus for executing the image processing method provided by the embodiment of the present disclosure may be integrated in application software supporting image processing, and the software may be installed in an electronic device, where the electronic device may be a mobile terminal or a PC terminal, or the like. The application software may be a type of software for image/video processing, and specific application software thereof is not described herein in detail, as long as image/video processing can be implemented. The method can also be a specially developed application program, can be used in software for realizing image processing, or can be integrated in a corresponding page, and a user can realize image processing through the page integrated in the PC side.
The trigger indication may be understood as an indication sent by a user after triggering the control. The target object may be a user, or may be any object having facial contour information. The image to be processed comprises a target object. The user can shoot corresponding videos through the video shooting software. It will be appreciated that the video is made up of a plurality of video frames, and that the video frames including the target object may be taken as the image to be processed. The image to be processed can also be a static image, for example, the image shot by the user by shooting software on the mobile terminal can be taken as the image to be processed if contour marking is needed.
Specifically, an image with five sense organs in a real scene can be shot through a camera on the mobile terminal, and the image obtained after shooting is used as an image to be processed. Alternatively, in the special effect video processing scene, a video frame including a target object among video frames photographed in real time may be used as the image to be processed. Or, when the shot video is post-processed, the video frame including the target object is taken as the image to be processed.
It should be noted that the number of the target objects included in the image to be processed may be one or more, and if one target object is included, only the labeling of the facial contours of the target object is required. If the image to be processed contains a plurality of target objects, the facial contours of all the target objects can be marked, and the facial contours of the target objects selected by the user can be marked based on the selection of the user, which can be understood as follows: even if there are a plurality of target objects in the image to be processed, only the preselected target objects are labeled with the facial contours. For example, the target object preset by the user is the object a, and when the image to be processed includes the target objects a and B, only the facial contour of the target object a needs to be labeled.
On the basis of the technical scheme, the triggering indication comprises at least one of the following: the target object enters a mirror entering picture of a user; triggering voice indication of the target special effect prop associated with the outline annotation sent by the user; the user touches a control for triggering a target special effect prop associated with the contour annotation.
The mirror-in picture can be understood as a picture shot by the current equipment of the user. The target special effect prop can be understood as any special effect prop associated with contour labeling, and it can be understood that when special effects need to be applied to the face of a user, such as makeup-like special effects, in order to ensure that the special effects are accurately applied, the contour of the face of the user needs to be labeled, and the accuracy of the special effect range is further ensured.
In the present technical solution, acquiring an image to be processed including a target object may include multiple implementation manners, and then the acquisition manner corresponding to each solution is described in detail:
the first way is: after the user triggers the image processing control on the display interface, the user jumps to the corresponding image uploading page, the user can trigger the corresponding control in the image uploading page, for example, the uploading image frame is displayed in the image uploading page, the user sends out the corresponding instruction by clicking the uploading image frame, further the application program displays a plurality of images for the user according to the instruction, the user can select at least one image to be processed in the displayed images, after the user selects, the user can send out the image uploading completion instruction by clicking the control in the image uploading page, for example, the user can display the 'completion' button in the image uploading page, and the user sends out the corresponding image uploading completion instruction by clicking the 'completion' button after the selection of the image is completed. And the application program takes the corresponding image as the image to be processed after receiving the image uploading completion instruction.
The second mode is as follows: when the user is detected to trigger the image processing control on the display interface, the current display image on the display interface is directly used as an image to be processed, and it can be understood that the user can select the image to be processed in the gallery in advance, after the user finishes selecting the image, the application program can be triggered by a long-press method and the like, the application program pops up the corresponding image processing control for the user, and after the user triggers the image processing control, the image displayed on the current interface is used as the image to be processed.
The third way is: when the image processing control on the display interface is triggered by the user, the application program invokes an image management program installed in the terminal equipment according to a preset method, for example, invokes related programs such as a gallery and the like, so that images stored in the terminal equipment can be displayed on the display interface of the terminal equipment, the user can select the images on the display interface, and the images triggered by the user are used as images to be processed.
The fourth mode is: it should be noted that, if there is no image required by the user in the images stored in the current device, the user may call the camera in the device through the application program, and shoot in real time through the camera, and when it is detected that the inbound screen includes the target object in the process of shooting by the user, the image including the target object is directly shot, and is taken as the image to be processed.
The fifth mode is as follows: it can be understood that when the user needs to call the camera in the device through the application program and shoot in real time through the camera, when the user cannot directly operate the terminal device to complete shooting, for example, the user needs to shoot a whole body photo, or the user needs to put out a fixed gesture, both hands cannot touch the terminal device, the user can shout out a preset wake-up word, and when the application program detects the corresponding wake-up word, an image including the target object is shot and taken as an image to be processed.
It should be noted that, the technical scheme can be applied to a scene of special effect video processing, a user triggers a corresponding face special effect prop, for example, the user triggers a face makeup special effect prop, the facial outline of the user can be marked based on the technical scheme, three-court five eyes are divided based on the marked result, and then the makeup drawing range can be determined based on the divided result.
And S120, labeling the facial edge contour of the target object in the image to be processed based on the target model to obtain a target image corresponding to the image to be processed.
The target model is obtained based on training of at least one training sample, the training sample comprises an original image and a corresponding labeling image, the face edge outline of an object to be labeled in the labeling image is labeled by at least three labeling points, the at least three labeling points comprise basic labeling points and at least one equipartition labeling point between two adjacent basic labeling points, the equipartition labeling points are determined according to at least one labeling straight line of the two adjacent basic labeling points, and the labeling straight line is perpendicular to the connecting line of the two adjacent basic labeling points.
The basic marking points are marking points or semantic points which can clearly know the specific meaning of the basic marking points, and the basic marking points can comprise forehead vertexes, forehead points, nie Jiaodian, temple points, cheekbones points, mandibles points and chin points. It will be appreciated that since the interior equipartition annotation point needs to be determined from two adjacent base annotation points, the base annotation points include at least two annotation points of known specific meaning.
Specifically, the face edge contour of the target object in the image to be processed is marked through the target face contour marking model, and the face image comprising marking points is obtained. It should be noted that, the user may select to upload the image to be processed to include a plurality of target objects, that is, the same image includes a plurality of face images, and the target face contour labeling model in this embodiment may label different face images in the same image one by one.
According to the technical scheme, the image to be processed comprising the target object is obtained, the face edge contour of the target object in the image to be processed is marked based on the target face contour marking model, so that the target image corresponding to the image to be processed is obtained, the problem that in the prior art, contour key points are inaccurately identified, subsequent processing cannot be performed, and poor user experience is caused is solved, more key points are introduced in a model training stage, so that a contour marking model with higher accuracy is obtained through training, the image can be processed based on the contour marking model, the accuracy and the high efficiency of contour marking are improved, namely, the contour marking efficiency is improved, the effect of subsequent image processing is improved, and the effect of improving user experience is achieved.
Fig. 2 is a schematic flow chart of an image processing method according to an embodiment of the disclosure, and the image processing method is further refined based on the foregoing embodiment. The specific implementation manner can be seen in the technical scheme of the embodiment. Wherein, the technical terms identical to or corresponding to the above embodiments are not repeated herein.
S210, at least one original image including the object to be marked under each camera view angle is obtained.
The camera angle of view is understood to be the shooting angle of view of the camera. The object to be annotated can be a user corresponding to any facial image participating in model training.
It should be understood that, in order to improve accuracy of model training, images including the object to be annotated, which are captured under different camera angles, may be acquired, and the captured images may be taken as the original images.
It should be noted that the shooting angle of view may be represented by parameters of at least three dimensions, for example, 3 parameters are used to represent position information of the shooting camera, and 3 parameters are used to represent rotation angle information of the shooting camera.
It should be noted that, in order to achieve convenience of capturing images, the image capturing device may be fixedly disposed on the rotary sphere, and images of objects to be marked under different viewing angles may be obtained by rotating the rotary sphere.
In practical application, in order to improve the accuracy of the target face contour labeling model, the richness of the training sample can be improved. The richness may be embodied in: facial images in different poses are collected in advance as original sample images. For example, face images photographed at different angles, for example, images corresponding to 45 degrees face up or 30 degrees face down, may be collected, and it is understood that sample images at arbitrary angles may be acquired in order to secure the richness of the sample. And because the facial outline under different expressions may change, the richness can also be represented in: the face images under different expressions are collected in advance as original sample images, and may be, for example, a face image in a eyebrow plucking state, a face image at smiling time, a face image at mouth opening time, or the like.
Illustratively, the manner of at least one original image may be: after the original image under one view angle is obtained by shooting, the original image is stored in a cache space. After the original images under a plurality of view angles are obtained, each original image in the buffer space is sequentially processed to obtain at least one original image comprising the object to be marked.
In this embodiment, a specific processing manner of processing the original image is not limited herein, and only the technical scheme of the embodiment of the disclosure needs to be implemented.
S220, determining basic marking points of the face contours of the objects to be marked in the original image and average points of adjacent basic marking points.
The basic annotation points are understood to be the basic points in the face contour, i.e. the points with corresponding meanings. The equipartition point is an equipartition point located between two base annotation points. The points to be selected may be equal points between the base points of adjacent chains, where the equal points may not fit the facial contours of the user.
It should be noted that the labeling point to be selected may not fit with the face contour, and the labeling point to be selected needs to be corrected by combining with the face contour to obtain the labeling point to be trained, which fits with the face contour.
Illustratively, at least one marking point to be selected is determined according to a preset equal division ratio between two adjacent basic marking points. For example, the basic annotation point may be marked by a manual annotation method, that is, after the original image is obtained, the facial contour in the original image is marked based on a manual annotation method, so as to obtain the basic annotation point.
On the basis of the technical scheme, determining the average points of adjacent basic marking points of the face outline of the object to be marked in the original image comprises the following steps: and determining the uniform distribution points according to the uniform distribution ratio of the adjacent basic marking points and the basic connecting line length of the adjacent basic marking points.
The bisection ratio is understood to be a bisection ratio of a length between two base mark points, for example, a length between two base mark points is halved, and two bisection points need to be determined between two base mark points. The base link length may be the length of a line segment ending with two base mark points.
Illustratively, the dividing ratio may be preset, or may be determined according to the length of the base line. All basic marking points are connected in sequence to obtain a rough face outline. The equal division ratio between the two basic marking points can be determined according to the length of the basic connecting line, for example, a first length threshold value and a second length threshold value can be preset, when the length of the basic connecting line between two adjacent basic marking points is smaller than the preset first length threshold value, the condition that the length between the current two adjacent basic marking points does not meet the condition of setting the equal division point is indicated, the equal division point does not need to be set, when the length of the basic connecting line between the two adjacent basic marking points is larger than the first length threshold value and smaller than the second length threshold value, the equal division point needs to be determined between the current two adjacent basic marking points, namely, an equal division point needs to be set, and when the length of the basic connecting line between the two adjacent basic marking points is larger than the second length threshold value, the equal division point needs to be determined between the current two adjacent basic marking points. After the equal division ratio between two adjacent basic marking points is obtained, at least one marking point to be selected can be determined according to the equal division ratio and the basic connecting line length of the two adjacent basic marking points.
S230, determining equipartition marking points based on the base marking points, the equipartition points of the adjacent base marking points and the face contours of the objects to be marked.
The equally divided marking points are marking points after correction of the marking points to be selected.
On the basis of the above technical solution, the determining the equipartition mark points based on the equipartition points of the base mark points, the equipartition points of the adjacent base mark points and the face profile of the object to be marked includes: determining a basic connecting line connecting the adjacent basic marking points, and determining a marking straight line which passes through the equipartition points and is vertical to the basic connecting line; and determining average marking points corresponding to the average marking points according to the marking straight line and the edge contour of the object to be marked.
The base connection line is understood as a line segment taking two adjacent base marking points as endpoints. The marking straight line can be a perpendicular line which is perpendicular to the connecting line of the current foundation and the foot by taking the marking point to be selected as the perpendicular line. It should be noted that, based on the above method, it is determined that the to-be-selected labeling point may not be attached to the face contour of the target object, so that the position of the to-be-selected labeling point needs to be adjusted, but the accuracy of the to-be-selected labeling point needs to be ensured while the position of the labeling point is adjusted, and a perpendicular line of the current basic connecting line can be made based on the to-be-selected labeling point and used as a labeling straight line. The marking points to be selected can be moved in the corresponding marking straight lines, so that the adjusted marking points to be selected correspond to the facial contours of the user, and the effect of marking the facial contours is improved.
Specifically, two basic marking points associated with the current marking point to be selected are determined based on each marking point to be selected, a basic connecting line between the two basic marking points is determined, the marking point to be selected is further taken as a foot, a perpendicular line perpendicular to the basic connecting line is made, the perpendicular line is a current marking straight line, and even marking points of each marking point to be selected are determined according to marking straight lines of each marking point to be selected and edge outlines of marking objects. As shown in fig. 3, after determining that the to-be-selected labeling point is a straight line perpendicular to the corresponding basic connecting line, the to-be-selected labeling point can be adjusted on the perpendicular line to match with the facial contour, so as to obtain the to-be-trained labeling point which is finally attached to the facial contour.
On the basis of the technical scheme, the determining of equally dividing the marking points according to the marking straight line and the edge outline of the object to be marked comprises the following steps: and determining the equipartition marking points attached to the edge outline of the object to be marked on the marking straight line.
The current marking straight line corresponds to the marking point to be selected currently. The movement point location may be a finally determined labeling point location, and it may be understood that the final movement point location may be determined based on an intersection point of the current labeling line and an edge contour of the object to be labeled.
After determining the labeling straight line, the position of the labeling point to be selected on the labeling straight line can be moved, so that the moving point position in the group can be determined. It can be understood that, since the labeling straight line is a perpendicular line of the current connecting line made based on the labeling point to be selected, an intersection point must exist between the labeling straight line and the facial contour of the target object, and the labeling point to be selected can be moved to the intersection point position of the labeling straight line and the facial contour and used as a moving point. Or directly obtaining the moving point location according to the intersection point of the labeling straight line and the face outline of the target object after obtaining the labeling straight line based on the labeling to be selected.
For example, after determining the labeling straight line of the basic connecting line between two adjacent basic labeling points, adjusting the position of the current labeling point to be selected on the labeling straight line based on the edge contour of the object to be labeled, for example, the labeling point to be selected may be adjusted to the intersection point of the labeling straight line and the edge contour of the object to be labeled, and the intersection point of the labeling straight line and the edge contour of the object to be labeled may be used as a moving point, and then the moving point may be used as an equipartition labeling point.
S240, determining the marked image of the original image based on the average marked point and the basic marked point of the original image.
The labeling image is understood to be an image obtained by processing an original image according to a preset method.
It should be noted that, for each original image, the method S220-S230 may be adopted to process the original image, so as to obtain a labeling image corresponding to each original image.
S250, determining at least one training sample based on each original image and the corresponding labeling image.
Specifically, after the original image is obtained, the obtained original image is processed based on a preset method to obtain a corresponding labeling image, and then at least one training sample is obtained based on the original image and the labeling image, wherein the training sample comprises an original virtual sword to be trained and the labeling image. In order to improve accuracy of model training, images photographed at different camera angles may be acquired, and the photographed images and the processed labeling images may be used as training samples. The sum of all training samples constitutes the training sample set. I.e. the training sample set comprises a plurality of training samples. The training samples are relative terms only and are not specifically limited thereto. In order to improve the accuracy of the model obtained by training, training samples can be obtained as much and as abundant as possible.
According to the technical scheme, the original image including the object to be marked under different camera view angles can be obtained, the training sample can be determined by marking each basic marking point and corresponding equipartition marking points in the original image, and the corresponding model can be trained based on the training sample, so that the target image capable of accurately marking the face outline can be obtained.
Fig. 4 is a flowchart of an image processing method according to an embodiment of the present disclosure, where, on the basis of the foregoing embodiment, a face contour labeling model to be trained may be trained in advance before a target image is acquired, so as to obtain a target face contour labeling model. The specific implementation manner can be seen in the technical scheme of the embodiment. Wherein, the technical terms identical to or corresponding to the above embodiments are not repeated herein.
As shown in fig. 4, the method specifically includes the following steps:
s410, regarding each training sample, taking an original image in the current training sample as an input parameter of a face contour labeling model to be trained, and obtaining an output image corresponding to the original image.
The input parameters are original images in the training samples. The output image may be an image generated by processing the original image by the face contour labeling model to be trained.
It should be noted that, the original image in each training sample may be sequentially input into the face contour labeling model to be trained, so as to obtain an output image corresponding to the original image in each training sample. For clarity of description of the present technical solution, the following description will take, as an example, processing an original image in one of the training samples.
For example, the original image in the current training sample is input into the face contour labeling model to be trained as an input parameter, and the model can output a corresponding output image in the original image in the current training sample. It can be understood that the face contour labeling model to be trained is not trained, the corresponding output image is inaccurate, and the output image is taken as the output image.
S420, determining a loss value based on the output image and a labeling image corresponding to the original image, and correcting model parameters in the face contour labeling model to be trained based on the loss value.
It should be noted that, before training the face contour labeling model to be trained, the model parameters may be set to default values. When the face contour labeling model to be trained is trained, model parameters in the model can be corrected based on an output image of the face contour labeling model to be trained, that is, a loss function in the face contour labeling model to be trained can be corrected, so that the face contour labeling model can be obtained. Each image to be processed has a corresponding penalty value determined based on the annotated image of the respective image to be processed.
Specifically, after the original image in the current training sample is input into the face contour labeling model to be trained, the face contour labeling model to be trained can obtain an output image corresponding to the original image in the current training sample. According to the output image, a loss value corresponding to an original image in a current training sample can be determined, and model parameters in the face contour labeling model to be trained can be corrected by adopting a reverse transfer method.
S430, converging the loss function in the model to be trained as a training target to obtain the target face contour labeling model.
The target face contour labeling model is a model which is finally trained and used for labeling the face edge contour of the target object.
Specifically, the training error of the loss function, that is, the loss parameter may be used as a condition for detecting whether the loss function currently reaches convergence, for example, whether the training error is smaller than a preset error or whether the error variation trend tends to be stable, or whether the current iteration number is equal to the preset number. If the detection reaches the convergence condition, for example, the training error of the loss function reaches less than the preset error or the error change tends to be stable, which indicates that the training of the face contour labeling model to be trained is completed, and at the moment, the iterative training can be stopped. If the condition that the convergence condition is not met at present is detected, a training sample can be further obtained to train the face contour labeling model to be trained until the training error of the loss function is within a preset range. When the training error of the loss function reaches convergence, the face contour labeling model to be trained can be used as a target face contour labeling model.
S440, acquiring a to-be-processed image comprising the target object.
S450, labeling the face edge contour of the target object in the image to be processed based on a target face contour labeling model to obtain a target image corresponding to the image to be processed.
On the basis of the above technical solution, the labeling the face edge contour of the target object in the image to be processed based on the target face contour labeling model to obtain a target image corresponding to the image to be processed includes: inputting the image to be processed into the target face contour labeling model, and labeling target average labeling points between target basic points of the target face contour in the image to be processed and adjacent target basic labeling points based on the target face contour labeling model to obtain the target image.
The target facial outline corresponds to the target object, the target basic point corresponds to the basic annotation point, and the target equipartition annotation point corresponds to the equipartition annotation point.
According to the technical scheme, the target contour labeling model can be obtained through training by adopting the training sample, so that the technical effect of the accuracy of the facial contour labeling can be improved when the input image is processed based on the target contour labeling model, and the input image is labeled by adopting the target contour labeling model, so that the labeling efficiency of the facial contour is improved.
Fig. 5 is a flowchart of an image labeling method provided by an embodiment of the present disclosure, where the embodiment may be suitable for a case of labeling an outline of a face image, and the method may be performed by an image labeling apparatus, where the apparatus may be implemented in software and/or hardware, and the hardware may be an electronic device, such as a mobile terminal, a PC end, or a server.
As shown in fig. 5, the method of the present embodiment includes:
s510, acquiring an original image comprising the object to be annotated.
The object to be annotated can be any object to be annotated, for example, can be a target user, and can also be any object with a face outline. The original image may be understood as an image photographed by the user through photographing software, or may be any image selected by the user from images stored in the terminal device, and it may be understood that the image photographed by the user through photographing software or any image selected from the stored images needs to include an object to be annotated, that is, the original image includes the object to be annotated.
Specifically, the user may shoot an image through a camera on the mobile terminal, and take the shot image as an original image, and the user may also select a desired image from the images stored in the terminal device as the original image.
For example, when the user needs to perform self-photographing, the front-end camera arranged on the terminal device can be called through a photographing program, the user can complete photographing of the image according to the requirement, and when the user determines that the currently photographed image is the image to be processed, the currently photographed image is determined to be an original image. For example, a "determine" control may be displayed for the user after the shooting is completed, and the user may be determined to select the current image as the original image when the user triggers the control.
S520, determining basic marking points of the face contours of the objects to be marked in the original image and average points of adjacent basic marking points.
The basic marking points can be points for which specific meanings are determined, and the basic marking points comprise at least two of forehead vertexes, forehead points, nie Jiaodian, temple points, cheekbone points, mandible points and chin points. The average point may be understood as an average point located between two basic marking points, and it may be understood that the distances between two adjacent basic marking points may be different, so as to ensure accurate marking of the face outline of the object to be marked, the positions of the average point may be divided according to a preset distance, that is, there may be a plurality of average points between two adjacent basic marking points.
Specifically, according to an original image shot by a user or an original image selected by the user, basic marking points of the face outline of the object to be marked in the image and average points between two adjacent basic marking points are determined. The basic annotation point can be marked by a manual annotation method, namely, after the original image is obtained, the facial outline in the original image is marked based on a manual annotation mode, so that the basic annotation point is obtained.
On the basis of the technical scheme, determining the average points of adjacent basic marking points of the face outline of the object to be marked in the original image comprises the following steps: and determining the uniform distribution points according to the uniform distribution ratio of the adjacent basic marking points and the basic connecting line length of the adjacent basic marking points.
The dividing ratio may be a dividing ratio of a length between two adjacent basic marking points, for example, a distance between two adjacent basic marking points is halved, two dividing points need to be determined, a distance between two adjacent basic marking points needs to be quartered, and three dividing points need to be determined. The base link length is understood to be the length of the line segment between two base annotation points.
Specifically, the dividing ratio may be preset according to the requirement, or may be determined according to the distance between two adjacent basic connecting lines, and after the dividing ratio is determined, all the basic marking points are sequentially connected to obtain a rough face contour. The equal division ratio between the two basic marking points can be determined according to the length of the basic connecting line, for example, a first length threshold value and a second length threshold value can be preset, when the length of the basic connecting line between two adjacent basic marking points is smaller than the preset first length threshold value, the condition that the length between the current two adjacent basic marking points does not meet the condition of setting the equal division point is indicated, the equal division point does not need to be set, when the length of the basic connecting line between the two adjacent basic marking points is larger than the first length threshold value and smaller than the second length threshold value, the equal division point needs to be determined between the current two adjacent basic marking points, namely, an equal division point needs to be set, and when the length of the basic connecting line between the two adjacent basic marking points is larger than the second length threshold value, the equal division point needs to be determined between the current two adjacent basic marking points. After the equal division ratio between two adjacent basic marking points is obtained, at least one marking point to be selected can be determined according to the equal division ratio and the basic connecting line length of the two adjacent basic marking points.
And S530, determining equipartition marking points based on the base marking points, the equipartition points of the adjacent base marking points and the facial contours of the objects to be marked.
The equipartition marking points are determined based on marking lines associated with the adjacent basic marking points, and the marking lines are perpendicular to the connecting lines of the two adjacent basic marking points.
Specifically, the equally dividing marking points are determined according to the equally dividing points between the basic marking points and the adjacent two basic marking points and the facial contours of the objects to be marked. For example, after determining the average points between two adjacent basic labeling points, the average points may be translated onto the face contour of the object to be labeled, so as to determine the average labeling points.
On the basis of the above technical solution, the determining the equipartition mark points based on the equipartition points of the base mark points, the equipartition points of the adjacent base mark points and the face profile of the object to be marked includes: determining a basic connecting line connecting the adjacent basic marking points, and determining a marking straight line which passes through the equipartition points and is vertical to the basic connecting line; and determining average marking points corresponding to the average marking points according to the marking straight line and the edge contour of the object to be marked.
The marking straight line can be a perpendicular line which is perpendicular to the connecting line of the current foundation by taking the marking point to be selected as the drop foot. A base link may be understood as a line segment that will end with two adjacent base mark points.
Specifically, two basic marking points associated with the current marking point to be selected are determined based on each marking point to be selected, a basic connecting line between the two basic marking points is determined, the marking point to be selected is further taken as a foot, a perpendicular line perpendicular to the basic connecting line is made, the perpendicular line is a current marking straight line, and even marking points of each marking point to be selected are determined according to marking straight lines of each marking point to be selected and edge outlines of marking objects.
It should be noted that, the position of the average point determined according to the basic marking point and the preset equal proportion is not attached to the face outline of the object to be marked, so that the position of the average point needs to be adjusted, so that the average point is attached to the face outline of the object to be marked as far as possible, but the accuracy of the marking point needs to be ensured while the position of the marking point is adjusted, and a perpendicular line of the current basic connecting line can be made based on the marking point to be selected and used as a marking straight line. The marking points to be selected can be moved in the corresponding marking straight lines, so that the adjusted marking points to be selected correspond to the facial contours of the user, and the effect of improving the accuracy of marking the facial contours is achieved.
On the basis of the technical scheme, the determining of equally dividing the marking points according to the marking straight line and the edge outline of the object to be marked comprises the following steps: and determining the equipartition marking points attached to the edge outline of the object to be marked on the marking straight line.
The edge contour of the object to be annotated may be the outermost peripheral line of the face contour, and it may be understood that after the original image containing the object to be annotated is obtained, the face contour of the object to be annotated in the original image may be identified.
Specifically, after the labeling straight line is determined, the equipartition labeling point can be determined according to the labeling straight line and the edge contour of the object to be labeled. For example, the labeling straight line is prolonged until the labeling straight line intersects with the edge contour of the object to be labeled, and an intersection point of the labeling straight line and the edge contour of the object to be labeled can be used as an equipartition labeling point.
S540, determining the marked image of the original image based on the average marked point and the basic marked point of the original image.
Specifically, the marked image corresponding to the original image is determined according to the average marked point and the basic marked point of the original image. For example, the equipartition marking points and the basic marking points in the original image may be sequentially connected to form a complete closed pattern, so as to obtain a marking image corresponding to the original image, and the user may set a connection method of the equipartition marking points and the basic marking points according to the requirement, or sequentially connect the equipartition marking points and the basic marking points in a clockwise order from the uppermost point of the image, or sequentially connect the equipartition marking points and the basic marking points in a counterclockwise order, and so on.
According to the technical scheme, the original image comprising the object to be annotated is obtained, so that basic annotation points of the face outline of the object to be annotated and average points of adjacent basic annotation points in the original image are determined, the average annotation points are determined based on the basic annotation points, the average points of the adjacent basic annotation points and the face outline of the object to be annotated, and finally the annotation image of the original image is determined based on the average annotation points and the basic annotation points of the original image. The problem that follow-up processing cannot be performed due to inaccurate identification of the outline key points in the prior art, and poor user experience is caused is solved, accuracy and high efficiency of outline marking are improved, namely, efficiency of outline marking is improved, image marking effect is improved, and therefore user experience improving effect is achieved.
Fig. 6 is a block diagram of an image processing apparatus according to an embodiment of the present disclosure, which may execute the image processing method according to any embodiment of the present disclosure, and has functional modules and beneficial effects corresponding to the execution method.
As shown in fig. 6, the apparatus specifically includes: the pending image acquisition module 610 and the target image acquisition module 620.
A to-be-processed image acquisition module 610, configured to acquire, in response to detecting the trigger indication, a to-be-processed image including the target object;
the target image obtaining module 620 is configured to label a face edge contour of a target object in the image to be processed based on a target model, so as to obtain a target image corresponding to the image to be processed; the target face contour labeling model is obtained based on training of at least one training sample, the training sample comprises an original image and a corresponding labeling image, the face edge contour of an object to be labeled in the labeling image is labeled by at least three labeling points, the at least three labeling points comprise basic labeling points and at least one equipartition labeling point between two adjacent basic labeling points, the equipartition labeling points are determined according to at least one labeling straight line of the two adjacent basic labeling points, and the labeling straight line is perpendicular to a connecting line of the two adjacent basic labeling points.
On the basis of the technical scheme, the image acquisition module to be processed is specifically used for:
when the triggering image processing control is detected, jumping to an image uploading page, and taking the image corresponding to the received image uploading completion instruction as the image to be processed; or when the triggering image processing control is detected, taking the image displayed on the display interface as an image to be processed; or when the triggering image processing control is detected, jumping to an image library, and taking the image triggered in the image library as the image to be processed; or when the fact that the mirror-in picture comprises the target object is detected, shooting an image to be processed comprising the target object; or alternatively, the first and second heat exchangers may be,
And when the trigger wake-up word is detected, shooting a to-be-processed image comprising the target object.
On the basis of the technical scheme, the image processing device further comprises a training sample generation module, and the training sample generation module comprises: the original image acquisition unit is used for acquiring at least one original image including an object to be annotated under each camera view angle; the to-be-selected labeling point determining unit is used for determining basic labeling points of the face contours of the to-be-labeled objects in the original images and determining at least one to-be-selected labeling point according to preset average points between two adjacent basic labeling points; the equipartition annotation point determining unit is used for determining equipartition annotation points based on each annotation point to be selected, the basic annotation point associated with the annotation point to be selected and the facial contour of the object to be annotated; the marked image determining unit is used for determining marked images of the original images based on the average marked points and the basic marked points of the original images; and the training sample determining unit is used for determining at least one training sample based on each original image and the corresponding marked image.
On the basis of the above technical solution, the to-be-selected labeling point determining unit is further configured to:
And determining the equal division ratio of two adjacent basic marking points, and determining the at least one marking point to be selected according to the equal division ratio and the basic connecting line length of the two adjacent basic marking points.
On the basis of the technical scheme, the equally dividing and marking point determining unit is specifically used for:
for each point to be selected, determining a basic connecting line according to two basic points corresponding to the point to be selected, and determining a current marking straight line which is perpendicular to the basic connecting line and passes through the point to be selected; and determining the average marking points corresponding to the marking points to be selected according to the marking straight lines of the marking points to be selected and the edge contours of the objects to be marked.
On the basis of the technical scheme, the equally dividing and marking point determining unit is further used for:
aiming at each marking point to be selected, adjusting the moving point position of the current marking point to be selected on the current marking straight line according to the edge contour of the object to be marked, and taking the moving point position as the equally dividing marking point; the current labeling straight line corresponds to the labeling point to be selected currently.
On the basis of the technical scheme, the device further comprises a target face contour labeling model training module, and the target face contour labeling model training module comprises:
The output image acquisition unit is used for taking an original image in the current training sample as an input parameter of a face contour labeling model to be trained aiming at each training sample to obtain an output image corresponding to the original image;
the model parameter correction unit is used for determining a loss value based on the output image and a labeling image corresponding to the original image, and correcting model parameters in the face contour labeling model to be trained based on the loss value; and the target face contour labeling model acquisition unit is used for converging the loss function in the model to be trained as a training target to obtain the target face contour labeling model.
On the basis of the technical scheme, the basic marking points comprise at least two of forehead vertexes, forehead points, nie Jiaodian temple points, cheekbone points, mandible points and chin points.
Based on the above technical solution, the target image acquisition module is specifically configured to:
inputting the image to be processed into the target face contour labeling model, and labeling target average labeling points between target basic points of the target face contour in the image to be processed and adjacent target basic labeling points based on the target face contour labeling model to obtain the target image; the target facial outline corresponds to the target object, the target basic point corresponds to the basic annotation point, and the target equipartition annotation point corresponds to the equipartition annotation point.
According to the technical scheme, the image to be processed comprising the target object is obtained, the face edge contour of the target object in the image to be processed is marked based on the target face contour marking model, so that the target image corresponding to the image to be processed is obtained, the problem that in the prior art, contour key points are inaccurately identified, subsequent processing cannot be performed, and poor user experience is caused is solved, more key points are introduced in a model training stage to train to obtain a contour marking model with higher accuracy, the image can be processed based on the contour marking model, the accuracy of contour marking is improved, the effect of subsequent image processing is improved, and the method for processing the image based on the contour marking model also improves the marking efficiency of the face contour, so that the effect of improving user experience is achieved.
The image processing device provided by the embodiment of the disclosure can execute the image processing method provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that each unit and module included in the above apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for convenience of distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
Fig. 7 is a block diagram of an image labeling device according to an embodiment of the present disclosure, which may execute the image labeling method according to any embodiment of the present disclosure, and has functional modules and beneficial effects corresponding to the execution method.
As shown in fig. 7, the apparatus specifically includes: the image acquisition module 710, the average point determination module 720, the average annotation point determination module 730 and the annotation image determination module 740.
An image acquisition module 710, configured to acquire an original image including an object to be annotated;
the average point determining module 720 is configured to determine an average point of a basic annotation point and an adjacent basic annotation point of a face contour of an object to be annotated in an original image;
the equipartition annotation point determining module 730 is configured to determine equipartition annotation points based on the base annotation points, the equipartition points of the adjacent base annotation points, and the facial contours of the objects to be annotated, where the equipartition annotation points are determined based on annotation lines associated with the adjacent base annotation points, and the annotation lines are perpendicular to the connecting lines of the two adjacent base annotation points;
the annotation image determining module 740 is configured to determine an annotation image of the original image based on the average annotation point and the base annotation point of the original image.
On the basis of the technical scheme, the equally dividing point determining module is specifically configured to: and determining the uniform distribution points according to the uniform distribution ratio of the adjacent basic marking points and the basic connecting line length of the adjacent basic marking points.
On the basis of the technical scheme, the equally dividing and marking point determining module comprises:
a basic connection line determining unit for determining basic connection lines connecting the adjacent basic annotation points,
the marking straight line determining unit is used for determining a marking straight line which passes through the equipartition point and is perpendicular to the basic connecting line;
and the equipartition marking point determining unit is used for determining equipartition marking points corresponding to the equipartition points according to the marking straight line and the edge contour of the object to be marked.
On the basis of the technical scheme, the equally dividing and marking point determining unit is specifically used for: and determining the equipartition marking points attached to the edge outline of the object to be marked on the marking straight line.
On the basis of the technical scheme, the basic marking points comprise at least two of forehead vertexes, forehead points, nie Jiaodian, temple points, cheekbone points, mandible points and chin points.
According to the technical scheme, the original image comprising the object to be annotated is obtained, so that basic annotation points of the face outline of the object to be annotated and average points of adjacent basic annotation points in the original image are determined, the average annotation points are determined based on the basic annotation points, the average points of the adjacent basic annotation points and the face outline of the object to be annotated, and finally the annotation image of the original image is determined based on the average annotation points and the basic annotation points of the original image. The problem that follow-up processing cannot be performed due to inaccurate identification of the outline key points in the prior art, and poor user experience is caused is solved, accuracy and high efficiency of outline marking are improved, namely, efficiency of outline marking is improved, image marking effect is improved, and therefore user experience improving effect is achieved.
The image labeling device provided by the embodiment of the disclosure can execute the image labeling method provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that each unit and module included in the above apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for convenience of distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure. Referring now to fig. 8, a schematic diagram of an electronic device (e.g., a terminal device or server in fig. 8) 800 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 8 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 8, the electronic device 800 may include a processing means (e.g., a central processor, a graphics processor, etc.) 801, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage means 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An edit/output (I/O) interface 805 is also connected to the bus 804.
In general, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, etc.; storage 808 including, for example, magnetic tape, hard disk, etc.; communication means 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 8 shows an electronic device 800 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication device 809, or installed from storage device 808, or installed from ROM 802. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 801.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The electronic device provided by the embodiment of the present disclosure belongs to the same inventive concept as the image processing method or the image labeling method provided by the above embodiment, and technical details not described in detail in the present embodiment can be seen in the above embodiment, and the present embodiment has the same beneficial effects as the above embodiment.
The embodiment of the present disclosure provides a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the image processing method or the image labeling method provided by the above embodiment.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to:
acquiring an image to be processed comprising a target object;
labeling the face edge contour of the target object in the image to be processed based on a target face contour labeling model to obtain a target image corresponding to the image to be processed;
the target face contour labeling model is obtained based on training of at least one training sample, the training sample comprises an original image and a corresponding labeling image, the face edge contour of an object to be labeled in the labeling image is labeled by at least three labeling points, the at least three labeling points comprise basic labeling points and at least one equipartition labeling point between two adjacent basic labeling points, the equipartition labeling points are determined according to at least one labeling straight line of the two adjacent basic labeling points, and the labeling straight line is perpendicular to a connecting line of the two adjacent basic labeling points.
Acquiring an original image comprising an object to be annotated;
determining basic marking points of the face contours of the objects to be marked in the original image and average points of adjacent basic marking points;
determining equipartition marking points based on the base marking points, equipartition points of the adjacent base marking points and facial contours of the objects to be marked, wherein the equipartition marking points are determined based on marking lines associated with the adjacent base marking points, and the marking lines are perpendicular to connecting lines of the two adjacent base marking points;
and determining the marked image of the original image based on the average marked point and the basic marked point of the original image.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (16)

1. An image processing method, comprising:
in response to detecting the trigger indication, acquiring a to-be-processed image comprising the target object;
labeling the facial edge contour of the target object in the image to be processed based on a target model to obtain a target image corresponding to the image to be processed;
the target model is obtained based on training samples, the training samples comprise original images and corresponding labeling images, the facial edge contours of objects to be labeled in the labeling images are labeled by labeling points, the labeling points comprise basic labeling points and equally divided labeling points located between adjacent basic labeling points, the equally divided labeling points are determined based on labeling straight lines associated with the adjacent basic labeling points, and the labeling straight lines are perpendicular to connecting lines of the two adjacent basic labeling points.
2. The method of claim 1, wherein the trigger indication comprises at least one of:
the target object enters a mirror entering picture of a user;
triggering voice indication of the target special effect prop associated with the outline annotation sent by the user;
the user touches a control for triggering a target special effect prop associated with the contour annotation.
3. The method according to claim 1 or 2, wherein the training samples are obtained by:
determining basic marking points of the face contours of the objects to be marked in the original image and average points of adjacent basic marking points;
determining equipartition marking points based on the base marking points, the equipartition points of the adjacent base marking points and the facial contours of the objects to be marked;
and determining the marked image of the original image based on the average marked point and the basic marked point of the original image.
4. A method according to claim 3, wherein determining the average point of adjacent basic labeling points of the face contour of the object to be labeled in the original image comprises:
and determining the uniform distribution points according to the uniform distribution ratio of the adjacent basic marking points and the basic connecting line length of the adjacent basic marking points.
5. The method of claim 3, wherein the determining the equipartition annotation points based on the equipartition points of the base annotation points, the neighboring base annotation points, and the facial contours of the object to be annotated comprises:
determining a base connection connecting the adjacent base annotation points,
determining an annotation straight line passing through the equipartition point and perpendicular to the basic connecting line;
and determining average marking points corresponding to the average marking points according to the marking straight line and the edge contour of the object to be marked.
6. The method of claim 5, wherein determining equipartition annotation points based on the annotation line and the edge profile of the object to be annotated comprises:
and determining the equipartition marking points attached to the edge outline of the object to be marked on the marking straight line.
7. The method of any one of claims 1-6, wherein the base annotation points comprise at least two of forehead apex, forehead point, nie Jiaodian, temple point, cheekbone point, mandibular point, chin apex point.
8. An image labeling method, comprising:
acquiring an original image comprising an object to be annotated;
Determining basic marking points of the face contours of the objects to be marked in the original image and average points of adjacent basic marking points;
determining equipartition marking points based on the base marking points, equipartition points of the adjacent base marking points and facial contours of the objects to be marked, wherein the equipartition marking points are determined based on marking lines associated with the adjacent base marking points, and the marking lines are perpendicular to connecting lines of the two adjacent base marking points;
and determining the marked image of the original image based on the average marked point and the basic marked point of the original image.
9. The method according to claim 8, wherein determining the average points of adjacent basic labeling points of the face contour of the object to be labeled in the original image comprises:
and determining the uniform distribution points according to the uniform distribution ratio of the adjacent basic marking points and the basic connecting line length of the adjacent basic marking points.
10. The method of claim 8, wherein the determining the equipartition annotation points based on the base annotation points, the equipartition points of the adjacent base annotation points, and the facial contours of the object to be annotated comprises:
determining a base connection connecting the adjacent base annotation points,
Determining an annotation straight line passing through the equipartition point and perpendicular to the basic connecting line;
and determining average marking points corresponding to the average marking points according to the marking straight line and the edge contour of the object to be marked.
11. The method of claim 10, wherein determining equipartition annotation points based on the annotation line and the edge profile of the object to be annotated comprises:
and determining the equipartition marking points attached to the edge outline of the object to be marked on the marking straight line.
12. The method of any one of claims 8-11, wherein the base annotation points comprise at least two of forehead vertices, forehead points, nie Jiaodian, temple points, cheekbone points, mandibular points, chin points.
13. An image processing apparatus, comprising:
the image acquisition module to be processed is used for responding to the detection of the trigger indication and acquiring an image to be processed comprising the target object;
the target image acquisition module is used for marking the facial edge contour of the target object in the image to be processed based on the target model to obtain a target image corresponding to the image to be processed;
The target model is obtained based on training samples, the training samples comprise original images and corresponding labeling images, the facial edge contours of objects to be labeled in the labeling images are labeled by labeling points, the labeling points comprise basic labeling points and equally divided labeling points located between adjacent basic labeling points, the equally divided labeling points are determined based on labeling straight lines associated with the adjacent basic labeling points, and the labeling straight lines are perpendicular to connecting lines of the two adjacent basic labeling points.
14. An image marking apparatus, comprising:
the image acquisition module is used for acquiring an original image comprising an object to be marked;
the average point determining module is used for determining basic marking points of the face contours of the objects to be marked in the original image and average points of adjacent basic marking points;
the equipartition annotation point determining module is used for determining equipartition annotation points based on the basic annotation points, the equipartition points of the adjacent basic annotation points and the facial contours of the objects to be annotated, wherein the equipartition annotation points are determined based on annotation lines associated with the adjacent basic annotation points, and the annotation lines are perpendicular to the connecting lines of the two adjacent basic annotation points;
The marked image determining module is used for determining the marked image of the original image based on the average marked point and the basic marked point of the original image.
15. An electronic device, the device comprising:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the image processing or image labeling method of any of claims 1-7 or claims 8-12.
16. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the image processing or image labeling method according to any of claims 1-7 or claims 8-12.
CN202210551518.9A 2022-05-18 2022-05-18 Image processing and labeling method and device, electronic equipment and storage medium Pending CN117152479A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210551518.9A CN117152479A (en) 2022-05-18 2022-05-18 Image processing and labeling method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210551518.9A CN117152479A (en) 2022-05-18 2022-05-18 Image processing and labeling method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117152479A true CN117152479A (en) 2023-12-01

Family

ID=88901368

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210551518.9A Pending CN117152479A (en) 2022-05-18 2022-05-18 Image processing and labeling method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117152479A (en)

Similar Documents

Publication Publication Date Title
WO2020199906A1 (en) Facial keypoint detection method, apparatus and device, and storage medium
CN109086709B (en) Feature extraction model training method and device and storage medium
WO2019134516A1 (en) Method and device for generating panoramic image, storage medium, and electronic apparatus
WO2020224479A1 (en) Method and apparatus for acquiring positions of target, and computer device and storage medium
WO2019238114A1 (en) Three-dimensional dynamic model reconstruction method, apparatus and device, and storage medium
WO2022012085A1 (en) Face image processing method and apparatus, storage medium, and electronic device
CN111414879B (en) Face shielding degree identification method and device, electronic equipment and readable storage medium
CN109670444B (en) Attitude detection model generation method, attitude detection device, attitude detection equipment and attitude detection medium
US20220358662A1 (en) Image generation method and device
CN110062157B (en) Method and device for rendering image, electronic equipment and computer readable storage medium
WO2020052062A1 (en) Detection method and device
US11348254B2 (en) Visual search method, computer device, and storage medium
CN109981989B (en) Method and device for rendering image, electronic equipment and computer readable storage medium
CN112906553B (en) Image processing method, apparatus, device and medium
TW202312725A (en) Follow-up shooting method and device, medium and electronic device
CN112101109B (en) Training method and device for face key point detection model, electronic equipment and medium
CN110728167A (en) Text detection method and device and computer readable storage medium
CN109816791B (en) Method and apparatus for generating information
CN117152479A (en) Image processing and labeling method and device, electronic equipment and storage medium
CN114049403A (en) Multi-angle three-dimensional face reconstruction method and device and storage medium
WO2021073204A1 (en) Object display method and apparatus, electronic device, and computer readable storage medium
CN111540009A (en) Method, apparatus, electronic device, and medium for generating detection information
CN111063011A (en) Face image processing method, device, equipment and medium
CN111124862A (en) Intelligent equipment performance testing method and device and intelligent equipment
CN112306223B (en) Information interaction method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination