CN110852932B - Image processing method and device, image equipment and storage medium - Google Patents

Image processing method and device, image equipment and storage medium Download PDF

Info

Publication number
CN110852932B
CN110852932B CN201810954773.1A CN201810954773A CN110852932B CN 110852932 B CN110852932 B CN 110852932B CN 201810954773 A CN201810954773 A CN 201810954773A CN 110852932 B CN110852932 B CN 110852932B
Authority
CN
China
Prior art keywords
deformation
proportion
local
mode
equal
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
CN201810954773.1A
Other languages
Chinese (zh)
Other versions
CN110852932A (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 Sensetime Technology Development Co Ltd
Original Assignee
Beijing Sensetime Technology Development 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 Sensetime Technology Development Co Ltd filed Critical Beijing Sensetime Technology Development Co Ltd
Priority to CN201810954773.1A priority Critical patent/CN110852932B/en
Publication of CN110852932A publication Critical patent/CN110852932A/en
Application granted granted Critical
Publication of CN110852932B publication Critical patent/CN110852932B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4007Scaling of whole images or parts thereof, e.g. expanding or contracting based on interpolation, e.g. bilinear interpolation

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the application provides an image processing method and device, image equipment and storage medium. The method comprises the following steps: and carrying out deformation processing on a first part of the target object in the image in a second direction according to the deformation proportion of the first part in the first direction, wherein the second direction is perpendicular to the first direction.

Description

Image processing method and device, image equipment and storage medium
Technical Field
The present disclosure relates to the field of information technologies, and in particular, to an image processing method and apparatus, an image device, and a storage medium.
Background
The image morphing process may be applied during an image beautifying or dramatic process. For example, in the process of beautifying an image, a slimming process is performed on a portrait in the image.
In the related art, if the whole image or one or more parts of the image are deformed, unnecessary deformation is generated in the corresponding parts, so that the deformed image has poor quality and low user satisfaction.
Disclosure of Invention
In view of this, embodiments of the present application desire to provide an image processing method and apparatus, an image device, and a storage medium.
The technical scheme of the application is realized as follows:
an image processing method, comprising:
and carrying out deformation processing on a first part of the target object in the image in a second direction according to the deformation proportion of the first part in the first direction, wherein the second direction is perpendicular to the first direction.
Based on the above scheme, the center point of the first local deformed grid in the first direction is: a first center point;
the processing of the deformation of the first local in the second direction according to the deformation proportion of the first local of the target object in the image includes:
the coordinates of the first local deformed mesh are moved in the second direction such that a second center point of the first local deformed mesh in the second direction coincides with the first center point.
Based on the scheme, the deformation interpolation algorithm for generating the deformation is as follows: presetting a deformation interpolation algorithm;
the processing of the deformation of the first local in the second direction according to the deformation proportion of the first local of the target object in the image includes:
and performing pixel coordinate mapping in the second direction by using the preset deformation interpolation algorithm and the first local deformation grid.
Based on the above scheme, the preset deformation interpolation algorithm comprises at least one of the following:
a Bezier curve interpolation algorithm;
spline curve interpolation algorithm.
Based on the above scheme, the target object further includes: a second part different from the first part;
the method further comprises the steps of:
and carrying out overall deformation processing on the target object in the first direction, so that the first local part generates the deformation in the first direction.
Based on the above-mentioned scheme, the performing, according to the deformation ratio of the first part of the target object in the image in the first direction, the deformation processing on the first part in the second direction includes:
and if the deformation application is in the equal-proportion deformation mode, carrying out deformation processing on the first local part in the second direction according to the deformation proportion.
Based on the above scheme, the method further comprises:
if the deformation application is in a non-equal proportion deformation mode, outputting prompt information when the abnormal size proportion of the first part in the first direction and the second direction is detected; the prompt message is used for prompting the equal proportion deformation of the first part.
Based on the above scheme, the prompt information includes: the first prompt message and/or the second prompt message; the first prompting information is used for prompting whether the deformation application is switched to the equal-proportion deformation mode or not; the second prompting information is used for prompting the first local equal-proportion deformation in the unequal-proportion deformation mode.
Based on the above scheme, the method further comprises:
detecting a deformation mode indication operation;
determining whether the deformation application is in the equal-proportion deformation mode or the unequal-proportion deformation mode according to the indication operation;
if the deformation application is in the unequal ratio deformation mode, outputting prompt information when detecting that the size proportion of the first part in the first direction and the second direction is abnormal, wherein the prompt information comprises:
outputting the second prompt information when the unequal ratio deformation mode entering after the indication operation is detected and the proportion abnormality of the first local part in the first direction and the second direction is detected; otherwise, outputting the first prompt message.
Based on the above scheme, the method further comprises:
and if the indication operation indicating the deformation mode is not detected, the deformation application enters the unequal ratio deformation mode.
Based on the scheme, the target object is a portrait;
the first part is a head.
An image processing apparatus comprising:
and the first deformation module is used for carrying out deformation processing on the first local part of the target object in the image in a second direction according to the deformation proportion of the first local part in the first direction, wherein the second direction is perpendicular to the first direction.
Based on the above scheme, the center point of the first local deformed grid in the first direction is: a first center point;
the first deforming module is specifically configured to move coordinates of the first local deformed grid in the second direction, so that a second center point of the first local deformed grid in the second direction coincides with the first center point.
Based on the scheme, the deformation interpolation algorithm for generating the deformation is as follows: presetting a deformation interpolation algorithm;
the first deformation module is specifically configured to map pixel coordinates in the second direction by using the preset deformation interpolation algorithm and the first local deformation grid.
Based on the above scheme, the preset deformation interpolation algorithm comprises at least one of the following:
a Bezier curve interpolation algorithm;
spline curve interpolation algorithm.
Based on the above scheme, the target object further includes: a second part different from the first part;
the apparatus further comprises:
and the second deformation module is used for carrying out overall deformation processing on the target object in the first direction so that the first local part generates the deformation in the first direction.
Based on the above scheme, the second deforming module is specifically configured to perform the deforming process of the first local portion in the second direction according to the deformation ratio if the deforming application is in an equal-ratio deforming mode.
Based on the above scheme, the device further comprises:
the prompting module is used for outputting prompting information when the deformation application is in a non-equal proportion deformation mode and the abnormal dimension proportion of the first part in the first direction and the second direction is detected; the prompt message is used for prompting the equal proportion deformation of the first part.
Based on the above scheme, the prompt information includes: the first prompt message and/or the second prompt message; the first prompting information is used for prompting whether the deformation application is switched to the equal-proportion deformation mode or not; the second prompting information is used for prompting the first local equal-proportion deformation in the unequal-proportion deformation mode.
Based on the above scheme, the device further comprises:
the first detection module is used for detecting deformation mode indication operation;
the mode selection module is used for determining whether the deformation application is in the equal-proportion deformation mode or the unequal-proportion deformation mode according to the indication operation;
the prompting module is specifically configured to output the second prompting information if the unequal ratio deformation mode entered after the indication operation is detected detects that the ratio of the first local portion in the first direction and the second direction is abnormal; otherwise, outputting the first prompt message.
Based on the above scheme, the device further comprises:
and the mode selection module is used for enabling the deformation application to enter the unequal-ratio deformation mode if the indication operation for indicating the deformation mode is not detected.
Based on the scheme, the target object is a portrait;
the first part is a head.
A computer storage medium having computer executable code stored thereon; the computer executable code, when executed, is capable of implementing the method provided by any embodiment of the first aspect.
A computer program product comprising computer-executable instructions; the computer-executable instructions, when executed, enable the method provided by any embodiment of the first aspect.
An image apparatus, characterized by comprising:
a memory for storing information;
and a processor, coupled to the memory, for implementing the method provided by any embodiment of the first aspect by executing computer-executable instructions stored on the memory.
According to the image processing method and device, the image equipment and the storage medium, after the first part of the target object in the image is deformed in the first direction, the deformation of the first part is performed on the second direction line according to the deformation proportion of the deformation, so that the equal-proportion deformation of the first part in the two vertical directions can be automatically realized. And the equal-proportion deformation can reduce unnecessary deformation introduced by deformation processing in a single direction, and after the deformation processing in a second direction, images with better image quality can be output, so that the satisfaction degree of users is improved.
Drawings
Fig. 1 is a flowchart of a first image processing method according to an embodiment of the present invention;
fig. 2 is a flowchart of a second image processing method according to an embodiment of the present invention;
FIG. 3 is a schematic view of a deformed mesh covered provided by an embodiment of the present invention;
FIG. 4 is a schematic diagram of image distortion according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of another image device according to an embodiment of the present invention.
Detailed Description
The technical scheme of the application is further elaborated below with reference to the drawings in the specification and the specific embodiments.
As shown in fig. 1, the present embodiment provides an image processing method, including:
step S110: according to the deformation proportion of a first part of a target object in an image in a first direction, carrying out deformation processing on the first part in a second direction; wherein the second direction is perpendicular to the first direction.
The image processing method provided in the present embodiment may be a method applied to an image apparatus. The image device may be various types of electronic devices; such as a stationary device or a mobile device. The fixture may include: desktop computers or servers, etc. The mobile device may include: an in-vehicle apparatus, a person-vehicle apparatus, a robot, or the like. The manned device may include: a cell phone, a tablet computer, or a wearable device, etc.
The image may be: an image to be processed; for example, an original image acquired by a camera; or images to be deformed received from other electronic devices.
The target object may be an image of various acquisition objects; the acquisition object may include: humans, animals, scenery, or vehicles, among others.
For illustration, the target object may be a portrait. The first portion may be an image of a portion of a person in the image. For example, the figures may include: imaging of several parts of the head, neck, shoulders, chest, waist, abdomen, crotch, legs, hands, etc.; the first part may include: the head forms the head portrait. The target object may further include, in addition to the first part: a second part; the second portion includes imaging of all parts other than the head, for example, the person's image other than the head portrait.
In other embodiments, the first portion may include: imaging of the head and neck, the second portion may include: other parts of the head and neck are imaged.
In other embodiments, the target object may also be a person (i.e., a portion other than the head); the first part of the person may include: neck and/or extremities (hands and legs); the second part may include: shoulder, chest, waist, abdomen, crotch, etc.
In some embodiments, the first portion includes a plurality of portions; the second part may also comprise a plurality of parts. For example, the first part may comprise a head and a neck; the second part may comprise a part other than the head and neck.
In some embodiments, for adjusting the size and/or shape of the first part of the target object in the image, the user may only operate the deformation in one direction during the deformation, and if the deformation of the first part is finished, the subsequent presentation of the first part in the image may be abnormal, which is not intended by the user. In this embodiment, the image device automatically performs the deformation of the first portion in the second direction according to the deformation ratio of the first deformation in the first direction. Here, the second direction is perpendicular to the first direction. For example, in a two-dimensional planar coordinate system, if the first direction is the x-axis direction, the second direction may be the y-axis direction, and if the second direction is the y-axis direction, the first direction may be the x-axis direction.
The face shown in fig. 3 is provided with a deformed mesh in which deformed control points are provided. As can be seen from fig. 3, the grid points of the deformed grid can be moved in the lateral direction and the longitudinal direction, and the change of the pixels in the grid where the control points are located to the coordinate can be controlled by the movement of the control points, so that the deformation processing of the corresponding part of the image is realized.
The deformation ratio in the present embodiment may include: the dimensional ratio before and after deformation.
For example, before deformation, the first part occupies S1 pixels in the first direction; after the deformation, the first local occupies S2 pixels in the first direction, and the deformation ratio may be: S2/S1; in step S110, the first part is adjusted in equal proportion to the S2/S1 in the second direction, so that the deformation of the S2/S1 of the first part in the second direction is also achieved.
Of course, the above is merely an example description of the deformation ratio, and the specific implementation is not limited to the above example.
In some embodiments, the deformation ratio may further include: the morphological amplitude ratio before and after deformation; the morphology determines the shape of the first part present in the image, without necessarily being related to the size of the first part in the image.
The deformation grid may be utilized in this embodiment to assist in the deformation process of the first part. The grid points in the deformed grid are control points of deformation processing, and the coordinate change of the control points directly determines the conversion of pixel coordinates of pixels in the grid where the frame control points are located.
In some embodiments, the deformation may be: the first local deformation may be generated by a global deformation of the target object. In short, the deformation can be produced in various ways, and is not limited to any of the above.
The deforming process performed on the first portion in the second direction may be a partial deforming process based on a deformation ratio of the deformation.
If the step S110 is: and carrying out deformation equal to the deformation proportion on the first part in the second direction, so that the equal proportion deformation of the first part in two mutually perpendicular directions is realized. If the first part is deformed in equal proportion, the dimensions of the first part in two vertical directions are scaled in equal proportion after deformation; in this way, a first partial scaling of the size of the partial occupation can be achieved directly, by means of which scaling the size of the partial occupation in both directions can be achieved. For example, in a group photo including a plurality of persons, one user perceives that his head is larger or smaller, and may need to zoom his head, and with the method provided in this embodiment, the zooming of the head may be achieved without changing the five-sense ratio thereof.
As shown in fig. 4, the left-most original image in fig. 4 is subjected to a slimming process, which results in a head portion as shown in the middle of fig. 4 being formed by a shrinking process in the lateral direction as a first part, and at this time, the head portion has an elongation effect. The rightmost head of fig. 4 is scaled by a vertical process.
The center point of the first local deformed grid in the first direction is: a first center point; the processing of the deformation of the first local in the second direction according to the deformation proportion of the first local of the target object in the image includes: the coordinates of the first local deformed mesh are moved in the second direction such that a second center point of the first local deformed mesh in the second direction coincides with the first center point.
The first center point may be a center coordinate in a first direction of the first area partially covered by the deformed mesh. The second center point may be a center coordinate of the first region partially covered by the deformed mesh in the second direction. The coordinates of the center point in the first direction and in the second direction overlap before the first part does not participate in the deformation, and the coordinates of the first center point in the first direction move in the first direction after the deformation of the first part.
The deformation interpolation algorithm for generating the deformation is as follows: presetting a deformation interpolation algorithm;
the step S110 may include: and performing pixel coordinate mapping in the second direction by using the preset deformation interpolation algorithm and the first local deformation grid.
The grid points of the warped grid are subjected to pixel coordinate mapping, and pixels associated with the grid points are also required to be subjected to pixel coordinate mapping, but the association relationship between the coordinate mapping of different pixels and the coordinate mapping of the grid points is determined by the warped interpolation algorithm. Thus, smoothness between pixels of the target pixel coordinates after each pixel is mapped can be achieved by the morphing interpolation algorithm.
In this embodiment, the deformation of the first part in the first direction and the second direction may not only adopt the same deformation proportion, but also adopt the same deformation interpolation algorithm (i.e. the preset deformation interpolation algorithm), so that the internal structure of the deformed first part may maintain the original proportional relationship and/or morphology through the deformation processing in the second direction after the deformation, so as to reduce the undesired image effect caused by the deformation, thereby improving the effect of image deformation and user satisfaction.
The preset deformation interpolation algorithm comprises at least one of the following: a Bezier curve interpolation algorithm; spline curve interpolation algorithm.
If the target object is a portrait, the first part is a head, and the spline interpolation algorithm can be selected.
The target object further comprises: a second part different from the first part;
the method as shown in fig. 2 further comprises:
step S100: and carrying out overall deformation processing on the target object in the first direction so that the first local part deforms in the first direction.
In some embodiments, the deformation is introduced when the target object is subjected to a global deformation process in a first direction. For example, the first part is a head, and the first part is a part other than the head. For example, a figure in an image is subjected to slimming treatment, and in the process of the slimming treatment, the figure in the image is thinned, and at the same time, the head is thinned. This brain bag thinning is the deformation. However, after the brain bag becomes thin, the effect of lengthening the head is visually exhibited, and the obtained portrait is not beautiful in practice. In this embodiment, in order to avoid the unsightly appearance caused by such deformation, if the deformation is generated in the first direction, the deformation is automatically performed in the second direction in an equal proportion, so that the problems of poor image quality and low user satisfaction caused by the lengthening of the brain bag are reduced; in this embodiment, the deformation is performed in the second direction simultaneously.
Notably, are: in some embodiments, the step S1000 and the step S110 may be performed synchronously, or may be performed sequentially, for example, according to the method shown in fig. 2, step S100 is performed first, and then step S110 is performed. In other embodiments, the steps S100 and S110 may be performed synchronously, for example, the first deformation network is used to perform the deformation processing in the first direction, the second deformation network is used to perform the deformation processing in the second direction, the third deformation network is obtained by finally merging the deformed first deformation network and second deformation network, and the mapping of the pixel coordinates and the determination of the pixel values of the image are performed based on the third deformation network, so that the image processing efficiency is improved by parallel processing, and the mapping of the pixel coordinates and the determination of the pixel values are performed only once, so that the unnecessary calculation amount may be reduced; the processing load amount of the image device is reduced.
In some embodiments, the step S110 may include:
and if the deformation application is in an equal-proportion deformation mode, after the first local part is deformed in the first direction, carrying out deformation processing on the first local part in the second direction according to the deformation proportion of the deformation.
In this embodiment, the morphing application may be an image processing application running in an electronic device, and the image processing application may be: dedicated applications for performing image deformation processing, for example, various kinds of image-forming applications.
If the morphing application is in the equal proportion morphing mode, the image device automatically performs equal proportion morphing in the vertical direction by running the morphing application.
In some embodiments, it may be convenient for a user to manipulate the deformation in one direction while performing the image deformation; if the deformation is needed in equal proportion, the user needs to manually control the deformation in the other direction; obviously difficult to control. If the deformation application is in the equal-proportion deformation mode, the image equipment automatically executes equal-proportion deformation in the other direction, so that the user operation is simplified, and the image quality is improved.
In some embodiments, the method further comprises: if the deformation application is in a non-equal proportion deformation mode, outputting prompt information when the abnormal size proportion of the first part in the first direction and the second direction is detected; the prompt message is used for prompting the equal proportion deformation of the first part.
The prompt information may be: and outputting information which can prompt the first part to deform in equal proportion.
For example, the prompt information includes: the first prompt message and/or the second prompt message; the first prompting information is used for prompting whether the deformation application is switched to the equal-proportion deformation mode or not; the second prompting information is used for prompting the first local equal-proportion deformation in the unequal-proportion deformation mode.
In some embodiments, the morphing application may also be in a non-equal proportion morphing mode. I.e. in this mode the image device does not automatically deform in equal proportion. In the unequal ratio deformation mode, if a deformation instruction in the first direction is detected, performing deformation in the first direction; if deformation in the second direction is detected, deformation in the second direction is performed, and deformation in the direction in which no deformation instruction is detected is not performed.
In this embodiment, if the image device or the deformation application detects that the first part deforms in a certain direction, the first part generates abnormal dimensional proportions in two directions, and if such an image is directly output, the image device or the deformation application may not be wanted by the user or the user may not notice the image. In order to improve user experience, in this embodiment, such an image with a proportion abnormality is avoided being directly output, and in this embodiment, a prompt message is also output, where the prompt message may be: any information prompting the user whether the equal proportion deformation is needed.
The hint information may include: the first prompt information can be used for prompting the switching to the equal-proportion deformation mode, and if a switching instruction for switching to the equal-proportion deformation mode is detected, the deformation processing in the second direction is automatically performed after the switching to the equal-proportion deformation mode, so that the first part can be restored to or enter into the normal proportion range after the deformation processing in the second direction.
In some embodiments, the hint information may include: and second prompt information. The second prompt information may be: in the case of maintaining the deformation application in the unequal ratio deformation mode, the first portion of the abnormality is equal ratio deformed such that the dimensional ratio of the first portion in the first direction and the second direction is restored or switched to be within the normal ratio range. For example, a confirmation indication of the user acting on the second prompt is detected.
The first prompt information and/or the second prompt information can be in the form of a dialog box, and if the operation acting on the dialog box is detected, whether to confirm the indication or not is determined according to the space or the key operated by the operation.
For the first prompt message, if the first prompt message is a negative indication, the user is indicated to want the deformation application to be maintained in the unequal ratio deformation mode; if the user confirms the indication, the user wants to deform the application to enter the equal-proportion deformation mode. Thus, the image device or the morphing application can execute the corresponding operation according to the detected operation.
For the second prompt, if the indication is a negative indication, the user wants the deformation application to be maintained in the non-proportional deformation; if the user confirms the instruction, the user wants to deform the application to perform the equal-proportion deformation of the first local. If the second prompt information is output, a confirmation instruction of the user acting on the second prompt information is detected, after the first partial equal proportion deformation is executed, the deformation application or the image equipment can continuously detect whether the proportion is seriously disordered due to the deformation in the deformation process because the deformation state is maintained in the unequal proportion deformation state, and the proportion of the seriously disordered is one of the proportion abnormity. Then, the abnormal proportion is detected again, and prompt information and the like are output again.
In some embodiments, the method further comprises: and if the indication operation indicating the deformation mode is not detected, the deformation application enters the unequal ratio deformation mode.
In some cases, the unequal ratio deformation mode may be a default deformation mode, and if an indication operation specifically indicating the equal ratio deformation mode is detected, the deformation application defaults to be in the unequal ratio deformation mode.
In some embodiments, the method further comprises:
detecting a deformation mode indication operation;
determining whether the deformation application is in the equal-proportion deformation mode or the unequal-proportion deformation mode according to the indication operation;
if the deformation application is in the unequal ratio deformation mode, outputting prompt information when detecting that the size proportion of the first part in the first direction and the second direction is abnormal, wherein the prompt information comprises:
outputting the second prompt information when the unequal ratio deformation mode entering after the indication operation is detected and the proportion abnormality of the first local part in the first direction and the second direction is detected; otherwise, outputting the first prompt message.
If the deformation application is in the unequal ratio deformation mode, the method is entered based on the indication operation. If the user needs to be prompted again to switch to the equal-proportion deformation mode, if the first prompting information is repeatedly output, possibly the user is interfered by deformation processing, so in the embodiment, if the user enters the equal-proportion deformation mode based on the instruction operation input by the user, the second prompting information is output when the proportion abnormality is detected; otherwise, outputting the first prompt message.
As shown in fig. 5, the present embodiment provides an image processing apparatus including:
the first deforming module 110 is configured to perform a deforming process on a first local part of a target object in an image in a second direction according to a deformation ratio of the first local part in the first direction, where the second direction is perpendicular to the first direction.
In some embodiments, the first deforming module 110 may be a program module, which, when executed by a processor, is capable of performing a first local deforming process in a second direction according to a deformation ratio in the first direction; can be used to achieve an equal proportional deformation of the first part in the vertical direction.
In other embodiments, the first morph module 110 may correspond to a field programmable device or a complex programmable device.
In some embodiments, the center point of the first partial deformed mesh in the first direction is: a first center point; the first deforming module 110 is specifically configured to move the coordinates of the first local deformed grid in the second direction, so that a second center point of the first local deformed grid in the second direction coincides with the first center point.
In some embodiments, the deformation interpolation algorithm that produces the deformation is: presetting a deformation interpolation algorithm;
the first deformation module 110 is specifically configured to map pixel coordinates in the second direction by using the preset deformation interpolation algorithm and the first local deformation grid.
In other embodiments, the preset deformation interpolation algorithm includes at least one of: a Bezier curve interpolation algorithm; spline curve interpolation algorithm.
In still other embodiments, the target object further comprises: a second part different from the first part; the apparatus further comprises: and a second deforming module 100, configured to perform overall deformation processing on the target object in the first direction, so that the first local area generates the deformation in the first direction.
Here, the second morphing module 100 may be a program module, a hardware module, or a combination module of hardware and software that generates the first directional morphing.
In some embodiments, the second deforming module 100 is specifically configured to, if the deforming application is in an equal-proportion deforming mode, perform the deforming process of the first local portion in the second direction according to the deforming proportion of the deforming after the first local portion deforms in the first direction.
In some embodiments, the apparatus further comprises:
the prompting module is used for outputting prompting information when the deformation application is in a non-equal proportion deformation mode and the abnormal dimension proportion of the first part in the first direction and the second direction is detected; the prompt message is used for prompting the equal proportion deformation of the first part.
In some embodiments, the hint information includes: the first prompt message and/or the second prompt message; the first prompting information is used for prompting whether the deformation application is switched to the equal-proportion deformation mode or not; the second prompting information is used for prompting the first local equal-proportion deformation in the unequal-proportion deformation mode.
In other embodiments, the apparatus further comprises:
the first detection module is used for detecting deformation mode indication operation;
the mode selection module is used for determining whether the deformation application is in the equal-proportion deformation mode or the unequal-proportion deformation mode according to the indication operation;
the prompting module is specifically configured to output the second prompting information if the unequal ratio deformation mode entered after the indication operation is detected detects that the ratio of the first local portion in the first direction and the second direction is abnormal; otherwise, outputting the first prompt message.
In still other embodiments, the apparatus further comprises:
and the mode selection module is used for enabling the deformation application to enter the unequal-ratio deformation mode if the indication operation for indicating the deformation mode is not detected.
In this embodiment, the mode selection module may be used for selection of a non-equal-proportion deformation mode and selection of an equal-proportion deformation mode.
In some embodiments, the target object is a portrait; the first part is a head.
As shown in fig. 6, the present embodiment provides an image apparatus including:
a memory;
and a processor, coupled to the memory, for implementing the image processing method provided in one or more of the foregoing embodiments, for example, one or more of the image processing methods shown in fig. 1 and 2, by executing computer-executable instructions located on the memory.
The memory may be various types of memory, such as random access memory, read only memory, flash memory, etc. The memory may be used for information storage, for example, storing computer-executable instructions, etc. The computer-executable instructions may be various program instructions, such as target program instructions and/or source program instructions, etc.
The processor may be various types of processors such as a central processing unit, a microprocessor, a digital signal processor, a programmable array, a digital signal processor, an application specific integrated circuit, or an image processor, among others.
The processor may be connected to the memory via a bus. The bus may be an integrated circuit bus or the like.
In some embodiments, the image device may further include: a communication interface, the communication interface may include: network interfaces, e.g., local area network interfaces, transceiver antennas, etc. The communication interface is also connected with the processor and can be used for information receiving and transmitting.
In some embodiments, the image device further includes a human-machine interaction interface, which may include various input-output devices, such as a keyboard, touch screen, and the like, for example.
In some embodiments, the image device may further include: the image acquisition module may include various cameras capable of acquiring images, such as Red Green Blue (RGB) cameras that may be used to acquire RGB information, or depth cameras that may be used to acquire depth information, etc. The image acquisition module can be connected with the processor through a bus interface.
The present embodiment provides a computer storage medium storing computer-executable instructions; the computer-executable instructions, when executed, enable one or more of the image processing methods provided in one or more of the embodiments described above, such as one or more of the image processing methods shown in fig. 1 and 2.
The computer storage medium may be various storage media including a recording medium having a recording function, such as a CD, a floppy disk, a hard disk, a magnetic tape, an optical disk, a U-disk, or a removable hard disk. The computer storage medium may be a non-transitory storage medium, and the computer storage medium may be readable by a processor, so that after the computer executable instructions stored on the computer storage mechanism are acquired and executed by the processor, the information processing method provided in any one of the foregoing technical solutions can be implemented, for example, the information processing method applied to the terminal device or the information processing method applied to the application server is executed.
The present embodiments also provide a computer program product comprising computer-executable instructions; the computer-executable instructions, when executed, enable one or more of the image processing methods provided in one or more of the embodiments described above, such as one or more of the image processing methods shown in fig. 1 and 2.
The computer program is tangibly embodied on a computer storage medium, and the computer program includes program code for performing the method shown in the flowchart, and the program code may include instructions corresponding to the steps of the method provided in the embodiments of the present application.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above described device embodiments are only illustrative, e.g. the division of the units is only one logical function division, and there may be other divisions in practice, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing module, or each unit may be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware associated with program instructions, where the foregoing program may be stored in a computer readable storage medium, and when executed, the program performs steps including the above method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk or an optical disk, or the like, which can store program codes.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (16)

1. An image processing method, comprising:
carrying out overall deformation processing on a target object in an image in a first direction, so that a first local part is deformed in the first direction; wherein the target object includes the first part and a second part different from the first part;
carrying out deformation processing on the first local in a second direction according to the deformation proportion of the first local in the first direction, wherein the second direction is perpendicular to the first direction; wherein,
the deformation processing in the second direction is performed on the first part according to the deformation proportion of the first part in the first direction, and the deformation processing comprises the following steps:
if the deformation application is in an equal-proportion deformation mode, automatically performing equal-proportion deformation processing on the first local part in the second direction according to the deformation proportion;
the method further comprises the steps of:
if the deformation application is in a non-equal proportion deformation mode, outputting prompt information when the abnormal size proportion of the first part in the first direction and the second direction is detected; wherein,
the prompt message comprises: the first prompt message and/or the second prompt message; the first prompting information is used for prompting a user to select whether to switch the deformation application to an equal-proportion deformation mode; the second prompting information is used for prompting a user to select whether to perform the first partial equal-proportion deformation in the unequal-proportion deformation mode.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the center point of the first local deformed grid in the first direction is: a first center point;
the deformation processing in the second direction is performed on the first part according to the deformation proportion of the first part in the first direction, and the deformation processing comprises the following steps:
the coordinates of the first local deformed mesh are moved in the second direction such that a second center point of the first local deformed mesh in the second direction coincides with the first center point.
3. The method of claim 2, wherein the step of determining the position of the substrate comprises,
the deformation interpolation algorithm for generating deformation is as follows: presetting a deformation interpolation algorithm;
the deformation processing in the second direction is performed on the first part according to the deformation proportion of the first part in the first direction, and the deformation processing comprises the following steps:
and performing pixel coordinate mapping in the second direction by using the preset deformation interpolation algorithm and the first local deformation grid.
4. The method of claim 3, wherein the step of,
the preset deformation interpolation algorithm comprises at least one of the following:
a Bezier curve interpolation algorithm;
spline curve interpolation algorithm.
5. The method according to any one of claims 1 to 4, further comprising:
detecting a deformation mode indication operation;
determining whether the deformation application is in the equal-proportion deformation mode or the unequal-proportion deformation mode according to the indication operation;
if the deformation application is in the unequal ratio deformation mode, outputting prompt information when detecting that the size proportion of the first part in the first direction and the second direction is abnormal, wherein the prompt information comprises:
outputting the second prompt information when the unequal ratio deformation mode entering after the indication operation is detected and the proportion abnormality of the first local part in the first direction and the second direction is detected; otherwise, outputting the first prompt message.
6. The method according to any one of claim 1 to 5, wherein,
the method further comprises the steps of:
and if the indication operation indicating the deformation mode is not detected, the deformation application enters the unequal ratio deformation mode.
7. The method according to any one of claim 1 to 6, wherein,
the target object is a portrait;
the first part is a head.
8. An image processing apparatus, comprising:
the second deformation module is used for carrying out overall deformation processing on the target object in the image in the first direction so as to enable the first local part to deform in the first direction; wherein the target object includes the first part and a second part different from the first part;
the first deformation module is used for carrying out deformation processing on the first local in a second direction according to the deformation proportion of the first local in the first direction, wherein the second direction is perpendicular to the first direction; wherein,
the first deformation module is specifically configured to perform deformation processing of the first local portion in the second direction according to the deformation ratio if the deformation application is in an equal-ratio deformation mode;
the apparatus further comprises:
the prompting module is used for outputting prompting information when the deformation application is in a non-equal proportion deformation mode and the abnormal dimension proportion of the first part in the first direction and the second direction is detected; wherein,
the prompt message comprises: the first prompt message and/or the second prompt message; the first prompting information is used for prompting a user to select whether to switch the deformation application to an equal-proportion deformation mode; the second prompting information is used for prompting a user to select whether to perform the first partial equal-proportion deformation in the unequal-proportion deformation mode.
9. The apparatus of claim 8, wherein the device comprises a plurality of sensors,
the center point of the first local deformed grid in the first direction is: a first center point;
the first deforming module is specifically configured to move coordinates of the first local deformed grid in the second direction, so that a second center point of the first local deformed grid in the second direction coincides with the first center point.
10. The apparatus of claim 9, wherein the device comprises a plurality of sensors,
the deformation interpolation algorithm for generating deformation is as follows: presetting a deformation interpolation algorithm;
the first deformation module is specifically configured to map pixel coordinates in the second direction by using the preset deformation interpolation algorithm and the first local deformation grid.
11. The apparatus of claim 10, wherein the device comprises a plurality of sensors,
the preset deformation interpolation algorithm comprises at least one of the following:
a Bezier curve interpolation algorithm;
spline curve interpolation algorithm.
12. The apparatus according to any one of claims 8 to 11, further comprising:
the first detection module is used for detecting deformation mode indication operation;
the mode selection module is used for determining whether the deformation application is in the equal-proportion deformation mode or the unequal-proportion deformation mode according to the indication operation;
the prompting module is specifically configured to output the second prompting information if the unequal ratio deformation mode entered after the indication operation is detected detects that the ratio of the first local portion in the first direction and the second direction is abnormal; otherwise, outputting the first prompt message.
13. The device according to any one of claims 8 to 12, wherein,
the apparatus further comprises:
and the mode selection module is used for enabling the deformation application to enter the unequal-ratio deformation mode if the indication operation for indicating the deformation mode is not detected.
14. The device according to any one of claims 8 to 13, wherein,
the target object is a portrait;
the first part is a head.
15. A computer storage medium having computer executable code stored thereon; the computer executable code, when executed, is capable of implementing the method provided in any one of claims 1 to 7.
16. An image apparatus, characterized by comprising:
a memory for storing information;
a processor, coupled to the memory, for enabling the implementation of the method provided in any one of claims 1 to 7 by executing computer-executable instructions stored on the memory.
CN201810954773.1A 2018-08-21 2018-08-21 Image processing method and device, image equipment and storage medium Active CN110852932B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810954773.1A CN110852932B (en) 2018-08-21 2018-08-21 Image processing method and device, image equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810954773.1A CN110852932B (en) 2018-08-21 2018-08-21 Image processing method and device, image equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110852932A CN110852932A (en) 2020-02-28
CN110852932B true CN110852932B (en) 2024-03-08

Family

ID=69595407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810954773.1A Active CN110852932B (en) 2018-08-21 2018-08-21 Image processing method and device, image equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110852932B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112634124B (en) * 2020-12-10 2024-04-12 深兰工业智能创新研究院(宁波)有限公司 Image warping method, image warping device, electronic apparatus, and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106558039A (en) * 2015-09-23 2017-04-05 腾讯科技(深圳)有限公司 A kind of facial image processing method and device
CN106797456A (en) * 2016-12-30 2017-05-31 深圳前海达闼云端智能科技有限公司 Projected picture correcting method, means for correcting and robot
CN107154030A (en) * 2017-05-17 2017-09-12 腾讯科技(上海)有限公司 Image processing method and device, electronic equipment and storage medium
CN108009987A (en) * 2017-12-01 2018-05-08 中国科学院长春光学精密机械与物理研究所 A kind of image scaling device and Zoom method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017049783A (en) * 2015-09-01 2017-03-09 キヤノン株式会社 Image processing apparatus and image processing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106558039A (en) * 2015-09-23 2017-04-05 腾讯科技(深圳)有限公司 A kind of facial image processing method and device
CN106797456A (en) * 2016-12-30 2017-05-31 深圳前海达闼云端智能科技有限公司 Projected picture correcting method, means for correcting and robot
CN107154030A (en) * 2017-05-17 2017-09-12 腾讯科技(上海)有限公司 Image processing method and device, electronic equipment and storage medium
CN108009987A (en) * 2017-12-01 2018-05-08 中国科学院长春光学精密机械与物理研究所 A kind of image scaling device and Zoom method

Also Published As

Publication number Publication date
CN110852932A (en) 2020-02-28

Similar Documents

Publication Publication Date Title
CN111460871B (en) Image processing method and device and storage medium
CN110097576B (en) Motion information determination method of image feature point, task execution method and equipment
CN113205568B (en) Image processing method, device, electronic equipment and storage medium
CN109376671B (en) Image processing method, electronic device, and computer-readable medium
KR102461232B1 (en) Image processing method and apparatus, electronic device, and storage medium
CN107798654B (en) Image buffing method and device and storage medium
WO2008012905A1 (en) Authentication device and method of displaying image for authentication
US11403789B2 (en) Method and electronic device for processing images
CN113055615B (en) Conference all-in-one machine, screen segmentation display method and storage device
CN113538587A (en) Camera coordinate transformation method, terminal and storage medium
CN111259841A (en) Image processing method and related equipment
JP2023515411A (en) Video rendering method, apparatus, electronic equipment and storage medium
CN110852932B (en) Image processing method and device, image equipment and storage medium
CN109544490A (en) Image enchancing method, device and computer readable storage medium
CN111145153B (en) Image processing method, circuit, vision-impaired auxiliary equipment, electronic equipment and medium
CN113160038A (en) Image style migration method and device, electronic equipment and storage medium
JP2016144049A (en) Image processing apparatus, image processing method, and program
CN110852934A (en) Image processing method and apparatus, image device, and storage medium
CN110852943A (en) Image processing method and apparatus, image processing device, and storage medium
CN112150387B (en) Method and device for enhancing stereoscopic impression of five sense organs on human images in photo
CN112711984B (en) Fixation point positioning method and device and electronic equipment
CN114943657A (en) Image processing method, image processing device, electronic device, and storage medium
US11790483B2 (en) Method, apparatus, and device for identifying human body and computer readable storage medium
CN113763233A (en) Image processing method, server and photographing device
US9159118B2 (en) Image processing apparatus, image processing system, and non-transitory computer-readable 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
GR01 Patent grant
GR01 Patent grant