CN114913060A - Image deformation method, device, equipment and readable storage medium - Google Patents

Image deformation method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN114913060A
CN114913060A CN202210615811.7A CN202210615811A CN114913060A CN 114913060 A CN114913060 A CN 114913060A CN 202210615811 A CN202210615811 A CN 202210615811A CN 114913060 A CN114913060 A CN 114913060A
Authority
CN
China
Prior art keywords
image
array
feature points
texture
point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210615811.7A
Other languages
Chinese (zh)
Inventor
车小路
何银山
蔡永荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dongfeng Electric Drive Systems Co Ltd
Original Assignee
Dongfeng Electric Drive Systems 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 Dongfeng Electric Drive Systems Co Ltd filed Critical Dongfeng Electric Drive Systems Co Ltd
Priority to CN202210615811.7A priority Critical patent/CN114913060A/en
Publication of CN114913060A publication Critical patent/CN114913060A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/18Image warping, e.g. rearranging pixels individually
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/40Analysis of texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • 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/30248Vehicle exterior or interior
    • G06T2207/30252Vehicle exterior; Vicinity of vehicle
    • G06T2207/30256Lane; Road marking

Landscapes

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

Abstract

The invention provides an image deformation method, an image deformation device, image deformation equipment and a readable storage medium, wherein the image deformation method comprises the following steps: selecting a preset number of first feature points from the initial image based on a texture coordinate system; setting a deformed shape based on a vertex coordinate system, and selecting a preset number of second characteristic points from the deformed shape, wherein the second characteristic points correspond to each point of the first characteristic points one by one; setting the distribution position of the second characteristic point according to the deformation shape; and drawing based on the texture coordinates of the first feature points and the vertex coordinates of the second feature points to obtain a drawn deformation image. According to the invention, the texture coordinate of the first characteristic point represents which position of the initial image the image data is taken from, the vertex coordinate of the second characteristic point represents which position of the image data is displayed on the screen, and the deformation shape can be set automatically according to the requirement, so that the deformation of any shape of the initial image is realized.

Description

Image deformation method, device, equipment and readable storage medium
Technical Field
The present invention relates to the field of image processing, and in particular, to an image deformation method, apparatus, device, and readable storage medium.
Background
There are many image display screens available on modern automobiles, such as: liquid crystal instruments, central control screens, HUD head-up displays (i.e. projecting vehicle-related information such as navigation, vehicle speed, oil pressure, tire pressure, bluetooth telephone, etc. onto a front windshield), etc., there are many drawing requirements on these screens, since the above devices basically use an embedded operating system, and in the embedded operating system, use a GPU (i.e. Graphics processing unit, abbreviated as GPU) to draw using a cross-platform opengles (i.e. OPenGL, Open Graphics Library, which is an Open Graphics interface, and has a bottom Graphics Library which is easy to call, and is also a set of cross-programming language, cross-platform programming interface specification, which is mainly used for programming of two-dimensional and three-dimensional Graphics), which is a main high-performance drawing mode, most of the current drawings achieve the purpose of image deformation based on the displacement, rotation, and scaling of images, etc., but when the image needs to achieve the effect of changing shape arbitrarily, the above method cannot be realized, and in the existing image deformation technology, the image is locally stretched and zoomed, so that color abnormality is easily generated and the image is distorted.
Disclosure of Invention
The invention mainly aims to provide an image deformation method, an image deformation device and a readable storage medium, and aims to solve the technical problems that the image deformation in any shape and the image distortion caused by the image deformation cannot be realized in the prior art.
In a first aspect, the present invention provides an image warping method, comprising:
selecting a preset number of first feature points from the initial image based on the texture coordinate system;
setting a deformed shape based on a vertex coordinate system, and selecting a preset number of second feature points from the deformed shape, wherein the second feature points correspond to each point of the first feature points one by one, and the sequence of each point of the second feature points is consistent with the sequence of each point of the first feature points;
setting the distribution position of the second characteristic point according to the deformation shape;
and drawing based on the texture coordinates of the first feature points and the vertex coordinates of the second feature points to obtain a drawn deformation image.
Optionally, before selecting a preset number of first feature points from the initial image based on the texture coordinate system, the method includes:
and setting the size of the preset number according to the drawing precision of the deformed image.
Optionally, the selecting, based on the texture coordinate system, a preset number of first feature points from the initial image includes:
selecting an initial image from the to-be-deformed image according to the to-be-processed deformed area based on the texture coordinate system;
and selecting a preset number of first feature points from the initial image according to the main content to be drawn.
Optionally, the drawing based on the texture coordinate of the first feature point and the vertex coordinate of the second feature point includes:
constructing and obtaining a first array based on the texture coordinates of the first feature points;
constructing a second array based on the vertex coordinates of the second feature points;
coloring through opengles API based on the first array and the second array;
creating a texture through an opengles API based on the first array and the second array;
the plots are performed by the gldrawArrays function of the opengles API.
Optionally, the drawing based on the texture coordinate of the first feature point and the vertex coordinate of the second feature point further includes:
performing triangle cutting on the initial image based on the first feature point to obtain a first triangle network;
performing triangular cutting on the deformed shape based on the second characteristic point to obtain a second triangular network;
constructing and obtaining a third array based on the texture coordinates of the first triangular network;
constructing and obtaining a fourth array based on the texture coordinates of the second triangular network;
coloring through opengles API based on the third array and the fourth array;
creating a texture through an opengles API based on the third array and the third array;
the plots are performed by the gldrawArrays function of the opengles API.
In a second aspect, the present invention also provides an image morphing apparatus comprising:
the selecting module is used for selecting a preset number of first feature points from the initial image based on the texture coordinate system;
the first setting module is used for setting a deformed shape based on a vertex coordinate system, selecting a preset number of second characteristic points from the deformed shape, wherein the second characteristic points correspond to each point of the first characteristic points one by one, and the sequence of each point of the second characteristic points is consistent with the sequence of each point of the first characteristic points;
the second setting module is used for setting the distribution position of the second characteristic point according to the deformation shape;
and the drawing module is used for drawing based on the texture coordinates of the first characteristic points and the vertex coordinates of the second characteristic points to obtain a drawn deformation image.
Optionally, the selecting module is configured to:
selecting an initial image from the to-be-deformed image according to the to-be-processed deformed area based on the texture coordinate system;
and selecting a preset number of first feature points from the initial image according to the main content to be drawn.
Optionally, the drawing module is configured to:
constructing to obtain a first array based on the texture coordinates of the first feature points;
constructing a second array based on the vertex coordinates of the second feature points;
coloring through opengles API based on the first array and the second array;
creating a texture through an opengles API based on the first array and the second array;
the plots are performed by the gldrawArrays function of the opengles API.
In a third aspect, the present invention also provides an image warping device comprising a processor, a memory, and an image warping program stored on the memory and executable by the processor, wherein the image warping program, when executed by the processor, implements the steps of the image warping method as described above.
In a fourth aspect, the present invention further provides a readable storage medium, on which an image warping program is stored, wherein the image warping program, when executed by a processor, implements the steps of the image warping method as described above.
In the invention, based on a texture coordinate system, a preset number of first feature points are selected from an initial image; setting a deformed shape based on a vertex coordinate system, and selecting a preset number of second feature points from the deformed shape, wherein the second feature points correspond to each point of the first feature points one by one, and the sequence of each point of the second feature points is consistent with the sequence of each point of the first feature points; setting the distribution position of the second characteristic point according to the deformation shape; and drawing based on the texture coordinates of the first characteristic points and the vertex coordinates of the second characteristic points to obtain a drawn deformation image. The invention selects a preset number of first feature points from an initial image under a texture coordinate system, then sets a shape which is required to be deformed under a vertex coordinate system, selects a same number of second feature points according to the shape which is required to be deformed, and sets the distribution positions of the second feature points in the deformed shape according to the shape which is required to be deformed, wherein the second feature points are required to be in one-to-one correspondence with the first feature points, and the position sequence is also kept consistent, because the texture coordinate of the first feature point represents which position to take image data from the initial image, and the vertex coordinate of the second feature point represents which position to display the image data on a screen, drawing is carried out based on the texture coordinate of the first feature point and the vertex coordinate of the second feature point, a drawn deformed image can be obtained, and the deformed shape can be set according to the requirement, thus, the deformation of the initial image in any shape is realized.
Drawings
FIG. 1 is a schematic diagram of a hardware configuration of an image warping apparatus according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an image warping method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a texture coordinate system and a vertex coordinate system according to an embodiment of the image warping method of the present invention;
FIG. 4 is a schematic flow chart of a normal image rendering method according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of a method for transforming an image according to an embodiment of the present invention;
fig. 6 is a schematic diagram of functional modules of an image warping apparatus according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In a first aspect, an embodiment of the present invention provides an image warping apparatus.
Referring to fig. 1, fig. 1 is a schematic diagram of a hardware structure of an embodiment of an image warping apparatus according to the present invention. In an embodiment of the present invention, the image warping apparatus may include a processor 1001 (e.g., a Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used for realizing connection communication among the components; the user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard); the network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WI-FI interface, WI-FI interface); the memory 1005 may be a Random Access Memory (RAM) or a non-volatile memory (non-volatile memory), such as a disk memory, and the memory 1005 may optionally be a storage device independent of the processor 1001. Those skilled in the art will appreciate that the hardware configuration depicted in FIG. 1 is not intended to be limiting of the present invention, and may include more or less components than those shown, or some components in combination, or a different arrangement of components.
With continued reference to FIG. 1, the memory 1005 of FIG. 1, which is one type of computer storage medium, may include an operating system, a network communication module, a user interface module, and an image morphing program therein. The processor 1001 may call an image warping program stored in the memory 1005, and execute the image warping method provided by the embodiment of the present invention.
In a second aspect, an embodiment of the present invention provides an image warping method.
In order to more clearly show the image deformation method provided by the embodiment of the present application, an application scenario of the image deformation method provided by the embodiment of the present application is first introduced.
The image deformation method provided by the embodiment of the application is applied to embedded vehicle-mounted equipment, and deformation effect display of an original image is realized by using a cross-programming language and cross-platform opengles graphical interface, for example, when a navigation lane line needs to be displayed, because the shape of a route can be changed randomly according to actual road conditions, if image drawing is performed in a proportion-keeping mode by using the original navigation image, a good display effect cannot be achieved, at the moment, the real-time change shape of the route needs to be considered, the route is drawn and displayed into a corresponding shape according to navigation data, and the phenomenon of image display distortion is not generated.
In an embodiment, referring to fig. 2, fig. 2 is a schematic flowchart of an embodiment of an image warping method according to the present invention, as shown in fig. 2, the image warping method includes:
step S10, selecting a predetermined number of first feature points from the initial image based on the texture coordinate system.
In this embodiment, referring to fig. 3, fig. 3 is a schematic diagram of a texture coordinate system and a vertex coordinate system according to an embodiment of the image warping method of the present invention, as shown in fig. 3, the texture coordinates in the texture coordinate system represent the mapping relationship between the texture and the image, and in the texture coordinate system, each point in the image corresponds to a texture coordinate, i.e. the texture data representing the image to be read from the location, the texture coordinates range from 0 to 1, the default lower left corner of the texture coordinates is (0, 0), the default upper right corner is (1, 1), the initial image is the initial image to be warped in this embodiment, in the field of image processing, a feature point refers to a point where a gray value of an image changes drastically or a point with a large curvature (i.e., an intersection of two edges) located on an edge of the image, and generally has characteristics of rotation invariance, illumination invariance, view angle invariance, and the like.
Step S20, based on the vertex coordinate system, setting a deformation shape, selecting the second feature points with the preset number from the deformation shape, wherein the second feature points are in one-to-one correspondence with each point of the first feature points, and the sequence of each point of the second feature points is consistent with the sequence of each point of the first feature points.
In this embodiment, with reference to fig. 3, as shown in fig. 3, a vertex coordinate in a vertex coordinate system represents a mapping relationship between an image and a screen, that is, a feature point in the image is displayed at the position on the screen, the vertex coordinate ranges from-1 to 1, a center point of the vertex coordinate system is generally set to coincide with a center point of the screen, a deformation shape can be set by a user according to a deformation requirement, a second feature point in the vertex coordinate system and a first feature point in a texture coordinate system must have a one-to-one mapping relationship, and a position sequence between each point is also kept unchanged, so as to avoid phenomena such as misalignment and distortion of the drawn image.
Step S30 is to set the distribution position of the second feature point based on the deformed shape.
In this embodiment, after the deformed shape is set, the distribution position of the second feature point is set according to the deformed shape, and since the vertex coordinates of the second feature point represent the display area on the screen, a larger number of feature points may be distributed in the head area and a smaller number of feature points may be distributed in the other limb body areas according to a desired deformation effect, for example, a head area in which the deformed shape is desired to be highlighted.
And step S40, drawing is carried out based on the texture coordinates of the first characteristic points and the vertex coordinates of the second characteristic points, and drawn deformation images are obtained.
In this embodiment, referring to fig. 4 and 5, fig. 4 is a schematic flow chart of drawing a normal image according to an embodiment of the image deformation method of the present invention, and fig. 5 is a schematic flow chart of drawing a deformed image according to an embodiment of the image deformation method of the present invention, as shown in fig. 5, after texture coordinates of a first feature point and vertex coordinates of a second feature point are determined, image data may be taken from an initial image according to the positions of the texture coordinates, and then the image data is displayed at the positions of the vertex coordinates on a screen, thereby realizing drawing of the deformed image.
In this embodiment, the texture coordinates of the first feature point represent from which position of the initial image the image data is to be fetched, and the vertex coordinates of the second feature point represent from which position of the image data is to be displayed on the screen, so that drawing is performed based on the texture coordinates of the first feature point and the vertex coordinates of the second feature point, and a drawn deformed image can be obtained, and the deformed shape can be set as required, thereby implementing deformation of any shape of the initial image.
Further, in an embodiment, before step S10, the method includes:
and setting the preset number according to the drawing precision of the deformed image.
In this embodiment, the number of the feature points is correspondingly set according to the drawing accuracy of the deformed image, for example, if the drawing accuracy requirement of the deformed image is high, a larger number of feature points are correspondingly selected to improve the drawing accuracy of the image.
Further, in one embodiment, step S10 includes:
selecting an initial image from the to-be-deformed image according to the to-be-processed deformed area based on the texture coordinate system;
and selecting a preset number of first feature points from the initial image according to the main content to be drawn.
In this embodiment, we may choose to deform the whole image or select a partial region of the image, for example, a whole image of a person, and we may select an image region where the head is located to deform, and set the position of the first feature point according to the content of the subject to be drawn, for example, a head image of a person, and hope to highlight the eyes of the person, that is, select a greater number of feature points in the image region where the eyes are located, and select a lesser number of feature points in other head image regions except the eyes.
Further, in one embodiment, step S40 includes:
constructing and obtaining a first array based on the texture coordinates of the first feature points;
constructing a second array based on the vertex coordinates of the second feature points;
coloring through opengles API based on the first array and the second array;
creating a texture through an opengles API based on the first array and the second array;
the plots are performed by the gldrawArrays function of the opengles API.
In this embodiment, the texture coordinates of the first feature point and the vertex coordinates of the second feature point are respectively configured into an array, each element in the array is a coordinate value of each feature point, and is transmitted to a shader through opengles API to be shaded, and then, a texture is created, and finally, drawing is realized.
Further, in an embodiment, the step S40 further includes:
performing triangle cutting on the initial image based on the first feature point to obtain a first triangle network;
performing triangular cutting on the deformed shape based on the second characteristic point to obtain a second triangular network;
constructing and obtaining a third array based on the texture coordinates of the first triangular network;
constructing and obtaining a fourth array based on the texture coordinates of the second triangular network;
coloring through opengles API based on the third array and the fourth array;
creating a texture through an opengles API based on the third array and the third array;
the plots are performed by the gldrawArrays function of the opengles API.
In this embodiment, as required, the triangle cutting may be performed on the initial image according to the first feature point, and the triangle cutting may be performed on the deformed shape according to the second feature point, so as to visually observe the image deformation process and the expected deformation effect, since the object drawn by drawing the image on the opengles bottom layer only includes points, lines and triangles, the processing efficiency of the image deformation may be correspondingly improved by performing the cutting in advance, in the case of cutting the triangle, it is necessary to construct a two-dimensional array for the texture coordinates of the first feature point and the vertex coordinates of the second feature point, where the first dimension includes all the cut triangles, that is, each element of the array corresponds to each triangle, the second dimension includes the coordinate values of each point of each triangle, and the constructed two-dimensional third array and fourth array are processed through the opengles API, and transmitting the data to a shader for shading, then creating textures, and finally realizing drawing.
In a third aspect, an embodiment of the present invention further provides an image warping apparatus.
Referring to fig. 6, fig. 6 is a functional block diagram of an image warping apparatus according to an embodiment of the present invention.
In this embodiment, the image morphing apparatus includes:
a selecting module 10, configured to select a preset number of first feature points from the initial image based on the texture coordinate system;
a first setting module 20, configured to set a deformed shape based on a vertex coordinate system, and select a preset number of second feature points from the deformed shape, where the second feature points correspond to each point of the first feature points one to one, and an order between each point of the second feature points is consistent with an order between each point of the first feature points;
a second setting module 30, configured to set distribution positions of the second feature points according to the deformed shape;
and the drawing module 40 is configured to perform drawing based on the texture coordinates of the first feature point and the vertex coordinates of the second feature point, so as to obtain a drawn deformation image.
Further, in an embodiment, the image warping apparatus further includes a third setting module 50, configured to:
and setting the size of the preset number according to the drawing precision of the deformed image.
Further, in an embodiment, the selecting module 10 is configured to:
selecting an initial image from the to-be-deformed image according to the to-be-processed deformed area based on the texture coordinate system;
and selecting a preset number of first feature points from the initial image according to the main content to be drawn.
Further, in an embodiment, the drawing module 40 is configured to:
constructing and obtaining a first array based on the texture coordinates of the first feature points;
constructing a second array based on the vertex coordinates of the second feature points;
coloring through opengles API based on the first array and the second array;
creating a texture through an opengles API based on the first array and the second array;
the plots are performed by the gldrawArrays function of the opengles API.
Further, in an embodiment, the drawing module 40 is configured to:
performing triangle cutting on the initial image based on the first feature point to obtain a first triangle network;
performing triangular cutting on the deformed shape based on the second characteristic point to obtain a second triangular network;
constructing and obtaining a third array based on the texture coordinates of the first triangular network;
constructing and obtaining a fourth array based on the texture coordinates of the second triangular network;
coloring through opengles API based on the third array and the fourth array;
creating a texture through an opengles API based on the third array and the third array;
the plots are performed by the gldrawArrays function of the opengles API.
The function implementation of each module in the image deformation apparatus corresponds to each step in the image deformation method embodiment, and the function and implementation process are not described in detail here.
In a fourth aspect, the embodiment of the present invention further provides a readable storage medium.
The readable storage medium of the present invention stores an image morphing program, wherein the image morphing program, when executed by a processor, implements the steps of the image morphing method as described above.
The method implemented when the image transformation program is executed may refer to various embodiments of the image transformation method of the present invention, and details thereof are not repeated herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention or the portions contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above and includes several instructions for causing a terminal device to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An image warping method, characterized by comprising:
selecting a preset number of first feature points from the initial image based on a texture coordinate system;
setting a deformed shape based on a vertex coordinate system, and selecting a preset number of second feature points from the deformed shape, wherein the second feature points correspond to each point of the first feature points one by one, and the sequence of each point of the second feature points is consistent with the sequence of each point of the first feature points;
setting the distribution position of the second characteristic point according to the deformation shape;
and drawing based on the texture coordinates of the first characteristic points and the vertex coordinates of the second characteristic points to obtain a drawn deformation image.
2. The image warping method of claim 1, wherein before the selecting a predetermined number of first feature points from the initial image based on the texture coordinate system, the method comprises:
and setting the size of the preset number according to the drawing precision of the deformed image.
3. The image warping method of claim 1, wherein the selecting a predetermined number of first feature points from the initial image based on the texture coordinate system comprises:
selecting an initial image from the to-be-deformed image according to the to-be-processed deformed area based on the texture coordinate system;
and selecting a preset number of first feature points from the initial image according to the main content to be drawn.
4. The image warping method of claim 1, wherein said drawing based on the texture coordinates of the first feature point and the vertex coordinates of the second feature point comprises:
constructing and obtaining a first array based on the texture coordinates of the first feature points;
constructing a second array based on the vertex coordinates of the second feature points;
coloring through openglesAPI based on the first array and the second array;
creating a texture through an openglesAPI based on the first array and the second array;
the plots are performed by the glDrawArrays function of openglesa api.
5. The image warping method of claim 1, wherein said drawing based on the texture coordinates of the first feature point and the vertex coordinates of the second feature point further comprises:
performing triangle cutting on the initial image based on the first feature point to obtain a first triangle network;
performing triangle cutting on the deformed shape based on the second characteristic point to obtain a second triangle network;
constructing and obtaining a third array based on the texture coordinates of the first triangular network;
constructing and obtaining a fourth array based on the texture coordinates of the second triangular network;
coloring through openglesAPI based on the third array and the fourth array;
creating a texture through openglessAPI based on the third array and the third array;
the plots are performed by the glDrawArrays function of openglesa api.
6. An image warping device, characterized by comprising:
the selecting module is used for selecting a preset number of first feature points from the initial image based on the texture coordinate system;
the first setting module is used for setting a deformed shape based on a vertex coordinate system, selecting a preset number of second characteristic points from the deformed shape, wherein the second characteristic points correspond to each point of the first characteristic points one by one, and the sequence of each point of the second characteristic points is consistent with the sequence of each point of the first characteristic points;
the second setting module is used for setting the distribution position of the second characteristic point according to the deformation shape;
and the drawing module is used for drawing based on the texture coordinates of the first characteristic points and the vertex coordinates of the second characteristic points to obtain a drawn deformation image.
7. The image morphing apparatus of claim 6, wherein the selection module is to:
selecting an initial image from the to-be-deformed image according to the to-be-processed deformed area based on the texture coordinate system;
and selecting a preset number of first feature points from the initial image according to the main content to be drawn.
8. The image warping device of claim 6, wherein the drawing module is configured to:
constructing and obtaining a first array based on the texture coordinates of the first feature points;
constructing a second array based on the vertex coordinates of the second feature points;
coloring through openglesAPI based on the first array and the second array;
creating a texture through openglessAPI based on the first array and the second array;
the plots are performed by the glDrawArrays function of openglesa api.
9. An image warping device, characterized in that the image warping device comprises a processor, a memory, and an image warping program stored on the memory and executable by the processor, wherein the image warping program, when executed by the processor, implements the steps of the image warping method according to any one of claims 1 to 5.
10. A readable storage medium having an image morphing program stored thereon, wherein the image morphing program when executed by a processor implements the steps of the image morphing method according to any one of claims 1 to 5.
CN202210615811.7A 2022-05-31 2022-05-31 Image deformation method, device, equipment and readable storage medium Pending CN114913060A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210615811.7A CN114913060A (en) 2022-05-31 2022-05-31 Image deformation method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210615811.7A CN114913060A (en) 2022-05-31 2022-05-31 Image deformation method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN114913060A true CN114913060A (en) 2022-08-16

Family

ID=82770756

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210615811.7A Pending CN114913060A (en) 2022-05-31 2022-05-31 Image deformation method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114913060A (en)

Similar Documents

Publication Publication Date Title
EP3129976B1 (en) Varying effective resolution by screen location by altering rasterization parameters
KR101916341B1 (en) Gradient adjustment for texture mapping for multiple render targets with resolution that varies by screen location
US7884825B2 (en) Drawing method, image generating device, and electronic information apparatus
EP3121786B1 (en) Graphics pipeline method and apparatus
JP5336067B2 (en) Method and apparatus for processing graphics
CN111369657B (en) Three-dimensional thermodynamic diagram generation method and device, computer equipment and storage medium
US6292192B1 (en) System and method for the direct rendering of curve bounded objects
JPH07181952A (en) Picture display method, context-preserved picture display and picture scaling method
CN107273007B (en) System and non-transitory computer readable medium for scaling a visualization image
KR20180060198A (en) Graphic processing apparatus and method for processing texture in graphics pipeline
GB2313028A (en) Method of transforming a basic shape element of a character
JP4717000B2 (en) Texture-based method and system for line and character anti-aliasing
CN107038729B (en) Digital instrument panel drawing method based on OpenGL-ES
US20160307294A1 (en) Systems and Methods for Displaying Patterns of Recurring Graphics on Digital Maps
JP2009301284A (en) Drawing device and method
US20150325022A1 (en) Technique for processing a character string for graphical representation on a man/machine interface
JP4760550B2 (en) Image conversion apparatus and image conversion program
CN114913060A (en) Image deformation method, device, equipment and readable storage medium
JP7086180B2 (en) Dynamic styling of digital maps
US6697081B1 (en) Image processing method and device, and storage medium storing a program therefor
JP2012108825A (en) Information processing device, information processing method and program
CN115761166A (en) Map construction method based on vector tiles and application thereof
JP2008097450A (en) Graphics drawing device and program
KR100705188B1 (en) A character font display method
JP3872056B2 (en) Drawing method

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