CN107767326B - Method and device for processing object transformation in image and computing equipment - Google Patents

Method and device for processing object transformation in image and computing equipment Download PDF

Info

Publication number
CN107767326B
CN107767326B CN201710896416.XA CN201710896416A CN107767326B CN 107767326 B CN107767326 B CN 107767326B CN 201710896416 A CN201710896416 A CN 201710896416A CN 107767326 B CN107767326 B CN 107767326B
Authority
CN
China
Prior art keywords
key
image
curve
coordinate system
target object
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.)
Active
Application number
CN201710896416.XA
Other languages
Chinese (zh)
Other versions
CN107767326A (en
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 Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo 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 Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201710896416.XA priority Critical patent/CN107767326B/en
Publication of CN107767326A publication Critical patent/CN107767326A/en
Application granted granted Critical
Publication of CN107767326B publication Critical patent/CN107767326B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • G06T3/04
    • G06T5/70
    • G06T5/80
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Abstract

The invention discloses a method, a device and a computing device for processing object transformation in an image, wherein the method comprises the following steps: acquiring a first image to be processed, which contains a source object; acquiring a second image containing a target object; extracting first key information of a source object from a first image and extracting second key information of a target object from a second image; establishing a coordinate system, and respectively performing fitting processing in the coordinate system according to the first key information and the second key information to obtain a key curve of the source object and a key curve of the target object; calculating an amplitude adjustment curve according to the key curve of the source object and the key curve of the target object; the first image is adjusted according to the amplitude adjustment curve to obtain a third image, the third image is stored according to a shooting instruction triggered by a user, smooth conversion can be kept in the object conversion process, and therefore after the object conversion processing is finished, the obtained third image is more natural, and the object conversion processing effect is more fine.

Description

Method and device for processing object transformation in image and computing equipment
Technical Field
The invention relates to the field of image processing, in particular to a method and a device for processing object transformation in an image, computing equipment and a computer storage medium.
Background
With the development of science and technology, the technology of image acquisition equipment is also increasing day by day. The acquired image is clearer, and the resolution and the display effect are also greatly improved. However, the existing image may not meet the requirement of the user, and the user wants to perform transformation processing on the object in the image. When the existing object transformation processing method is used for transformation processing, only the mapping of pixel points is simply carried out, and smooth transformation is not carried out during the transformation processing, so that creases are easily generated on the edge of an image, the inside of the image is deformed, the unnatural problem is caused, and the display effect of the image is poor.
Disclosure of Invention
In view of the above, the present invention has been made to provide an object-in-image transformation processing method, apparatus, computing device, and computer storage medium that overcome or at least partially solve the above problems.
According to an aspect of the present invention, there is provided a method for processing object transformation in an image, including:
acquiring a first image to be processed, which contains a source object;
acquiring a second image containing a target object;
extracting first key information of a source object from a first image and extracting second key information of a target object from a second image;
establishing a coordinate system, and respectively performing fitting processing in the coordinate system according to the first key information and the second key information to obtain a key curve of the source object and a key curve of the target object;
calculating an amplitude adjustment curve according to the key curve of the source object and the key curve of the target object;
and adjusting the first image according to the amplitude adjustment curve to obtain a third image.
Optionally, the first key information includes location information of at least one first key point, and the second key information includes location information of at least one second key point.
Optionally, the establishing a coordinate system further includes: establishing a polar coordinate system;
the obtaining of the key curve of the source object and the key curve of the target object by performing fitting processing in the coordinate system according to the first key information and the second key information further includes:
extracting position information of a central point of the source object from a first image, mapping the central point of the source object as a pole of a polar coordinate system, mapping the at least one first key point into the polar coordinate system according to the relative position between the at least one first key point and the central point of the source object, and fitting in the polar coordinate system according to the mapping result of the at least one first key point to obtain a key curve of the source object;
extracting position information of a central point of the target object from a second image, mapping the central point of the target object as a pole of a polar coordinate system, mapping the at least one second key point to the polar coordinate system according to the relative position between the at least one second key point and the central point of the target object, and fitting in the polar coordinate system according to the mapping result of the at least one second key point to obtain a key curve of the target object.
Optionally, the calculating an amplitude adjustment curve according to the key curve of the source object and the key curve of the target object further includes:
and calculating an adjustment coefficient corresponding to the polar angle according to the polar diameter of any point on the key curve of the source object and the polar diameter of a point on the key curve of the target object with the same polar angle as the point, so as to obtain an amplitude adjustment curve related to the relation between the polar angle and the adjustment coefficient.
Optionally, before establishing the polar coordinate system, the method further includes:
correcting the position information of the at least one first key point according to the position information of the central point of the source object; and correcting the position information of the at least one second key point according to the position information of the central point of the target object.
Optionally, the method further comprises: and displaying the third image.
Optionally, the acquiring a first image to be processed containing a source object further includes:
a first image containing a source object captured by an image acquisition device is acquired in real-time.
Optionally, the method further comprises: and saving the third image according to a shooting instruction triggered by a user.
Optionally, the method further comprises: and saving the video formed by the third image as a frame image according to a recording instruction triggered by a user.
According to another aspect of the present invention, there is provided an in-image object transform processing apparatus including:
the device comprises a first acquisition module, a second acquisition module and a processing module, wherein the first acquisition module is suitable for acquiring a first image containing a source object to be processed;
a second acquisition module adapted to acquire a second image containing the target object;
the extraction module is suitable for extracting first key information of a source object from a first image and extracting second key information of a target object from a second image;
the coordinate system establishing module is suitable for establishing a coordinate system;
the fitting processing module is suitable for respectively performing fitting processing in a coordinate system according to the first key information and the second key information to obtain a key curve of the source object and a key curve of the target object;
the calculation module is suitable for calculating an amplitude adjustment curve according to the key curve of the source object and the key curve of the target object;
and the adjusting module is suitable for adjusting the first image according to the amplitude adjusting curve to obtain a third image.
Optionally, the first key information includes location information of at least one first key point, and the second key information includes location information of at least one second key point.
Optionally, the coordinate system establishing module is further adapted to: establishing a polar coordinate system;
the fitting processing module is further adapted to: extracting position information of a central point of the source object from a first image, mapping the central point of the source object as a pole of a polar coordinate system, mapping the at least one first key point into the polar coordinate system according to the relative position between the at least one first key point and the central point of the source object, and fitting in the polar coordinate system according to the mapping result of the at least one first key point to obtain a key curve of the source object;
extracting position information of a central point of the target object from a second image, mapping the central point of the target object as a pole of a polar coordinate system, mapping the at least one second key point to the polar coordinate system according to the relative position between the at least one second key point and the central point of the target object, and fitting in the polar coordinate system according to the mapping result of the at least one second key point to obtain a key curve of the target object.
Optionally, the calculation module is further adapted to: and calculating an adjustment coefficient corresponding to the polar angle according to the polar diameter of any point on the key curve of the source object and the polar diameter of a point on the key curve of the target object with the same polar angle as the point, so as to obtain an amplitude adjustment curve related to the relation between the polar angle and the adjustment coefficient.
Optionally, the apparatus further comprises: the correction processing module is suitable for correcting the position information of the at least one first key point according to the position information of the central point of the source object; and correcting the position information of the at least one second key point according to the position information of the central point of the target object.
Optionally, the apparatus further comprises: and the display module is suitable for displaying the third image.
Optionally, the first obtaining module is further adapted to: a first image containing a source object captured by an image acquisition device is acquired in real-time.
Optionally, the apparatus further comprises: and the first storage module is suitable for storing the third image according to a shooting instruction triggered by a user.
Optionally, the apparatus further comprises: and the second storage module is suitable for storing the video formed by the third image as the frame image according to the recording instruction triggered by the user.
According to yet another aspect of the present invention, there is provided a computing device comprising: the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the object transformation processing method in the image.
According to still another aspect of the present invention, there is provided a computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to perform an operation corresponding to the method for processing object transformation in an image.
According to the scheme provided by the invention, the first key information of the source object is extracted from the first image, the second key information of the target object is extracted from the second image, the key curve of the source object and the key curve of the target object are obtained by respectively performing fitting processing in the coordinate system according to the first key information and the second key information, the amplitude adjustment curve is calculated according to the key curve of the source object and the key curve of the target object, the first image is adjusted according to the amplitude adjustment curve, smooth transformation can be kept in the object transformation process, therefore, after the object transformation processing is finished, the obtained third image is ensured to be more natural, the object transformation processing effect is finer, and the problems that the edge is creased after the object transformation in the prior art and the image is deformed rather than being natural are solved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flow diagram illustrating a method for processing object transformations in an image according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a method of processing object transformation in an image according to another embodiment of the present invention;
FIG. 3 illustrates a face type diagram of a source object;
FIG. 4 illustrates a face diagram of a target object;
fig. 5 is a schematic structural diagram showing an object transform processing apparatus in an image according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram showing an object transform processing apparatus in an image according to another embodiment of the present invention;
FIG. 7 illustrates a block diagram of a computing device, according to one embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In the embodiment, the description is given by taking a human face as an example, but the present invention is not limited to a human face, and for example, the present invention may also be used to perform transformation processing on the whole human body in an image.
Fig. 1 is a flowchart illustrating an object transformation processing method in an image according to an embodiment of the present invention. As shown in fig. 1, the method comprises the steps of:
step S100, a first image to be processed containing a source object is acquired.
In the embodiment of the present invention, the first image to be processed, which includes the source object, may be captured by a user using an image capture device, may also be determined according to a selected operation of the user on an image in an album, and may also be uploaded by the user, which is not specifically limited herein; the source object can be a human face, certainly can also be a favorite and the like, any object can be transformed by utilizing the object transformation processing technology in the image, and a processing object can be selected as the source object by a person skilled in the art according to actual needs.
Step S101, a second image containing the target object is acquired.
The target object defines a desired criterion, wherein the second image containing the target object may be determined according to a user selected operation on an image in an album, for example, an image of a star concerned by the user is stored in the album, and the user may select one image from the second image, or the second image may be uploaded or downloaded from a network. Taking the example that user a wishes to convert his face to that of a certain star B, the face of user a is the source object and the face of star B is the target object.
Step S102, extracting first key information of a source object from a first image, and extracting second key information of a target object from a second image.
In order to facilitate the object transformation process, first key information of a source object needs to be extracted from a first image, and second key information of a target object needs to be extracted from a second image, for example, when the face shape needs to be transformed, the extracted first key information mainly includes face outline information of the source object, such as external canthus and chin; the extracted second key information mainly includes facial outer contour information of the target object, such as external canthus and chin. The key information can be used for improving the processing speed and efficiency of object transformation, and meanwhile, the key information is convenient to extract, accurate in extraction and more convenient to perform object transformation processing.
And step S103, establishing a coordinate system, and respectively performing fitting processing in the coordinate system according to the first key information and the second key information to obtain a key curve of the source object and a key curve of the target object.
In the embodiment of the invention, the fitting process is to connect a series of first key information on the plane by a smooth curve, and connect a series of second key information on the plane by a smooth curve. Taking a human face as an example, fitting in a coordinate system according to the first key information to obtain a key curve of the source object, which is similar to the face contour of the source object; and performing fitting processing in the coordinate system according to the second key information to obtain a key curve of the target object similar to the facial contour of the target object, which is only an example and has no limiting effect.
And step S104, calculating an amplitude adjustment curve according to the key curve of the source object and the key curve of the target object.
Although the key curve of the source object and the key curve of the target object are obtained in step S103, the key curve of the source object and the key curve of the target object are not simply adjusted to the key curve of the target object in the embodiment of the present invention, and if the key curve of the source object is simply adjusted to the key curve of the target object, the edge of the object after transformation is easily creased, and the inside of the image is also deformed rather than natural.
And S105, adjusting the first image according to the amplitude adjustment curve to obtain a third image.
After the amplitude adjustment curve is obtained through calculation, the first image can be adjusted according to the amplitude adjustment curve, and all pixel points of the first image are adjusted, so that the first image is kept smooth in the object transformation process, and the problems that the edge of the object is creased after the object is transformed and the inside of the image is deformed and unnatural are solved.
According to the method provided by the above embodiment of the present invention, the first key information of the source object is extracted from the first image, the second key information of the target object is extracted from the second image, the fitting process is performed in the coordinate system according to the first key information and the second key information to obtain the key curve of the source object and the key curve of the target object, the amplitude adjustment curve is calculated according to the key curve of the source object and the key curve of the target object, the first image is adjusted according to the amplitude adjustment curve, the smooth transformation can be maintained in the object transformation process, so that after the object transformation process is completed, the obtained third image is ensured to be more natural, the object transformation process effect is finer, the image display effect is beautified, the problems that the edge is creased after the object transformation in the prior art and the image is deformed and unnatural are solved, the processed image can be conveniently and quickly obtained, the image processing efficiency is improved, and the image processing mode is optimized.
Fig. 2 is a flowchart illustrating an object transformation processing method in an image according to another embodiment of the present invention. As shown in fig. 2, the method comprises the steps of:
step S200, acquiring a first image containing a source object captured by an image acquisition device in real time.
In this embodiment, the image capturing device is described by taking a mobile terminal as an example. The method includes acquiring a first image captured by a camera of a mobile terminal in real time, where the first image includes source objects, such as a human face and a human body, which are only exemplified and do not have any limiting effect, and the object transformation processing method will be specifically described below by taking an example of transforming a face of a human face.
In step S201, a second image including the target object is acquired.
The target object defines a desired criterion, wherein the second image containing the target object may be determined according to a user selected operation on an image in an album, for example, an image of a star concerned by the user is stored in the album, and the user may select one image from the second image, or the second image may be uploaded or downloaded from a network. Taking the example that user a wishes to convert his face to that of a certain star B, the face of user a is the source object and the face of star B is the target object.
In step S202, first key information of the source object is extracted from the first image, and second key information of the target object is extracted from the second image.
The first key information comprises position information of at least one first key point, and the position information indicates the position of the first key point in the face; the second key information comprises position information of at least one second key point, and the position information indicates the position of the second key point in the face.
In particular, a source object may be identified from the first image: extracting the position information of at least one first key point from the face part of the user A, such as the position information of points P1-P8 shown in FIG. 3; identifying a target object from the second image: the face part of star B extracts the position information of at least one first key point, such as the position information of points P1-P8 shown in fig. 4, which is only schematic and has no limiting effect.
Step S203, performing correction processing on the position information of the at least one first key point according to the position information of the center point of the source object.
In the embodiment of the present invention, the first image containing the source object may be a side face image of the source object, or an image subjected to enlargement or reduction processing, for such images, if the object transformation processing is directly performed without any processing, it is easy to cause inaccuracy of the object transformation processing, resulting in poor effect of the object transformation, and therefore, after extracting the first key information of the source object from the first image, according to the position information of the central point of the source object, correcting the position information of the at least one first key point, wherein the face shape is changed as an example, the center point of the source object can be selected as the midpoint of two eyes, the at least one first key point is spread and symmetrically distributed along the center point of the source object, then, image scaling processing is carried out, so that the human face is changed to a size position of a comparison standard, and subsequent object transformation processing is facilitated.
Step S204, according to the position information of the central point of the target object, the position information of at least one second key point is corrected.
In the embodiment of the present invention, the second image containing the target object may be a side face image of the target object, or an image subjected to an enlargement or reduction process, and for such an image, if the second key information of the target object is extracted from the second image, the position information of at least one second key point may be corrected according to the position information of the center point of the target object, and the face shape transformation is continued as an example, the center point of the target object may be selected as the center point of two eyes, the at least one second key point is expanded and symmetrically distributed along the center point of the target object, and then the image scaling process is performed, so that the face changes to a size position of a comparison standard, facilitating subsequent object transformation processing.
Step S205, establishing a polar coordinate system, extracting position information of a center point of the source object from the first image, mapping the center point of the source object as a pole of the polar coordinate system, mapping at least one first key point into the polar coordinate system according to a relative position between the at least one first key point and the center point of the source object, and fitting in the polar coordinate system according to a mapping result of the at least one first key point to obtain a key curve of the source object.
Taking the face shape transformation as an example, the midpoint of the two eyes of the person can be regarded as the center point of the source object in the first image, the position information of the center point of the source object is extracted from the first image, the midpoint of the two eyes of the person is mapped to be the pole of the polar coordinate system, the polar coordinate system is established, in order to be able to accurately fit the key curve of the source object and to represent the face of the source object as much as possible in a polar coordinate system, it is necessary to determine the relative position, including the angle and distance, then, mapping the at least one first keypoint into the polar coordinate system according to a relative position between the at least one first keypoint and the center point of the source object, fitting the mapping result of at least one first key point in a polar coordinate system to obtain a key curve of the source object, in an embodiment of the present invention, the fitting process is performed by connecting a series of at least one first keypoint of the plane by a smooth curve. Specifically, after the coordinate system is established, the fitting process may be performed by using a least square curve fitting method, taking the face of the source object as a square face as an example, after the first key information is extracted and obtained, the fitting process is performed in the coordinate system by using the least square curve fitting method according to the first key information, so as to obtain a key curve of the source object approximate to the face outer contour of the square face of the source object, as shown in fig. 3, which is only an example and does not have any limiting effect.
Step S206, extracting the position information of the central point of the target object from the second image, mapping the central point of the target object as the pole of the polar coordinate system, mapping at least one second key point into the polar coordinate system according to the relative position between the at least one second key point and the central point of the target object, and fitting the mapping result of the at least one second key point in the polar coordinate system to obtain a key curve of the target object.
Taking the face shape transformation as an example, the midpoint of the two eyes of the person can be regarded as the center point of the target object in the second image, extracting the position information of the central point of the target object from the second image, mapping the midpoints of two eyes of a person as the poles of a polar coordinate system, establishing the polar coordinate system, in order to be able to accurately fit the key curve of the target object and to represent the face of the target object as much as possible in a polar coordinate system, it is necessary to determine the relative position, including the angle and the distance, then, mapping the at least one second keypoint into the polar coordinate system according to the relative position between the at least one second keypoint and the center point of the target object, fitting the mapping result of at least one second key point in a polar coordinate system to obtain a key curve of the target object, in an embodiment of the invention, the fitting process is performed by connecting a series of at least one second keypoint of the plane by a smooth curve. Specifically, after the coordinate system is established, the fitting process may be performed by using a least square curve fitting method, taking the face of the target object as the heart-shaped face as an example, after the first key information is extracted and obtained, the fitting process is performed in the coordinate system by using the least square curve fitting method according to the first key information, so as to obtain a key curve of the target object approximate to the face outer contour of the heart-shaped face of the target object, as shown in fig. 4, which is only an example and does not have any limiting effect.
Step S207, calculating an adjustment coefficient corresponding to the polar angle according to the polar diameter of any point on the key curve of the source object and the polar diameter of a point on the key curve of the target object having the same polar angle as the point, to obtain an amplitude adjustment curve relating to the relationship between the polar angle and the adjustment coefficient.
Although the key curve of the source object and the key curve of the target object are obtained in step S206, the key curve of the source object and the key curve of the target object are not simply adjusted to the key curve of the target object, and if the key curve of the source object is simply adjusted to the key curve of the target object, the edge of the object after transformation is prone to be creased, and the interior of the image is deformed rather than natural.
Specifically, any point on the key curve of the source object is selected, the polar diameter of the point is determined, a point on the key curve of the target object having the same polar angle as the point is found, the polar diameter of the point on the key curve of the target object is determined, and the adjustment coefficient is calculated according to the polar diameter of the point on the key curve of the source object and the polar diameter of the point on the key curve of the target object, so that the amplitude adjustment curve related to the relationship between the polar angle and the adjustment coefficient is obtained.
And S208, adjusting the first image according to the amplitude adjustment curve to obtain a third image.
After the amplitude adjustment curve is obtained through calculation, the first image can be adjusted according to the amplitude adjustment curve, and all pixel points of the first image are adjusted, so that the first image is kept smooth in the object transformation process, and the problems that the edge of the object is creased after the object is transformed and the inside of the image is deformed and unnatural are solved.
The object transformation processing method in the image of the invention can also be used for transforming the human body, the central point can be selected as the navel part, and the concrete transformation processing method is not described in detail here.
In step S209, the third image is displayed.
And displaying the obtained third image in real time, so that a user can directly see the third image obtained after the first image is processed. Immediately after the third image is obtained, the captured first image is replaced with the third image for display, typically within 1/24 seconds, which is equivalent to displaying the third image in real time since the replacement time is relatively short and no noticeable perception is provided to the human eye.
And step S210, saving the third image according to a shooting instruction triggered by the user.
After the third image is displayed, the third image can be saved according to a shooting instruction triggered by a user. And if the user clicks a shooting button of the camera, triggering a shooting instruction, and storing the displayed third image.
And step S211, storing the video formed by the third image as the frame image according to the recording instruction triggered by the user.
When the third image is displayed, the video formed by the third image as the frame image can be stored according to a recording instruction triggered by a user. And if the user clicks a recording button of the camera, triggering a recording instruction, and storing the displayed third image as a frame image in the video, so that a plurality of third images are stored as the video formed by the frame images.
Step S210 and step S211 are optional steps of this embodiment, and there is no execution sequence, and corresponding steps are selected and executed according to different instructions triggered by the user.
According to the method provided by the above embodiment of the present invention, the position information of the first key point of the source object extracted from the first image is corrected, and the position information of the second key point of the target object extracted from the second image is corrected, so that the subsequent object transformation processing is more accurate, the object transformation effect is improved, the key curve of the source object and the key curve of the target object are obtained by performing fitting processing in the coordinate system according to the first key information and the second key information, the amplitude adjustment curve is calculated according to the key curve of the source object and the key curve of the target object, the first image is adjusted according to the amplitude adjustment curve, so that smooth transformation can be maintained in the object transformation process, and after the object transformation processing is finished, the obtained third image is ensured to be more natural, and the object transformation processing effect is more fine, the method overcomes the phenomenon that the edge of the image is creased after the object is transformed in the prior art and solves the problem that the image is deformed and unnatural. The invention does not limit the technical level of the user, does not need the user to additionally process the image, saves the time of the user, can feed back the processed image in real time and is convenient for the user to check.
Fig. 5 is a schematic structural diagram of an apparatus for processing object transformation in an image according to an embodiment of the present invention. As shown in fig. 5, the apparatus includes: the system comprises a first acquisition module 500, a second acquisition module 501, an extraction module 502, a coordinate system establishing module 503, a fitting processing module 504, a calculation module 505 and an adjustment module 506.
A first acquisition module 500 adapted to acquire a first image to be processed containing a source object.
A second acquisition module 501 adapted to acquire a second image containing the target object.
The extracting module 502 is adapted to extract first key information of the source object from the first image and extract second key information of the target object from the second image.
A coordinate system establishing module 503 adapted to establish a coordinate system.
And the fitting processing module 504 is adapted to perform fitting processing in the coordinate system according to the first key information and the second key information to obtain a key curve of the source object and a key curve of the target object.
The calculation module 505 is adapted to calculate an amplitude adjustment curve from the key curve of the source object and the key curve of the target object.
The adjusting module 506 is adapted to adjust the first image according to the amplitude adjustment curve to obtain a third image.
According to the device provided by the above embodiment of the invention, the first key information of the source object is extracted from the first image, and the second key information of the target object is extracted from the second image, fitting in a coordinate system according to the first key information and the second key information to obtain a key curve of the source object and a key curve of the target object, calculating an amplitude adjustment curve according to the key curve of the source object and the key curve of the target object, adjusting the first image according to the amplitude adjustment curve, realizing the purpose of keeping smooth transformation in the object transformation process, thereby ensuring that the obtained third image is more natural after the object transformation processing is finished, the object transformation processing effect is more fine, and the problems that in the prior art, the edge is creased after the object is transformed and the inside of an image is deformed and unnatural are solved.
Fig. 6 is a schematic structural diagram of an apparatus for processing object transformation in an image according to another embodiment of the present invention. As shown in fig. 6, the apparatus includes: the system comprises a first acquisition module 600, a second acquisition module 601, an extraction module 602, a coordinate system establishing module 603, a fitting processing module 604, a calculation module 605 and an adjustment module 606.
The first acquisition module 600 is adapted to acquire a first image containing a source object captured by an image acquisition device in real time.
A second acquisition module 601 adapted to acquire a second image containing the target object.
The extraction module 602 is adapted to extract first key information of a source object from a first image and extract second key information of a target object from a second image.
The first key information comprises the position information of at least one first key point, and the second key information comprises the position information of at least one second key point.
The correction processing module 607 is adapted to perform correction processing on the position information of the at least one first key point according to the position information of the center point of the source object; and correcting the position information of the at least one second key point according to the position information of the central point of the target object.
A coordinate system establishing module 603 adapted to establish a polar coordinate system.
The fitting processing module 604 is adapted to extract position information of a center point of the source object from the first image, map the center point of the source object as a pole of the polar coordinate system, map at least one first key point into the polar coordinate system according to a relative position between the at least one first key point and the center point of the source object, and perform fitting processing in the polar coordinate system according to a mapping result of the at least one first key point to obtain a key curve of the source object; and extracting the position information of the central point of the target object from the second image, mapping the central point of the target object as a pole of a polar coordinate system, mapping at least one second key point into the polar coordinate system according to the relative position between the at least one second key point and the central point of the target object, and fitting in the polar coordinate system according to the mapping result of the at least one second key point to obtain a key curve of the target object.
The calculating module 605 is adapted to calculate an adjustment coefficient corresponding to the polar angle according to the polar diameter of any point on the key curve of the source object and the polar diameter of a point on the key curve of the target object having the same polar angle as the point, so as to obtain an amplitude adjustment curve relating to the relationship between the polar angle and the adjustment coefficient.
The adjusting module 606 is adapted to adjust the first image according to the amplitude adjustment curve to obtain a third image.
A display module 608 adapted to display the third image.
The first saving module 609 is adapted to save the third image according to a shooting instruction triggered by the user.
And the second storage module 610 is adapted to store a video composed of the third image as a frame image according to a recording instruction triggered by a user.
According to the device provided by the above embodiment of the present invention, the position information of the first key point of the source object extracted from the first image is corrected, and the position information of the second key point of the target object extracted from the second image is corrected, so that the subsequent object transformation processing can be more accurate, the object transformation effect is improved, the key curve of the source object and the key curve of the target object are obtained by performing fitting processing in the coordinate system according to the first key information and the second key information, the amplitude adjustment curve is calculated according to the key curve of the source object and the key curve of the target object, the first image is adjusted according to the amplitude adjustment curve, so that smooth transformation can be maintained in the object transformation process, and after the object transformation processing is finished, the obtained third image can be ensured to be more natural, and the object transformation processing effect is more fine, the method overcomes the phenomenon that the edge of the image is creased after the object is transformed in the prior art and solves the problem that the image is deformed and unnatural. The invention does not limit the technical level of the user, does not need the user to additionally process the image, saves the time of the user, can feed back the processed image in real time and is convenient for the user to check.
The application also provides a non-volatile computer storage medium, wherein the computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the data real-time processing method of the image acquisition equipment in any method embodiment.
Fig. 7 is a schematic structural diagram of a computing device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the computing device.
As shown in fig. 7, the computing device may include: a processor (processor)702, a Communications Interface 704, a memory 706, and a communication bus 708.
Wherein:
the processor 702, communication interface 704, and memory 706 communicate with each other via a communication bus 708.
A communication interface 704 for communicating with network elements of other devices, such as clients or other servers.
The processor 702 is configured to execute the program 710, and may specifically execute relevant steps in the above-described embodiment of the data real-time processing method for the image capturing device.
In particular, the program 710 may include program code that includes computer operating instructions.
The processor 702 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the present invention. The computing device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
The memory 706 stores a program 710. The memory 706 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 710 may be specifically configured to cause the processor 702 to perform the methods in the embodiments illustrated in fig. 1 and 2.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the in-image object transform processing apparatus according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (18)

1. A method of in-image object transform processing, comprising:
acquiring a first image to be processed, which contains a source object;
acquiring a second image containing a target object;
extracting first key information of the source object from the first image and extracting second key information of the target object from the second image;
establishing a coordinate system, respectively performing fitting processing in the coordinate system according to the first key information and the second key information, connecting a series of first key information on a plane by using a smooth curve, and connecting a series of second key information on the plane by using a smooth curve to obtain a key curve of a source object and a key curve of a target object;
calculating an amplitude adjustment curve according to the key curve of the source object and the key curve of the target object;
adjusting the first image according to the amplitude adjustment curve to obtain a third image;
wherein, the establishing a coordinate system, respectively performing fitting processing in the coordinate system according to the first key information and the second key information, connecting a series of first key information on a plane with a smooth curve, and connecting a series of second key information on the plane with a smooth curve, to obtain a key curve of the source object and a key curve of the target object, includes:
establishing a polar coordinate system, extracting the position information of the central point of the source object from the first image, mapping the central point of the source object as the pole of the polar coordinate system, extracting the position information of the central point of the target object from the second image, and mapping the central point of the target object as the pole of the polar coordinate system;
the calculating an amplitude adjustment curve according to the key curve of the source object and the key curve of the target object includes:
and calculating an adjustment coefficient corresponding to the polar angle according to the polar diameter of any point on the key curve of the source object and the polar diameter of a point on the key curve of the target object with the same polar angle as the point, so as to obtain an amplitude adjustment curve related to the relation between the polar angle and the adjustment coefficient.
2. The method of claim 1, wherein the first key information comprises location information of at least one first key point and the second key information comprises location information of at least one second key point.
3. The method of claim 2, wherein the establishing a coordinate system further comprises: establishing a polar coordinate system;
the fitting process in the coordinate system according to the first key information and the second key information respectively, connecting a series of first key information on the plane with a smooth curve, and connecting a series of second key information on the plane with a smooth curve, and obtaining the key curve of the source object and the key curve of the target object further comprises:
extracting position information of a central point of the source object from a first image, mapping the central point of the source object as a pole of a polar coordinate system, mapping the at least one first key point into the polar coordinate system according to the relative position between the at least one first key point and the central point of the source object, and fitting in the polar coordinate system according to the mapping result of the at least one first key point to obtain a key curve of the source object;
extracting position information of a central point of the target object from a second image, mapping the central point of the target object as a pole of a polar coordinate system, mapping the at least one second key point to the polar coordinate system according to the relative position between the at least one second key point and the central point of the target object, and fitting in the polar coordinate system according to the mapping result of the at least one second key point to obtain a key curve of the target object.
4. The method of claim 3, wherein prior to establishing a polar coordinate system, the method further comprises:
correcting the position information of the at least one first key point according to the position information of the central point of the source object; and correcting the position information of the at least one second key point according to the position information of the central point of the target object.
5. The method of claim 4, wherein the method further comprises: and displaying the third image.
6. The method of claim 5, wherein said obtaining a first image containing a source object to be processed further comprises:
a first image containing a source object captured by an image acquisition device is acquired in real-time.
7. The method of claim 6, wherein the method further comprises:
and saving the third image according to a shooting instruction triggered by a user.
8. The method of claim 7, wherein the method further comprises:
and saving the video formed by the third image as a frame image according to a recording instruction triggered by a user.
9. An in-image object transform processing device, comprising:
the device comprises a first acquisition module, a second acquisition module and a processing module, wherein the first acquisition module is suitable for acquiring a first image containing a source object to be processed;
a second acquisition module adapted to acquire a second image containing the target object;
the extraction module is suitable for extracting first key information of the source object from the first image and extracting second key information of the target object from the second image;
the coordinate system establishing module is suitable for establishing a coordinate system;
the coordinate system establishing module is also suitable for establishing a polar coordinate system;
the fitting processing module is suitable for respectively performing fitting processing in the coordinate system according to the first key information and the second key information, connecting a series of first key information on the plane by using a smooth curve, and connecting a series of second key information on the plane by using a smooth curve to obtain a key curve of the source object and a key curve of the target object;
the fitting processing module is also suitable for extracting the position information of the central point of the source object in the first image, mapping the central point of the source object as the pole of a polar coordinate system, extracting the position information of the central point of the target object in the second image, and mapping the central point of the target object as the pole of the polar coordinate system;
the calculation module is suitable for calculating an amplitude adjustment curve according to the key curve of the source object and the key curve of the target object;
the calculation module is also suitable for calculating an adjustment coefficient corresponding to the polar angle according to the polar diameter of any point on the key curve of the source object and the polar diameter of a point on the key curve of the target object with the same polar angle as the point, so as to obtain an amplitude adjustment curve related to the relation between the polar angle and the adjustment coefficient;
and the adjusting module is suitable for adjusting the first image according to the amplitude adjusting curve to obtain a third image.
10. The apparatus of claim 9, wherein the first key information comprises location information of at least one first key point and the second key information comprises location information of at least one second key point.
11. The apparatus of claim 10, wherein the coordinate system establishment module is further adapted to: establishing a polar coordinate system;
the fitting processing module is further adapted to: extracting position information of a central point of the source object from a first image, mapping the central point of the source object as a pole of a polar coordinate system, mapping the at least one first key point into the polar coordinate system according to the relative position between the at least one first key point and the central point of the source object, and fitting in the polar coordinate system according to the mapping result of the at least one first key point to obtain a key curve of the source object;
extracting position information of a central point of the target object from a second image, mapping the central point of the target object as a pole of a polar coordinate system, mapping the at least one second key point to the polar coordinate system according to the relative position between the at least one second key point and the central point of the target object, and fitting in the polar coordinate system according to the mapping result of the at least one second key point to obtain a key curve of the target object.
12. The apparatus of claim 11, wherein the apparatus further comprises: the correction processing module is suitable for correcting the position information of the at least one first key point according to the position information of the central point of the source object; and correcting the position information of the at least one second key point according to the position information of the central point of the target object.
13. The apparatus of claim 12, wherein the apparatus further comprises: and the display module is suitable for displaying the third image.
14. The apparatus of claim 13, wherein the first obtaining module is further adapted to: a first image containing a source object captured by an image acquisition device is acquired in real-time.
15. The apparatus of claim 14, wherein the apparatus further comprises:
and the first storage module is suitable for storing the third image according to a shooting instruction triggered by a user.
16. The apparatus of claim 15, wherein the apparatus further comprises:
and the second storage module is suitable for storing the video formed by the third image as the frame image according to the recording instruction triggered by the user.
17. A computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the object transformation processing method in the image according to any one of claims 1-8.
18. A computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to perform operations corresponding to the method for processing object transformation in an image according to any one of claims 1 to 8.
CN201710896416.XA 2017-09-28 2017-09-28 Method and device for processing object transformation in image and computing equipment Active CN107767326B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710896416.XA CN107767326B (en) 2017-09-28 2017-09-28 Method and device for processing object transformation in image and computing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710896416.XA CN107767326B (en) 2017-09-28 2017-09-28 Method and device for processing object transformation in image and computing equipment

Publications (2)

Publication Number Publication Date
CN107767326A CN107767326A (en) 2018-03-06
CN107767326B true CN107767326B (en) 2021-11-02

Family

ID=61266264

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710896416.XA Active CN107767326B (en) 2017-09-28 2017-09-28 Method and device for processing object transformation in image and computing equipment

Country Status (1)

Country Link
CN (1) CN107767326B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109544623B (en) * 2018-10-11 2021-07-27 百度在线网络技术(北京)有限公司 Method and device for measuring damaged area of vehicle
CN110119722B (en) * 2019-05-17 2020-07-24 北京字节跳动网络技术有限公司 Method and apparatus for generating information
CN110263772A (en) * 2019-07-30 2019-09-20 天津艾思科尔科技有限公司 A kind of face characteristic identifying system based on face key point

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7308135B2 (en) * 2004-01-14 2007-12-11 Eastman Kodak Company Constructing extended color gamut digital images from limited color gamut digital images
JP5075182B2 (en) * 2009-10-20 2012-11-14 楽天株式会社 Image processing apparatus, image processing method, and image processing program
CN101853523B (en) * 2010-05-18 2012-01-04 南京大学 Method for adopting rough drawings to establish three-dimensional human face molds
CN105139438B (en) * 2014-09-19 2018-01-12 电子科技大学 video human face cartoon generation method
JP6619638B2 (en) * 2015-12-09 2019-12-11 Eizo株式会社 Image processing apparatus and program
CN106651775B (en) * 2016-12-16 2020-01-14 西安汇明光电技术有限公司 Optimization method of logarithmic polar coordinate transformation based on digital image processing

Also Published As

Publication number Publication date
CN107767326A (en) 2018-03-06

Similar Documents

Publication Publication Date Title
CN108198141B (en) Image processing method and device for realizing face thinning special effect and computing equipment
CN107301620B (en) Method for panoramic imaging based on camera array
JP6411505B2 (en) Method and apparatus for generating an omnifocal image
WO2016155377A1 (en) Picture display method and device
CN107734207B (en) Video object transformation processing method and device and computing equipment
CN107277615B (en) Live broadcast stylization processing method and device, computing device and storage medium
CN104898832B (en) Intelligent terminal-based 3D real-time glasses try-on method
CN107767326B (en) Method and device for processing object transformation in image and computing equipment
WO2017067262A1 (en) Image processing method and apparatus
JP2006012172A (en) Method and apparatus for converting picture to caricature image
WO2017054442A1 (en) Image information recognition processing method and device, and computer storage medium
US10482571B2 (en) Dual fisheye, hemispherical image projection and stitching method, device and computer-readable medium
CN108111911B (en) Video data real-time processing method and device based on self-adaptive tracking frame segmentation
CN107959798B (en) Video data real-time processing method and device and computing equipment
CN111008935A (en) Face image enhancement method, device, system and storage medium
CN109117753A (en) Position recognition methods, device, terminal and storage medium
WO2023066120A1 (en) Image processing method and apparatus, electronic device, and storage medium
WO2017173578A1 (en) Image enhancement method and device
US20160110909A1 (en) Method and apparatus for creating texture map and method of creating database
CN107492068B (en) Video object transformation real-time processing method and device and computing equipment
CN111836058A (en) Method, device and equipment for real-time video playing and storage medium
WO2020181510A1 (en) Image data processing method, apparatus, and system
CN116452745A (en) Hand modeling, hand model processing method, device and medium
CN108010038B (en) Live-broadcast dress decorating method and device based on self-adaptive threshold segmentation
CN107945202B (en) Image segmentation method and device based on adaptive threshold value and computing equipment

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
GR01 Patent grant
GR01 Patent grant