CN107122774B - A kind of adaptive chart pasting method and system mobile with key point in image - Google Patents
A kind of adaptive chart pasting method and system mobile with key point in image Download PDFInfo
- Publication number
- CN107122774B CN107122774B CN201710193044.4A CN201710193044A CN107122774B CN 107122774 B CN107122774 B CN 107122774B CN 201710193044 A CN201710193044 A CN 201710193044A CN 107122774 B CN107122774 B CN 107122774B
- Authority
- CN
- China
- Prior art keywords
- coordinate
- textures
- key point
- image
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/60—Editing figures and text; Combining figures or text
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformation in the plane of the image
- G06T3/20—Linear translation of a whole image or part thereof, e.g. panning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformation in the plane of the image
- G06T3/40—Scaling the whole image or part thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformation in the plane of the image
- G06T3/60—Rotation of a whole image or part thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/25—Determination of region of interest [ROI] or a volume of interest [VOI]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2200/00—Indexing scheme for image data processing or generation, in general
- G06T2200/24—Indexing scheme for image data processing or generation, in general involving graphical user interfaces [GUIs]
Abstract
The present invention provides a kind of adaptive chart pasting method and system with key point movement in image, wherein method includes: to position the position of key point in critical object in image, according to change in location of the key point after mobile, spin matrix conversion spin matrix conversion is carried out to any point on image, the coordinate after obtaining the spin matrix conversion at the corresponding any point;According to the zoom factor of coordinate and textures of the key point after mobile, a certain range of coordinate near the position after being located at key point movement is obtained;According to the zoom factor of a certain range of coordinate, the coordinate of key point and textures near the position positioned at key point after mobile, textures sample coordinate is obtained, and show textures in the textures sample coordinate.The invention enables in the case where face rotates, textures are adaptively rotated, and do not change original display scale, improve the experience of user.
Description
Technical field
The present invention relates to field of image processings, more particularly, to the adaptive textures side mobile with key point in image
Method and system.
Background technique
With the development of camera work and computer application, textures are carried out on the video images and are become increasingly prevalent, institute
Meaning textures are exactly the effect that privileged site in the picture adds dynamic textures, by taking face as an example, privileged site can refer to eyes,
Textures are only placed on the specific position in picture by nose or mouth, existing chart pasting method, when specific position becomes
When change, although the position of textures also changes therewith, the display scale due to not accounting for specific position is changed, and is caused
A degree of distortion can occur for the shape of textures, so that the display effect of textures is had a greatly reduced quality.
Summary of the invention
The present invention provide it is a kind of overcome the above problem or at least be partially solved the above problem with key point in image
The method and system of mobile adaptive textures.
According to an aspect of the present invention, a kind of method of adaptive textures mobile with key point in image, packet are provided
It includes:
S1, the position for positioning key point in critical object in image are right according to change in location of the key point after mobile
Any point on image carries out spin matrix conversion, the coordinate after obtaining the spin matrix conversion at the corresponding any point;
The zoom factor of S2, coordinate and textures according to key point after mobile, obtain be located at key point it is mobile after position
Neighbouring a certain range of coordinate;
S3, according to a certain range of coordinate near the position positioned at key point after mobile, key point coordinate and
The zoom factor of textures obtains textures sample coordinate, and shows textures in the textures sample coordinate.
According to another aspect of the present invention, a kind of adaptive textures system mobile with key point in image, packet are provided
It includes:
Coordinate device is converted, the position of key point in critical object in image is positioned, after key point movement
Change in location carries out spin matrix conversion to any point on image, obtains the spin matrix conversion at the corresponding any point
Coordinate afterwards;
Neighbouring Coordinate generation device obtains according to the zoom factor of coordinate and textures of the key point after mobile and is located at key
A certain range of coordinate near position after point is mobile;
Textures sample coordinate obtains device, according to a certain range of seat near the position positioned at key point after mobile
The zoom factor of mark, the coordinate of key point and textures obtains textures sample coordinate, and shows in the textures sample coordinate
Textures.
The application proposes a kind of adaptive chart pasting method and system with key point movement in image, by positioning image
The position of key point in critical object carries out any point on image according to change in location of the key point after mobile
Spin matrix conversion obtains corresponding to the coordinate after the spin matrix conversion of the point, it is ensured that the point on image is all with the position of key point
It sets and changes and synchronizing moving, further according to the zoom factor of coordinate and textures of the key point after mobile, it is mobile that screening is located at key point
A certain range of coordinate near position afterwards obtains display patch finally in conjunction with the coordinate of key point and the zoom factor of textures
The textures sample coordinate of figure, the invention enables in the case where the movement of key point on the image, textures are adaptively moved, and
And do not change original display scale, improve the experience of user.
Detailed description of the invention
Fig. 1 is a kind of flow chart of adaptive chart pasting method mobile with key point in image of the embodiment of the present invention;
Fig. 2 is the flow chart of step S1 in the embodiment of the present invention;
Fig. 3 is the flow diagram of step S2 in the embodiment of the present invention;
Fig. 4 is a kind of block diagram of adaptive textures system mobile with key point in image of the embodiment of the present invention;
Fig. 5 is the structural block diagram of conversion module in the embodiment of the present invention.
Specific embodiment
With reference to the accompanying drawings and examples, specific embodiments of the present invention will be described in further detail.Implement below
Example is not intended to limit the scope of the invention for illustrating the present invention.
In order to overcome in the prior art, the problem of textures cannot adaptively be rotated with the rotation of face, the present invention is provided
A kind of chart pasting method for adaptively rotating that can be rotated with face.
Fig. 1 shows a kind of flow chart of adaptive chart pasting method with face rotation of the embodiment of the present invention, as Fig. 1 can
Know, this method includes:
S1, the position for positioning key point in critical object in image are right according to change in location of the key point after mobile
Any point on image carries out spin matrix conversion, the coordinate after obtaining the spin matrix conversion at the corresponding any point;
The zoom factor of S2, coordinate and textures according to key point after mobile, obtain be located at key point it is mobile after position
Neighbouring a certain range of coordinate;
S3, according to a certain range of coordinate near the position positioned at key point after mobile, key point coordinate and
The zoom factor of textures obtains textures sample coordinate, and shows textures in the textures sample coordinate.
The application proposes a kind of adaptive chart pasting method and system with key point movement in image, by positioning image
The position of key point in critical object carries out any point on image according to change in location of the key point after mobile
Spin matrix conversion, obtains corresponding to the coordinate after the conversion of the point, further according to the scaling of coordinate and textures of the key point after mobile
Coefficient, screening are located at a certain range of coordinate near the position after key point movement, finally combine the coordinate and patch of key point
The zoom factor of figure obtains the textures sample coordinate of display textures, in the case where being moved the invention enables key point on the image,
Textures are adaptively moved, and do not change original display scale, improve the experience of user.
Fig. 2 shows the flow charts of step S1 in the embodiment of the present invention, comprising:
S1.1, the ratio of width to height for obtaining image position the position of key point in critical object in image.
It should be noted that since the shape of normal image is rectangle, the ratio of width to height of such as most of video be 16:9,
Therefore 4:3,2:1 when the coordinate on image rotates, will necessarily be distorted, most significantly having mobile phone viewing view
When frequency, mobile phone is under transverse screen mode or under vertical screen model, and word is of different size on subtitle, therefore, in order to guarantee that textures are rotating
Shape in the process remains unchanged, and the present embodiment considers that the ratio of width to height based on image zooms in and out the coordinate at any point.
S1.2, the rotational angle for obtaining the mobile distance of key point and critical object.
S1.3, the ratio of width to height, the distance of key point movement and the rotational angle of critical object according to image, on image
Any point carry out spin matrix conversion, the coordinate after obtaining the spin matrix conversion at the corresponding any point.
It should be noted that the coordinate of image is referred to as world coordinate system, by moveable critical object institute in image
Coordinate system be referred to as object coordinates system, although textures are located in the coordinate system of image, textures follow object to transport always again
It is dynamic, it is equivalent to have with the coordinate system of object and contacts, therefore in order to guarantee that the rotation of textures adapts to the conversion between two coordinate systems,
The rotational angle of the distance and critical object that need the ratio of width to height according to image, key point mobile, to any one on image
Point carries out spin matrix conversion.
For making to describe clearly understandable consideration, the critical object in following embodiment is not used to by taking face as an example
It limits the scope of the invention.
In one embodiment, step S1.3 further comprises:
S1.3.1, any point on image zooms in and out the coordinate of the point according to the ratio of width to height of image, obtains
Coordinate after scaling;
S1.3.2, the coordinate that the coordinate of rotary middle point is moved to the key point by origin, and according to key
The moving distance of point translates the coordinate after scaling, obtains the coordinate after translating for the first time.
If should be noted that a D graphics after certain point O rotation alpha °, obtained new figure and original image shape is completely heavy
It closes, O is referred to as the rotary middle point of D graphics.In order to guarantee that textures can be rotated with some specific position, need to rotate
The heart is moved to specific position, to guarantee that postrotational image and original image are completely coincident, under application scenarios of the invention, and rotation
Central point is key point, so-called key point, is exactly the point that textures need to be aligned always, in the eyes of people briefly
For upper carry out textures, key point can be the central point (assuming that coordinate that this point is pupil) in the region of the eyes of people.It is aobvious
So, rotary middle point described in the present embodiment refers to the key point after face in image is mobile, equally with it is above-mentioned for example, just
It is the coordinate of pupil after face is mobile.Certainly, the invention is not limited to textures are carried out to human eye, the present disclosure applies equally to right
Other positions of face, such as the textures of nose, mouth or eyebrow, this will not be repeated here.
S1.3.3, according to the rotational angle of critical object and the coordinate of rotary middle point, after being translated for the first time to this
Coordinate is rotated, and postrotational coordinate is obtained.
It should be noted that the rotation angle of face can be calculated by the position of key point on face, for example, calculating
The angle of the bridge of the nose and horizontal direction X-axis, is no longer shown in detail calculation formula herein.Therefore, in order to guarantee postrotational coordinate with
The rotation angle of face is consistent and shape does not change, and the present embodiment passes through the rotation angle and rotation center according to face
The coordinate of point rotates the coordinate after first time translation to obtain.
S1.3.4, by the coordinate of rotary middle point by the coordinate translation Aligning control coordinate of the key point, and according to rotation
The moving distance of central point translates the coordinate after scaling, obtains the coordinate after translating second.
S1.3.5, the coordinate after second of translation is scaled into back former ratio, the coordinate after obtaining the conversion.
It should be noted that coordinate is scaled former ratio, that is, realizes the correct of textures after completing second to translate
Display.
In one embodiment, step S1.3 further comprises:
S1.3.1, for any point on image, the coordinate (x, y) of the point is converted into homogeneous coordinates (x, y, 1), base
In the ratio of width to height R of image, which is zoomed in and out, the coordinate (R*x, y, 1) after being scaled.
It should be noted that, it is that the vector that n is tieed up is indicated with a n+1 dimensional vector that homogeneous coordinates, which are exactly by a script,.Example
Such as, the homogeneous coordinates of two-dimensional points (x, y) are expressed as (hx, hy, h).It can thus be seen that the homogeneous expression of a vector is not only
What one, the h of homogeneous coordinates took that different values all indicates is the same point, for example homogeneous coordinates (8,4,2), (4,2,1) indicate
Be all two-dimensional points (4,2).The purpose for being introduced into homogeneous coordinates is mainly the multiplication and addition merged in matrix operation, is expressed as p'
The form of=p*M.I.e. it is provided with matrix operation a point set in two dimension, three-dimensional even higher dimensional space from a coordinate
System transforms to the effective ways of another coordinate system.
Coordinate matrix M after scaling1It indicates are as follows:
S1.3.2, the coordinate (D that the coordinate of rotary middle point is moved to the key point by origin (0,0)x,Dy),
And the coordinate after scaling is translated according to the moving distance of key point, obtain the coordinate (R*x+D after translating for the first timex/R,
y+Dy,1)。
It should be noted that the coordinate of former rotary middle point is origin (0,0), it is assumed that translation in two-dimensional coordinate
Coordinate afterwards is (Dx,Dy), it is shifted sx unit in x-axis direction, is shifted sy unit in y-axis direction, defining [x, y] is
Coordinate before converting, [X, Y] are coordinate after transformation.Then: X=x+sx;Y=y+sy;It is indicated with matrix:
It is applied in the present embodiment, the coordinate matrix M after translating for the first time2It indicates are as follows:
S1.3.3, according to the rotational angle a of critical object and the coordinate of rotary middle point, after being translated for the first time to this
Coordinate is rotated, and postrotational coordinate: ((R*x+D is obtainedx/R)*cosa-(y+Dy)*sina,(R*x+Dx/R)*sina-(y+
Dy)*cosa,1)。
It should be noted that setting certain point with origin line and X-axis angle as b degree, using origin as the center of circle, a is turned over counterclockwise
Degree, origin and the wire length are R.[x, y] is coordinate before converting, and [X, Y] is coordinate after transformation.Then:
X=R*cos (b);Y=R*sin (b);
X=R*cos (a+b)=R*cos (a) * cos (b)-R*sin (a) * sin (b)=x*cos (a)-y*sin (a);
Y=R*sin (a+b)=R*sin (a) * cos (b)+R*cos (a) * sin (b)=x*sin (a)+y*cos (a);
It is indicated with matrix:
It is applied in the present embodiment, postrotational coordinate matrix M3It indicates are as follows:
S1.3.4, by the coordinate of rotary middle point by the coordinate translation of the key point to origin, and according to rotation
Central point translation distance translates postrotational coordinate, obtains the coordinate after translating: ((R*x+D secondx/R)*cosa-
(y+Dy)*sina-Dx/R,(R*x+Dx/R)*sina-(y+Dy)*cosa-Dy,1)。
It should be noted that the coordinate matrix M after second of translation4It indicates are as follows:
S1.3.5, the coordinate after second of translation is scaled into back former ratio, the coordinate after obtaining the conversion: ((x+
Dx/R2)*cosa-(y+Dy)*sina-Dx/R2,(x+Dx/R2)*sina-(y+Dy)*cosa-Dy)。
It should be noted that the coordinate after conversion is indicated with matrix M5 are as follows:
Fig. 3 shows the flow diagram of step S2 in the embodiment of the present invention, and as shown in Figure 3, step S2 includes:
S2.1, the longitudinal length based on critical object, textures width and image width, obtain textures in the contracting of x-axis
Coefficient is put, the height of longitudinal length, textures height and image based on critical object obtains textures in the zoom factor of y-axis;
S2.2, for any one spin matrix conversion after coordinate, define the spin matrix conversion after coordinate be
(dstx,dsty), the coordinate of key point is (centerx,centery), when the postrotational coordinate meets the following conditions:
(centerx-resizex*0.5)<dstx≤(centerx+resizex* 0.5) and (centery–resizey*0.5)<dsty≤
(centery+resizey* 0.5), then using the spin matrix conversion after coordinate be used as be located at key point move after position near
A certain range of coordinate.
In one alternate embodiment, zoom factor resize of the textures in x-axisxExpression formula are as follows: resizex=l*w/
(W*r);Zoom factor resize of the textures in y-axisyExpression formula are as follows: resizey=l*h/ (H*r);
Wherein, l indicates the length of the longitudinal length of critical object, such as the length of face, and w indicates the width of textures, h table
Show the height of textures, r indicates that display coefficient, W indicate that the width of image, H indicate the height of image.
In one alternate embodiment, according to a certain range of coordinate near the position positioned at key point after mobile,
The step of coordinate of key point and zoom factor of textures, acquisition textures sample coordinate, further comprise:
It is (near that definition, which is located at a certain range of coordinate near the position after key point movement,x,neary), key point coordinate
For (centerx,centery), zoom factor resize of the textures in x-axisx, zoom factor resize of the textures in y-axisy, textures
Sample coordinate is (coordx,coordy), then:
coordx=(nearx-centerx+resizex*0.5)/resizex;
coordy=(neary-centery+resizey*0.5)/resizey。
Fig. 4 shows a kind of block diagram of adaptive textures system mobile with key point in image of the embodiment of the present invention,
Include:
Coordinate device is converted, the position of key point in critical object in image is positioned, after key point movement
Change in location carries out spin matrix conversion to any point on image, obtains the spin matrix conversion at the corresponding any point
Coordinate afterwards;
Neighbouring Coordinate generation device obtains according to the zoom factor of coordinate and textures of the key point after mobile and is located at key
A certain range of coordinate near position after point is mobile;
Textures sample coordinate obtains device, according to a certain range of seat near the position positioned at key point after mobile
The zoom factor of mark, the coordinate of key point and textures obtains textures sample coordinate, and shows in the textures sample coordinate
Textures.
It should be noted that position of the present embodiment by key point in critical object in positioning image, according to the pass
Change in location after key point is mobile carries out spin matrix conversion to any point on image, obtains the spin moment for corresponding to the point
Coordinate after battle array conversion, it is ensured that point all synchronizing movings with the change in location of key point on image, it is mobile further according to key point
The zoom factor of coordinate and textures afterwards, screening are located at a certain range of coordinate near the position after key point movement, finally tie
The coordinate of key point and the zoom factor of textures are closed, obtains the textures sample coordinate of display textures, the invention enables in image
In the case that upper key point is mobile, textures are adaptively moved, and do not change original display scale, improve user
Experience.
In one embodiment, conversion coordinate device includes:
Locating module positions the position of key point in critical object in image for obtaining the ratio of width to height of image;
It should be noted that since the shape of normal image is rectangle, the ratio of width to height of such as most of video be 16:9,
Therefore 4:3,2:1 when the coordinate on image rotates, will necessarily be distorted, most significantly having mobile phone viewing view
When frequency, mobile phone is under transverse screen mode or under vertical screen model, and word is of different size on subtitle, therefore, in order to guarantee that textures are rotating
Shape in the process remains unchanged, and the present embodiment considers that the ratio of width to height based on textures zooms in and out the coordinate at any point.
Obtain key point parameter module, the rotational angle for obtaining the mobile distance of key point and critical object;With
And
Conversion module, the rotational angle of the distance and critical object mobile for the ratio of width to height, the key point according to image,
Spin matrix conversion is carried out to any point on image, the coordinate after obtaining the conversion at the corresponding any point.
It should be noted that the coordinate of image is referred to as world coordinate system, by moveable critical object institute in image
Coordinate system be referred to as object coordinates system, although textures are located in the coordinate system of image, textures follow object to transport always again
It is dynamic, it is equivalent to have with the coordinate system of object and contacts, therefore in order to guarantee that the rotation of textures adapts to the conversion between two coordinate systems,
The rotational angle of the distance and critical object that need the ratio of width to height according to image, key point mobile, to any one on image
Point carries out spin matrix conversion.
Fig. 5 shows the structural block diagram of conversion module in the embodiment of the present invention, comprising:
First unit for scaling, for being carried out according to the ratio of width to height of image to the coordinate of the point to any point on image
Scaling, the coordinate after being scaled.
First translation unit, for the coordinate of rotary middle point to be moved to the coordinate of the key point by origin,
And the coordinate after scaling is translated according to the moving distance of key point, obtain the coordinate after translating for the first time.
If should be noted that a D graphics after certain point O rotation alpha °, obtained new figure and original image shape is completely heavy
It closes, D is referred to as rotational symmetry figure, and O is referred to as the rotary middle point of rotational symmetry D graphics.In order to guarantee that textures can be with some spy
Positioning, which is set, to be rotated, and needs rotation center being moved to specific position, to guarantee that postrotational image and original image are completely heavy
It closes, under application scenarios of the invention, rotary middle point is key point, so-called key point, is exactly that textures need briefly
Always the point to be aligned, for carrying out textures on the eyes in people, key point can be the central point in the region of the eyes of people
(assuming that coordinate that this point is pupil).Obviously, after rotary middle point described in the present embodiment refers to that face is mobile in image
Key point, equally with it is above-mentioned for example, be exactly the coordinate of pupil after face is mobile.Certainly, the invention is not limited to people
Eye carries out textures, the present disclosure applies equally to other positions of face, such as the textures of nose, mouth or eyebrow, herein not
It repeats.
Rotary unit, for being put down for the first time to this according to the rotational angle of critical object and the coordinate of rotary middle point
Coordinate after shifting is rotated, and postrotational coordinate is obtained.
It should be noted that the rotation angle of face can be calculated by the position of key point on face, for example, calculating
The angle of the bridge of the nose and horizontal direction X-axis, is no longer shown in detail calculation formula herein.Therefore, in order to guarantee postrotational coordinate with
The rotation angle of face is consistent and shape does not change, and the present embodiment passes through the rotation angle and rotation center according to face
The coordinate of point rotates the coordinate after first time translation to obtain.
Second translation unit, for the coordinate translation Aligning control coordinate by the coordinate of rotary middle point by the key point,
And the coordinate after scaling is translated according to the moving distance of rotary middle point, obtain the coordinate after translating second;And
Second unit for scaling scales back former ratio for the coordinate after translating described second, after obtaining the conversion
Coordinate.
In one embodiment, neighbouring Coordinate generation device includes:
Zoom factor obtains module, for the width of longitudinal length, textures width and image based on critical object, obtains
Zoom factor of the textures in x-axis is obtained, the height of longitudinal length, textures height and image based on critical object obtains textures
In the zoom factor of y-axis;
Attachment coordinate obtaining module, for for any one postrotational coordinate, defining the postrotational coordinate to be
The coordinate of (dstx, dsty), key point are (centerx, centery), when the postrotational coordinate meets the following conditions:
(centerx-resizex*0.5)<dstx≤(centerx
+ resizex*0.5) and (centery-resizey*0.5) < dsty≤(centery+resizey*0.5), then will
The postrotational coordinate is as a certain range of coordinate near the position after being located at key point movement.
In a specific embodiment, the textures sample coordinate obtains device and is further used for:
It is (near that definition, which is located at a certain range of coordinate near the position after key point movement,x,neary), textures sampling is sat
It is designated as (coordx,coordy), then:
coordx=(nearx-centerx+resizex*0.5)/resizex;
coordy=(neary-centery+resizey*0.5)/resizey。
In one embodiment, the present invention discloses a kind of computer program product, and the computer program product includes depositing
The computer program in non-transient computer readable storage medium is stored up, the computer program includes program instruction, when described
When program instruction is computer-executed, computer is able to carry out method provided by above-mentioned each method embodiment, for example,
S1, the position for positioning key point in critical object in image are right according to change in location of the key point after mobile
Any point on image carries out spin matrix conversion, the coordinate after obtaining the spin matrix conversion at the corresponding any point;
The zoom factor of S2, coordinate and textures according to key point after mobile, obtain be located at key point it is mobile after position
Neighbouring a certain range of coordinate;
S3, according to a certain range of coordinate near the position positioned at key point after mobile, key point coordinate and
The zoom factor of textures obtains textures sample coordinate, and shows textures in the textures sample coordinate.
In one embodiment, the invention discloses a kind of non-transient computer readable storage medium, the non-transient meters
Calculation machine readable storage medium storing program for executing stores computer instruction, and the computer instruction makes the computer execute above-mentioned each method embodiment
Provided method, for example,
S1, the position for positioning key point in critical object in image are right according to change in location of the key point after mobile
Any point on image carries out spin matrix conversion, the coordinate after obtaining the conversion at the corresponding any point;
The zoom factor of S2, coordinate and textures according to key point after mobile, obtain be located at key point it is mobile after position
Neighbouring a certain range of coordinate;
S3, according to a certain range of coordinate near the position positioned at key point after mobile, key point coordinate and
The zoom factor of textures obtains textures sample coordinate, and shows textures in the textures sample coordinate.
Finally, the present processes are only preferable embodiment, it is not intended to limit the scope of the present invention.It is all
Within the spirit and principles in the present invention, any modification, equivalent replacement, improvement and so on should be included in protection of the invention
Within the scope of.
Claims (6)
1. a kind of adaptive chart pasting method mobile with key point in image characterized by comprising
S1, the position for positioning key point in critical object in image, according to change in location of the key point after mobile, to image
On any point carry out spin matrix conversion, obtain the coordinate after spin matrix is converted at the corresponding any point;
The zoom factor of S2, coordinate and textures according to key point after mobile, obtain be located at key point it is mobile after position near
A certain range of coordinate;
S3, the coordinate and textures for being located at a certain range of coordinate near the position after key point moves, key point according to
Zoom factor, obtain textures sample coordinate, and show textures in the textures sample coordinate;
The step S2 further comprises:
S2.1, the longitudinal length based on critical object, textures width and image width, obtain textures in the scaling system of x-axis
Number, the height of longitudinal length, textures height and image based on critical object obtain textures in the zoom factor of y-axis;
S2.2, for any one coordinate after spin matrix is converted, the coordinate after defining spin matrix conversion is (dstx,
dsty), the coordinate of key point is (centerx,centery), when the postrotational coordinate meets the following conditions: (centerx-
resizex*0.5)<dstx≤(centerx+resizex* 0.5) and (centery–resizey*0.5)<dsty≤(centery+
resizey* 0.5), then using the coordinate after spin matrix conversion as a certain range near the position after being located at key point movement
Coordinate;
Wherein, zoom factor resize of the textures in x-axisxExpression formula are as follows: resizex=l*w/ (W*r);The textures
In the zoom factor resize of y-axisyExpression formula are as follows: resizey=l*h/ (H*r);
Wherein, l indicates that the longitudinal length of critical object, w indicate that the width of textures, h indicate the height of textures, and r indicates display system
Number, W indicate that the width of image, H indicate the height of image;
The coordinate and textures for being located at a certain range of coordinate near the position after key point moves, key point according to
Zoom factor, obtain textures sample coordinate the step of, further comprise:
It is (near that definition, which is located at a certain range of coordinate near the position after key point movement,x,neary), textures sample coordinate is
(coordx,coordy), then:
coordx=(nearx-centerx+resizex*0.5)/resizex;
coordy=(neary-centery+resizey*0.5)/resizey。
2. adaptive chart pasting method as described in claim 1, which is characterized in that the step S1 further comprises:
S1.1, the ratio of width to height for obtaining image position the position of key point in critical object in image;
S1.2, the rotational angle for obtaining the mobile distance of key point and critical object;And
S1.3, the ratio of width to height, the distance of key point movement and the rotational angle of critical object according to image, to appointing on image
Meaning a little carries out spin matrix conversion, the coordinate after obtaining the spin matrix conversion at the corresponding any point.
3. adaptive chart pasting method as claimed in claim 2, which is characterized in that the step S1.3 further comprises:
S1.3.1, any point on image zooms in and out the coordinate of the point, is scaled according to the ratio of width to height of image
Coordinate afterwards;
S1.3.2, the coordinate that the coordinate of rotary middle point is moved to the key point by origin, and according to key point
Moving distance translates the coordinate after scaling, obtains the coordinate after translating for the first time;
S1.3.3, the coordinate according to the rotational angle of critical object and the coordinate of rotary middle point, after being translated to the first time
It is rotated, obtains postrotational coordinate;
S1.3.4, by the coordinate of rotary middle point by the coordinate translation Aligning control coordinate of the key point, and according to rotation center
The moving distance of point translates the coordinate after scaling, obtains the coordinate after translating second;And
S1.3.5, the coordinate after second of translation is scaled into back former ratio, the coordinate after obtaining the conversion.
4. adaptive chart pasting method as claimed in claim 2, which is characterized in that the step S1.3 further comprises:
S1.3.1, for any point on image, the coordinate (x, y) of the point is converted into homogeneous coordinates (x, y, 1), based on figure
The ratio of width to height R of picture, zooms in and out the homogeneous coordinates, the coordinate (R*x, y, 1) after being scaled;
S1.3.2, the coordinate (D that the coordinate of rotary middle point is moved to the key point by origin (0,0)x,Dy), and root
The coordinate after scaling is translated according to the moving distance of key point, obtains the coordinate (R*x+D after translating for the first timex/R,y+Dy,
1);
S1.3.3, the coordinate according to the rotational angle a of critical object and the coordinate of rotary middle point, after being translated to the first time
It is rotated, obtains postrotational coordinate: ((R*x+Dx/R)*cosa-(y+Dy)*sina,(R*x+Dx/R)*sina-(y+Dy)*
cosa,1);
S1.3.4, by the coordinate of rotary middle point by the coordinate translation of the key point to origin, and according to rotation center
Point translation distance translates postrotational coordinate, obtains the coordinate after translating: ((R*x+D secondx/R)*cosa-(y+
Dy)*sina-Dx/R,(R*x+Dx/R)*sina-(y+Dy)*cosa-Dy,1);And
S1.3.5, the coordinate after second of translation is scaled into back former ratio, the coordinate after obtaining the conversion: ((x+Dx/
R2)*cosa-(y+Dy)*sina-Dx/R2,(x+Dx/R2)*sina-(y+Dy)*cosa-Dy)。
5. a kind of adaptive textures system mobile with key point in image characterized by comprising
Coordinate device is converted, the position of key point in critical object in image is positioned, according to position of the key point after mobile
Variation carries out spin matrix conversion to any point on image, after the spin matrix conversion for obtaining the corresponding any point
Coordinate;
Neighbouring Coordinate generation device obtains according to the zoom factor of coordinate and textures of the key point after mobile and is located at key point shifting
A certain range of coordinate near position after dynamic;
Textures sample coordinate obtains device, according to a certain range of coordinate, pass near the position positioned at key point after mobile
The coordinate of key point and the zoom factor of textures obtain textures sample coordinate, and show textures in the textures sample coordinate;
Coordinate generation device includes: near described
Zoom factor obtains module, for the width of longitudinal length, textures width and image based on critical object, is pasted
Zoom factor of the figure in x-axis, the height of longitudinal length, textures height and image based on critical object obtain textures in y-axis
Zoom factor;
Neighbouring coordinate obtaining module, be for for any one postrotational coordinate, defining the postrotational coordinate (dstx,
Dsty), the coordinate of key point is (centerx, centery), when the postrotational coordinate meets the following conditions: (centerx-
Resizex*0.5) < dstx≤(centerx+resizex*0.5) and (centery-resizey*0.5) < dsty≤
(centery+resizey*0.5), then using the postrotational coordinate as certain model near the position after being located at key point movement
The coordinate enclosed;
Wherein, zoom factor resize of the textures in x-axisxExpression formula are as follows: resizex=l*w/ (W*r);The textures
In the zoom factor resize of y-axisyExpression formula are as follows: resizey=l*h/ (H*r);
Wherein, l indicates that the longitudinal length of critical object, w indicate that the width of textures, h indicate the height of textures, and r indicates display system
Number, W indicate that the width of image, H indicate the height of image;
The textures sample coordinate obtains device and is further used for:
It is (near that definition, which is located at a certain range of coordinate near the position after key point movement,x,neary), textures sample coordinate is
(coordx,coordy), then:
coordx=(nearx-centerx+resizex*0.5)/resizex;
coordy=(neary-centery+resizey*0.5)/resizey。
6. the adaptive textures system as described in claim 5, which is characterized in that the conversion coordinate device includes:
Locating module positions the position of key point in critical object in image for obtaining the ratio of width to height of image;
Obtain key point parameter module, the rotational angle for obtaining the mobile distance of key point and critical object;And
Conversion module, the rotational angle of the distance and critical object mobile for the ratio of width to height, the key point according to image, to figure
Coordinate as upper any point progress spin matrix conversion, after obtaining the conversion at the corresponding any point.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710193044.4A CN107122774B (en) | 2017-03-28 | 2017-03-28 | A kind of adaptive chart pasting method and system mobile with key point in image |
PCT/CN2017/120135 WO2018176958A1 (en) | 2017-03-28 | 2017-12-29 | Adaptive mapping method and system depending on movement of key points in image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710193044.4A CN107122774B (en) | 2017-03-28 | 2017-03-28 | A kind of adaptive chart pasting method and system mobile with key point in image |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107122774A CN107122774A (en) | 2017-09-01 |
CN107122774B true CN107122774B (en) | 2019-12-03 |
Family
ID=59717365
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710193044.4A Active CN107122774B (en) | 2017-03-28 | 2017-03-28 | A kind of adaptive chart pasting method and system mobile with key point in image |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107122774B (en) |
WO (1) | WO2018176958A1 (en) |
Families Citing this family (21)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107122774B (en) * | 2017-03-28 | 2019-12-03 | 武汉斗鱼网络科技有限公司 | A kind of adaptive chart pasting method and system mobile with key point in image |
CN109509140A (en) * | 2017-09-15 | 2019-03-22 | 阿里巴巴集团控股有限公司 | Display methods and device |
CN109587390B (en) * | 2017-09-29 | 2021-05-07 | 腾讯科技(深圳)有限公司 | Picture rendering method, picture rendering device and storage medium |
CN107679497B (en) * | 2017-10-11 | 2023-06-27 | 山东新睿信息科技有限公司 | Video face mapping special effect processing method and generating system |
CN107808372B (en) * | 2017-11-02 | 2022-01-28 | 北京奇虎科技有限公司 | Image crossing processing method and device, computing equipment and computer storage medium |
CN108205822B (en) * | 2017-12-13 | 2020-09-08 | 中兴通讯股份有限公司 | Picture pasting method and device |
CN108305212A (en) * | 2018-01-09 | 2018-07-20 | 武汉斗鱼网络科技有限公司 | Image mixing method, storage medium, electronic equipment and system |
CN110020577B (en) * | 2018-01-10 | 2021-03-16 | 武汉斗鱼网络科技有限公司 | Face key point expansion calculation method, storage medium, electronic device and system |
CN108921000B (en) * | 2018-04-16 | 2024-02-06 | 深圳市深网视界科技有限公司 | Head angle labeling, prediction model training, prediction method, device and medium |
CN108846878A (en) * | 2018-06-07 | 2018-11-20 | 奇酷互联网络科技(深圳)有限公司 | Face textures generation method, device, readable storage medium storing program for executing and mobile terminal |
CN110378991A (en) * | 2018-11-07 | 2019-10-25 | 深圳格调网络运营有限公司 | The matching process of virtual environment drag and textures |
CN109614059B (en) * | 2018-12-19 | 2023-01-10 | 森大(深圳)技术有限公司 | Gerber file processing method and device and computer readable storage medium |
CN109819316B (en) * | 2018-12-28 | 2021-06-01 | 北京字节跳动网络技术有限公司 | Method and device for processing face sticker in video, storage medium and electronic equipment |
CN111383170B (en) * | 2018-12-28 | 2023-08-15 | 广州市百果园网络科技有限公司 | Picture key point adjusting method, device and terminal |
CN111126344B (en) * | 2019-12-31 | 2023-08-01 | 杭州趣维科技有限公司 | Method and system for generating key points of forehead of human face |
CN111652918B (en) * | 2020-06-04 | 2023-08-18 | 深圳地平线机器人科技有限公司 | Method, device, medium and electronic equipment for determining 3D face model |
CN114119684B (en) * | 2020-08-31 | 2023-02-28 | 中国移动通信集团浙江有限公司 | Marker point registration method based on tetrahedral structure |
CN112489157B (en) * | 2020-12-18 | 2024-03-19 | 广州视源电子科技股份有限公司 | Photo frame drawing method, device and storage medium |
CN113487717B (en) * | 2021-07-13 | 2024-02-23 | 网易(杭州)网络有限公司 | Picture processing method and device, computer readable storage medium and electronic equipment |
CN113687823B (en) * | 2021-07-30 | 2023-08-01 | 稿定(厦门)科技有限公司 | Quadrilateral block nonlinear transformation method and system based on HTML |
CN114429666B (en) * | 2022-04-06 | 2022-07-01 | 深圳市大头兄弟科技有限公司 | Video face replacement method, device, equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101231658A (en) * | 2008-02-02 | 2008-07-30 | 谢亦玲 | Ornaments computer simulation wearing apparatus |
CN104881114A (en) * | 2015-05-13 | 2015-09-02 | 深圳彼爱其视觉科技有限公司 | Angle rotation real-time matching method based on try wearing of 3D (three dimensional) glasses |
CN105069745A (en) * | 2015-08-14 | 2015-11-18 | 济南中景电子科技有限公司 | face-changing system based on common image sensor and enhanced augmented reality technology and method |
CN105354876A (en) * | 2015-10-20 | 2016-02-24 | 何家颖 | Mobile terminal based real-time 3D fitting method |
WO2016086893A1 (en) * | 2014-12-04 | 2016-06-09 | 高德软件有限公司 | Method and device for displaying electronic map |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8879801B2 (en) * | 2011-10-03 | 2014-11-04 | Qualcomm Incorporated | Image-based head position tracking method and system |
CN103090875A (en) * | 2012-11-26 | 2013-05-08 | 华南理工大学 | Real-time real-scene matching vehicle navigation method and device based on double cameras |
CN104898832B (en) * | 2015-05-13 | 2020-06-09 | 深圳彼爱其视觉科技有限公司 | Intelligent terminal-based 3D real-time glasses try-on method |
CN104899917B (en) * | 2015-05-13 | 2019-06-18 | 深圳彼爱其视觉科技有限公司 | A kind of picture that the article based on 3D is virtually dressed saves and sharing method |
CN104881526B (en) * | 2015-05-13 | 2020-09-01 | 深圳彼爱其视觉科技有限公司 | Article wearing method based on 3D and glasses try-on method |
CN107122774B (en) * | 2017-03-28 | 2019-12-03 | 武汉斗鱼网络科技有限公司 | A kind of adaptive chart pasting method and system mobile with key point in image |
-
2017
- 2017-03-28 CN CN201710193044.4A patent/CN107122774B/en active Active
- 2017-12-29 WO PCT/CN2017/120135 patent/WO2018176958A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101231658A (en) * | 2008-02-02 | 2008-07-30 | 谢亦玲 | Ornaments computer simulation wearing apparatus |
WO2016086893A1 (en) * | 2014-12-04 | 2016-06-09 | 高德软件有限公司 | Method and device for displaying electronic map |
CN104881114A (en) * | 2015-05-13 | 2015-09-02 | 深圳彼爱其视觉科技有限公司 | Angle rotation real-time matching method based on try wearing of 3D (three dimensional) glasses |
CN105069745A (en) * | 2015-08-14 | 2015-11-18 | 济南中景电子科技有限公司 | face-changing system based on common image sensor and enhanced augmented reality technology and method |
CN105354876A (en) * | 2015-10-20 | 2016-02-24 | 何家颖 | Mobile terminal based real-time 3D fitting method |
Also Published As
Publication number | Publication date |
---|---|
WO2018176958A1 (en) | 2018-10-04 |
CN107122774A (en) | 2017-09-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107122774B (en) | A kind of adaptive chart pasting method and system mobile with key point in image | |
CN107646126B (en) | Camera pose estimation for mobile devices | |
US8730323B2 (en) | Image converter | |
US20170363949A1 (en) | Multi-tier camera rig for stereoscopic image capture | |
CN102968809B (en) | The method of virtual information mark and drafting marking line is realized in augmented reality field | |
EP3304897A1 (en) | Capture and render of panoramic virtual reality content | |
CN103838437A (en) | Touch positioning control method based on projection image | |
WO2018035347A1 (en) | Multi-tier camera rig for stereoscopic image capture | |
Li et al. | A geodesic-preserving method for image warping | |
CN107563959B (en) | Panorama generation method and device | |
CN106997579A (en) | The method and apparatus of image mosaic | |
CN103413339B (en) | 1000000000 pixel high dynamic range images are rebuild and the method for display | |
CN103918003A (en) | Image processing device, method, and program | |
JP2015079354A (en) | Three-dimensional map display system using virtual reality | |
JP5847610B2 (en) | Computer graphics image processing system and method using AR technology | |
CN116932119B (en) | Virtual screen display method, device, equipment and computer readable storage medium | |
CN107958491B (en) | Matching method of mobile augmented reality virtual coordinates and construction site coordinates | |
CN112927163A (en) | Image data enhancement method and device, electronic equipment and storage medium | |
CN113496506A (en) | Image processing method, device, equipment and storage medium | |
CN113724141B (en) | Image correction method and device and electronic equipment | |
CN108830928A (en) | Mapping method, device, terminal device and the readable storage medium storing program for executing of threedimensional model | |
CN108171802B (en) | Panoramic augmented reality implementation method realized by combining cloud and terminal | |
CN114596198A (en) | Image processing method, device, equipment and storage medium | |
CN112258435A (en) | Image processing method and related product | |
Au et al. | Ztitch: A mobile phone application for immersive panorama creation, navigation, and social sharing |
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 |