CN107122774A - A kind of adaptive chart pasting method moved with key point in image and system - Google Patents

A kind of adaptive chart pasting method moved with key point in image and system Download PDF

Info

Publication number
CN107122774A
CN107122774A CN201710193044.4A CN201710193044A CN107122774A CN 107122774 A CN107122774 A CN 107122774A CN 201710193044 A CN201710193044 A CN 201710193044A CN 107122774 A CN107122774 A CN 107122774A
Authority
CN
China
Prior art keywords
coordinate
textures
key point
point
image
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.)
Granted
Application number
CN201710193044.4A
Other languages
Chinese (zh)
Other versions
CN107122774B (en
Inventor
李亮
陈少杰
张文明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710193044.4A priority Critical patent/CN107122774B/en
Publication of CN107122774A publication Critical patent/CN107122774A/en
Priority to PCT/CN2017/120135 priority patent/WO2018176958A1/en
Application granted granted Critical
Publication of CN107122774B publication Critical patent/CN107122774B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/20Linear translation of whole images or parts thereof, e.g. panning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/60Rotation of whole images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/24Indexing scheme for image data processing or generation, in general involving graphical user interfaces [GUIs]

Landscapes

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

Abstract

The present invention provides a kind of adaptive chart pasting method moved with key point in image and system, and wherein method includes:Position the position of key point in critical object in image, the change in location after being moved according to the key point carries out spin matrix conversion spin matrix conversion to any point on image, obtain to should be after the spin matrix conversion at any point coordinate;The zoom factor of coordinate and textures after being moved according to key point, obtains and is located at a range of coordinate near the position after key point is moved;According to the zoom factor of a range of coordinate, the coordinate of key point and textures near the position after the movement positioned at key point, textures sample coordinate is obtained, and textures are shown in the textures sample coordinate.In the case of being rotated in face, textures are adaptively rotated, and do not change original displaying ratio, improve the experience of user.

Description

A kind of adaptive chart pasting method moved with key point in image and system
Technical field
The present invention relates to image processing field, more particularly, to the adaptive textures side moved with key point in image Method and system.
Background technology
With camera work and the development of 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 ad-hoc location in picture by nose or face, existing chart pasting method, when ad-hoc location becomes During change, although the position of textures also changes therewith, but because the displaying ratio for not accounting for ad-hoc location is changed, cause A certain degree of distortion can occur for the shape of textures so that the display effect of textures is had a greatly reduced quality.
The content of the invention
The present invention provide it is a kind of overcome above mentioned problem or solve the above problems at least in part with key point in image The method and system of mobile adaptive textures.
There is provided a kind of method of the adaptive textures moved with key point in image, bag according to an aspect of the present invention Include:
S1, the position for positioning key point in critical object in image, the change in location after being moved according to the key point are right Any point on image carries out spin matrix conversion, obtain to should be after the spin matrix conversion at any point coordinate;
S2, moved according to key point after coordinate and textures zoom factor, obtain be located at key point move after position Neighbouring a range of coordinate;
S3, according to it is described positioned at key point move after position near a range of coordinate, the coordinate of key point and The zoom factor of textures, obtains textures sample coordinate, and show textures in the textures sample coordinate.
There is provided a kind of adaptive textures system moved with key point in image, bag according to another aspect of the present invention Include:
The position of key point in critical object in coordinate device, positioning image is changed, after being moved according to the key point Change in location, on image any point carry out spin matrix conversion, obtain to should any point spin matrix change Coordinate afterwards;
Neighbouring Coordinate generation device, the zoom factor of coordinate and textures after being moved according to key point obtains and is located at key A range of coordinate near position after point is mobile;
Textures sample coordinate obtains device, is sat according to a range of near the position after the movement positioned at key point The zoom factor of mark, the coordinate of key point and textures, obtains textures sample coordinate, and shown in the textures sample coordinate Textures.
The application proposes a kind of adaptive chart pasting method moved with key point in image and system, by positioning in image The position of key point in critical object, the change in location after being moved according to the key point is carried out to any point on image Spin matrix is changed, and obtains the coordinate after being changed to the spin matrix that should be put, it is ensured that the point on image is all with the position of key point Put and change and synchronizing moving, the zoom factor of coordinate and textures after being moved further according to key point, screening is located at key point movement A range of coordinate near position afterwards, finally with reference to the coordinate and the zoom factor of textures of key point, obtains display patch The textures sample coordinate of figure, in the case that key point is moved on image, textures are adaptively moved, and And do not change original displaying ratio, improve the experience of user.
Brief description of the drawings
Fig. 1 is a kind of flow chart of adaptive chart pasting method moved with key point in image of the embodiment of the present invention;
The flow chart that Fig. 2 is step S1 in the embodiment of the present invention;
The schematic flow sheet that Fig. 3 is step S2 in the embodiment of the present invention;
Fig. 4 is a kind of block diagram of adaptive textures system moved with key point in image of the embodiment of the present invention;
Fig. 5 is the structured flowchart of modular converter in the embodiment of the present invention.
Embodiment
With reference to the accompanying drawings and examples, the embodiment to the present invention is described in further detail.Implement below Example is used to illustrate the present invention, but is not limited to the scope of the present invention.
In order to overcome in the prior art, the problem of textures can not adaptively rotate with the rotation of face, the present invention is provided A kind of chart pasting method for the adaptive rotation that can be rotated with face.
Fig. 1 shows a kind of flow chart of adaptive chart pasting method rotated with face of the embodiment of the present invention, and such as Fig. 1 can Know, this method includes:
S1, the position for positioning key point in critical object in image, the change in location after being moved according to the key point are right Any point on image carries out spin matrix conversion, obtain to should be after the spin matrix conversion at any point coordinate;
S2, moved according to key point after coordinate and textures zoom factor, obtain be located at key point move after position Neighbouring a range of coordinate;
S3, according to it is described positioned at key point move after position near a range of coordinate, the coordinate of key point and The zoom factor of textures, obtains textures sample coordinate, and show textures in the textures sample coordinate.
The application proposes a kind of adaptive chart pasting method moved with key point in image and system, by positioning in image The position of key point in critical object, the change in location after being moved according to the key point is carried out to any point on image Spin matrix is changed, and is obtained to the coordinate after the conversion that should put, the scaling of coordinate and textures after being moved further according to key point Coefficient, screening is located at a range of coordinate near the position after key point is moved, finally with reference to the coordinate and patch of key point The zoom factor of figure, obtains the textures sample coordinate for showing textures, in the case that key point is moved on image, Textures are adaptively moved, and do not change original displaying ratio, improve the experience of user.
Fig. 2 shows the flow chart of step S1 in the embodiment of the present invention, including:
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 because the shape of normal image is rectangle, the ratio of width to height of such as most of video is 16:9、 4:3、2:1, it therefore, when the coordinate on image is rotated, will necessarily be distorted, most significantly there is mobile phone viewing to regard During frequency, mobile phone is under transverse screen mode or under portrait layout model, and the width of word is different on captions, therefore, in order to ensure textures in rotation During shape keep it is constant, the present embodiment consider the ratio of width to height based on image the coordinate at any point is zoomed in and out.
S1.2, the distance for obtaining key point movement and critical object rotational angle.
Distance and the rotational angle of critical object that S1.3, the ratio of width to height according to image, key point are moved, on image Any point carry out spin matrix conversion, obtain to should any point spin matrix conversion after coordinate.
It should be noted that the coordinate of image is referred to as into world coordinate system, by moveable critical object institute in image Coordinate system be referred to as object coordinates system, although textures are in the coordinate system of image, textures follow object to transport all the time again It is dynamic, contacted equivalent to having with the coordinate system of object, therefore in order to ensure that the rotation of textures adapts to the conversion between two coordinate systems, The rotational angle of the ratio of width to height according to image, the distance of key point movement and critical object is needed, to any one on image Point carries out spin matrix conversion.
For the critical object made in the clear understandable consideration of description, following examples by taking face as an example, but it is not used to Limit the scope of the present invention.
In one embodiment, step S1.3 further comprises:
S1.3.1, to any point on image, according to the ratio of width to height of image, the coordinate of the point is zoomed in and out, obtain 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 displacement of point is translated to the coordinate after scaling, obtains the coordinate after translating for the first time.
If it should be noted that a D graphics are after certain point O rotation alpha °, obtained new figure is weighed completely with artwork shape Close, O is called the rotary middle point of D graphics.In ensureing that textures can be rotated with some ad-hoc location, it is necessary to will rotate The heart moves to ad-hoc location, to ensure that postrotational image and original image are completely superposed, under the application scenarios of the present invention, rotation Central point is key point, so-called key point, briefly, is exactly the point that textures need to align all the time, with the eyes of people Exemplified by upper carry out textures, key point can be the central point (assuming that this point is the coordinate of 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 the movement of face in image, equally with it is above-mentioned for example, just It is the coordinate of pupil after face is moved.Certainly, the invention is not limited in textures are carried out to human eye, the present disclosure applies equally to right Other positions of face, such as textures of nose, face or eyebrow, will not be described here.
S1.3.3, the rotational angle according to critical object and rotary middle point coordinate, after being translated for the first time to this Coordinate is rotated, and obtains postrotational coordinate.
It should be noted that the anglec of rotation of face can be calculated by the position of key point on face, for example, calculating The bridge of the nose and the angle of horizontal direction X-axis, are no longer shown in detail calculation formula herein.Therefore, in order to ensure postrotational coordinate with The anglec of rotation of face is consistent and shape does not change, and the present embodiment passes through the anglec of rotation and pivot according to face The coordinate of point, the coordinate after being translated to the first time is rotated to obtain.
S1.3.4, by the coordinate of rotary middle point by the key point coordinate translation Aligning control coordinate, and according to rotation The displacement of central point is translated to the coordinate after scaling, obtains the coordinate after second of translation.
S1.3.5, described second is translated after coordinate scale back original ratio, the coordinate after the acquisition conversion.
It should be noted that after second of translation is completed, coordinate being scaled into former ratio, that is, realizes the correct of textures 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, the homogeneous coordinates are zoomed in and out, the coordinate (R*x, y, 1) after being scaled.
It should be noted, homogeneous coordinates are exactly to represent the vector that a script is n dimensions with a n+1 dimensional vector.Example Such as, the homogeneous coordinates of two-dimensional points (x, y) be expressed as (hx, hy, h).It can thus be seen that a vectorial homogeneous expression is not only What one, the h of homogeneous coordinates took that different values all represent is same point, such as homogeneous coordinates (8,4,2), (4,2,1) are represented Be all two-dimensional points (4,2).It is introduced into the purpose of homogeneous coordinates and is mainly the multiplication and addition merged in matrix operation, is expressed as p' =p*M form.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 is expressed as:
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 displacement of key point, obtain the coordinate (R*x+D after translating for the first timex/R, y+Dy,1)。
It should be noted that in two-dimensional coordinate, the coordinate of former rotary middle point is origin (0,0), it is assumed that translation Coordinate afterwards is (Dx,Dy), sx unit is shifted in x-axis direction, sy unit is shifted in y-axis direction, defining [x, y] is Coordinate before conversion, [X, Y] is coordinate after conversion.Then:X=x+sx;Y=y+sy;Represented with matrix:
It is applied in the present embodiment, the coordinate matrix M after translating for the first time2It is expressed as:
S1.3.3, rotational angle a and the coordinate of rotary middle point according to critical object, after being translated for the first time to this Coordinate is rotated, and obtains postrotational coordinate:((R*x+Dx/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 is R with the wire length.[x, y] is coordinate before conversion, and [X, Y] is coordinate after conversion.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);
Represented with matrix:
It is applied in the present embodiment, postrotational coordinate matrix M3It is expressed as:
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 is translated to postrotational coordinate, obtains the coordinate after second of translation:((R*x+Dx/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 is expressed as:
S1.3.5, described second is translated after coordinate scale back original ratio, the coordinate after the acquisition 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 expressed as with matrix M5:
Fig. 3 shows the schematic flow sheet of step S2 in the embodiment of the present invention, as shown in Figure 3, and step S2 includes:
S2.1, the longitudinal length based on critical object, the width of textures width and image, obtain contracting of the textures in x-axis Coefficient is put, the height of the longitudinal length based on critical object, textures height and image obtains zoom factor of the textures in y-axis;
S2.2, for any one spin matrix change 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 following condition: (centerx-resizex*0.5)<dstx≤(centerx+resizex* 0.5) and (centery–resizey*0.5)<dsty≤ (centery+resizey* 0.5) coordinate after, then the spin matrix is changed is near the position as after being moved positioned at key point A range of coordinate.
In one alternate embodiment, zoom factor resize of the textures in x-axisxExpression formula be:resizex=l*w/ (W*r);Zoom factor resize of the textures in y-axisyExpression formula be:resizey=l*h/ (H*r);
Wherein, l represents the length of the longitudinal length of critical object, the length of such as face, and w represents the width of textures, h tables Show the height of textures, r represents to show coefficient, and W represents the width of image, and H represents the height of image.
In one alternate embodiment, according to it is described positioned at key point move after position near a range of coordinate, The coordinate of key point and the zoom factor of textures, the step of obtaining textures sample coordinate, further comprise:
It is (near that definition, which is located at a range of coordinate near the position after key point is moved,x,neary), crucial point coordinates 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 moved with key point in image of the embodiment of the present invention, Including:
The position of key point in critical object in coordinate device, positioning image is changed, after being moved according to the key point Change in location, on image any point carry out spin matrix conversion, obtain to should any point spin matrix change Coordinate afterwards;
Neighbouring Coordinate generation device, the zoom factor of coordinate and textures after being moved according to key point obtains and is located at key A range of coordinate near position after point is mobile;
Textures sample coordinate obtains device, is sat according to a range of near the position after the movement positioned at key point The zoom factor of mark, the coordinate of key point and textures, obtains textures sample coordinate, and shown in the textures sample coordinate Textures.
It should be noted that the present embodiment is by positioning the position of key point in critical object in image, closed according to described Change in location after the movement of key point, carries out spin matrix conversion to any point on image, obtains the spin moment to that should put Coordinate after battle array conversion, it is ensured that point on the image synchronizing moving all with the change in location of key point, is moved further according to key point Coordinate and the zoom factor of textures afterwards, screening are located at a range of coordinate near the position after key point is moved, and finally tie The coordinate of key point and the zoom factor of textures are closed, the textures sample coordinate for showing textures is obtained, the invention enables in image In the case of upper key point movement, textures are adaptively moved, and do not change original displaying ratio, improve user Experience.
In one embodiment, conversion coordinate device includes:
Locating module, the ratio of width to height for obtaining image positions the position of key point in critical object in image;
It should be noted that because the shape of normal image is rectangle, the ratio of width to height of such as most of video is 16:9、 4:3、2:1, it therefore, when the coordinate on image is rotated, will necessarily be distorted, most significantly there is mobile phone viewing to regard During frequency, mobile phone is under transverse screen mode or under portrait layout model, and the width of word is different on captions, therefore, in order to ensure textures in rotation During shape keep it is constant, the present embodiment consider the ratio of width to height based on textures the coordinate at any point is zoomed in and out.
Obtain the rotational angle of key point parameter module, the distance for obtaining key point movement and critical object;With And
Modular converter, for the rotational angle of the ratio of width to height according to image, the distance that key point is moved and critical object, Spin matrix conversion is carried out to any point on image, obtain to should be after the conversion at any point coordinate.
It should be noted that the coordinate of image is referred to as into world coordinate system, by moveable critical object institute in image Coordinate system be referred to as object coordinates system, although textures are in the coordinate system of image, textures follow object to transport all the time again It is dynamic, contacted equivalent to having with the coordinate system of object, therefore in order to ensure that the rotation of textures adapts to the conversion between two coordinate systems, The rotational angle of the ratio of width to height according to image, the distance of key point movement and critical object is needed, to any one on image Point carries out spin matrix conversion.
Fig. 5 shows the structured flowchart of modular converter in the embodiment of the present invention, including:
First unit for scaling, for any point on image, according to the ratio of width to height of image, being carried out to the coordinate of the point Scaling, the coordinate after being scaled.
First translation unit, the coordinate for the coordinate of rotary middle point to be moved to the key point by origin, And the coordinate after scaling is translated according to the displacement of key point, obtain the coordinate after translating for the first time.
If it should be noted that a D graphics are after certain point O rotation alpha °, obtained new figure is weighed completely with artwork shape Close, D is called rotationally symmetrical figure, and O is called the rotary middle point of rotationally symmetrical D graphics.In order to ensure that textures can be special with some Positioning, which is put, to be rotated, it is necessary to pivot be moved into ad-hoc location, to ensure that postrotational image is weighed completely with original image Close, under the application scenarios of the present invention, rotary middle point is key point, so-called key point, briefly, be exactly that textures are needed All the time the point to align, exemplified by 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 this point is the coordinate of pupil).Obviously, rotary middle point described in the present embodiment refers in image after face movement Key point, equally with it is above-mentioned for example, be exactly face movement after pupil coordinate.Certainly, the invention is not limited in people Eye carries out textures, the present disclosure applies equally to other positions of face, such as textures of nose, face or eyebrow, herein not Repeat.
Rotary unit is flat for the first time to this for the rotational angle and the coordinate of rotary middle point according to critical object Coordinate after shifting is rotated, and obtains postrotational coordinate.
It should be noted that the anglec of rotation of face can be calculated by the position of key point on face, for example, calculating The bridge of the nose and the angle of horizontal direction X-axis, are no longer shown in detail calculation formula herein.Therefore, in order to ensure postrotational coordinate with The anglec of rotation of face is consistent and shape does not change, and the present embodiment passes through the anglec of rotation and pivot according to face The coordinate of point, the coordinate after being translated to the first time is rotated to obtain.
Second translation unit, for by the coordinate of rotary middle point by the key point coordinate translation Aligning control coordinate, And the coordinate after scaling is translated according to the displacement of rotary middle point, obtain the coordinate after second of translation;And
Second unit for scaling, for the coordinate after second of translation to be scaled back into former ratio, is obtained after the conversion Coordinate.
In one embodiment, neighbouring Coordinate generation device includes:
Zoom factor acquisition module, for the width of the longitudinal length based on critical object, textures width and image, is obtained Zoom factor of the textures in x-axis is obtained, the height of the longitudinal length based on critical object, textures height and image obtains textures In the zoom factor of y-axis;
Annex 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 following condition: (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 used as a range of coordinate near the position after being moved positioned at key point.
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 range of coordinate near the position after key point is moved,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 on non-transient computer readable storage medium storing program for executing is stored up, the computer program includes programmed instruction, when described When programmed instruction is computer-executed, computer is able to carry out the method that above-mentioned each method embodiment is provided, for example including:
S1, the position for positioning key point in critical object in image, the change in location after being moved according to the key point are right Any point on image carries out spin matrix conversion, obtain to should be after the spin matrix conversion at any point coordinate;
S2, moved according to key point after coordinate and textures zoom factor, obtain be located at key point move after position Neighbouring a range of coordinate;
S3, according to it is described positioned at key point move after position near a range of coordinate, the coordinate of key point and The zoom factor of textures, obtains textures sample coordinate, and show textures in the textures sample coordinate.
In one embodiment, the invention discloses a kind of non-transient computer readable storage medium storing program for executing, the non-transient meter Calculation machine readable storage medium storing program for executing stores computer instruction, and the computer instruction makes the computer perform above-mentioned each method embodiment The method provided, for example including:
S1, the position for positioning key point in critical object in image, the change in location after being moved according to the key point are right Any point on image carries out spin matrix conversion, obtain to should be after the conversion at any point coordinate;
S2, moved according to key point after coordinate and textures zoom factor, obtain be located at key point move after position Neighbouring a range of coordinate;
S3, according to it is described positioned at key point move after position near a range of coordinate, the coordinate of key point and The zoom factor of textures, obtains textures sample coordinate, and show textures in the textures sample coordinate.
Finally, the present processes are only preferably embodiment, are 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 substitution and improvements made etc. should be included in the protection of the present invention Within the scope of.

Claims (10)

1. a kind of adaptive chart pasting method moved with key point in image, it is characterised in that including:
S1, the position for positioning key point in critical object in image, the change in location after being moved according to the key point, to image On any point carry out spin matrix conversion, obtain to should be after the rotated matrix conversion at any point coordinate;
S2, moved according to key point after coordinate and textures zoom factor, obtain be located at key point move after position near A range of coordinate;
A range of coordinate, the coordinate and textures of key point near position after the movement positioned at key point of S3, basis Zoom factor, obtain textures sample coordinate, and show textures in the textures sample coordinate.
2. adaptive chart pasting method as claimed in claim 1, it is characterised 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 distance for obtaining key point movement and critical object rotational angle;And
Distance and the rotational angle of critical object that S1.3, the ratio of width to height according to image, key point are moved, to appointing on image Meaning a little carry out spin matrix conversion, obtain to should any point spin matrix conversion after coordinate.
3. adaptive chart pasting method as claimed in claim 2, it is characterised in that the step S1.3 further comprises:
S1.3.1, to any point on image, according to the ratio of width to height of image, the coordinate of the point is zoomed in and out, scaled 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 Displacement is translated to the coordinate after scaling, obtains the coordinate after translating for the first time;
S1.3.3, the rotational angle according to critical object and rotary middle point coordinate, to the coordinate after translating for the first time Rotated, obtain postrotational coordinate;
S1.3.4, by the coordinate of rotary middle point by the key point coordinate translation Aligning control coordinate, and according to pivot The displacement of point is translated to the coordinate after scaling, obtains the coordinate after second of translation;And
S1.3.5, described second is translated after coordinate scale back original ratio, the coordinate after the acquisition conversion.
4. adaptive chart pasting method as claimed in claim 2, it is characterised 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 homogeneous coordinates are zoomed in and out by the ratio of width to height R of picture, 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 displacement of key point, the coordinate (R*x+D after translating for the first time is obtainedx/R,y+Dy, 1);
S1.3.3, rotational angle a and the coordinate of rotary middle point according to critical object, to the coordinate after translating for the first time Rotated, obtain 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 pivot Point translation distance is translated to postrotational coordinate, obtains the coordinate after second of translation:((R*x+Dx/R)*cosa-(y+ Dy)*sina-Dx/R,(R*x+Dx/R)*sina-(y+Dy)*cosa-Dy,1);And
S1.3.5, described second is translated after coordinate scale back original ratio, the coordinate after the acquisition conversion:((x+Dx/ R2)*cosa-(y+Dy)*sina-Dx/R2,(x+Dx/R2)*sina-(y+Dy)*cosa-Dy)。
5. adaptive chart pasting method as claimed in claim 1, it is characterised in that the step S2 further comprises:
S2.1, the longitudinal length based on critical object, the width of textures width and image, obtain scaling system of the textures in x-axis Number, the height of the longitudinal length based on critical object, textures height and image obtains zoom factor of the textures in y-axis;
S2.2, for the coordinate after any one rotated matrix conversion, it is (dst to define the coordinate after spin matrix conversionx, dsty), the coordinate of key point is (centerx,centery), when the postrotational coordinate meets following condition:(centerx- resizex*0.5)<dstx≤(centerx+resizex* 0.5) and (centery–resizey*0.5)<dsty≤(centery+ resizey* 0.5) coordinate after, then the spin matrix is changed certain limit near position as after being moved positioned at key point Coordinate;
Wherein, zoom factor resize of the textures in x-axisxExpression formula be:resizex=l*w/ (W*r);The textures In the zoom factor resize of y-axisyExpression formula be:resizey=l*h/ (H*r);
Wherein, l represents the longitudinal length of critical object, and w represents the width of textures, and h represents the height of textures, and r represents display system Number, W represents the width of image, and H represents the height of image.
6. adaptive chart pasting method as claimed in claim 5, it is characterised in that be located at described in the basis after key point movement Position near a range of coordinate, the coordinate of key point and textures zoom factor, obtain textures sample coordinate step Suddenly, further comprise:
It is (near that definition, which is located at a range of coordinate near the position after key point is moved,x,neary), textures sample coordinate is (coordx,coordy), then:
coordx=(nearx-centerx+resizex*0.5)/resizex
coordy=(neary-centery+resizey*0.5)/resizey
7. a kind of adaptive textures system moved with key point in image, it is characterised in that including:
Change the position of key point in critical object in coordinate device, positioning image, the position after being moved according to the key point Change, on image any point carry out spin matrix conversion, obtain to should any point spin matrix conversion after Coordinate;
Neighbouring Coordinate generation device, the zoom factor of coordinate and textures after being moved according to key point obtains and is located at key point shifting A range of coordinate near position after dynamic;
Textures sample coordinate obtains device, according to a range of coordinate, pass near the position after the movement positioned at key point The coordinate of key point and the zoom factor of textures, obtain textures sample coordinate, and show textures in the textures sample coordinate.
8. adaptive textures system as claimed in claim 7, it is characterised in that the conversion coordinate device includes:
Locating module, the ratio of width to height for obtaining image positions the position of key point in critical object in image;
Obtain the rotational angle of key point parameter module, the distance for obtaining key point movement and critical object;And
Modular converter, for the rotational angle of the ratio of width to height according to image, the distance that key point is moved and critical object, to figure As upper any point carries out spin matrix conversion, obtain to should be after the conversion at any point coordinate.
9. adaptive textures system as claimed in claim 8, it is characterised in that the Coordinate generation device nearby includes:
Zoom factor acquisition module, for the width of the longitudinal length based on critical object, textures width and image, is pasted Figure obtains textures in y-axis in the zoom factor of x-axis, the height of the longitudinal length based on critical object, textures height and image Zoom factor;
Annex 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 following condition:(centerx- resizex*0.5)<Dstx≤(centerx+resizex*0.5) and (centery-resizey*0.5)<dsty≤ (centery+resizey*0.5), then using the postrotational coordinate certain model near the position as after being moved positioned at key point The coordinate enclosed.
10. adaptive textures system as claimed in claim 9, it is characterised in that the textures sample coordinate obtains device and entered One step is used for:
It is (near that definition, which is located at a range of coordinate near the position after key point is moved,x,neary), textures sample coordinate is (coordx,coordy), then:
coordx=(nearx-centerx+resizex*0.5)/resizex
coordy=(neary-centery+resizey*0.5)/resizey
CN201710193044.4A 2017-03-28 2017-03-28 A kind of adaptive chart pasting method and system mobile with key point in image Active CN107122774B (en)

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 true CN107122774A (en) 2017-09-01
CN107122774B 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)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107679497A (en) * 2017-10-11 2018-02-09 齐鲁工业大学 Video face textures effect processing method and generation system
CN107808372A (en) * 2017-11-02 2018-03-16 北京奇虎科技有限公司 Image penetration management method, apparatus, computing device and computer-readable storage medium
CN108205822A (en) * 2017-12-13 2018-06-26 中兴通讯股份有限公司 Chart pasting method and device
CN108305212A (en) * 2018-01-09 2018-07-20 武汉斗鱼网络科技有限公司 Image mixing method, storage medium, electronic equipment and system
WO2018176958A1 (en) * 2017-03-28 2018-10-04 武汉斗鱼网络科技有限公司 Adaptive mapping method and system depending on movement of key points in image
CN108921000A (en) * 2018-04-16 2018-11-30 深圳市深网视界科技有限公司 Head angle mark, prediction model training, prediction technique, equipment and medium
CN109509140A (en) * 2017-09-15 2019-03-22 阿里巴巴集团控股有限公司 Display methods and device
CN109587390A (en) * 2017-09-29 2019-04-05 腾讯科技(深圳)有限公司 Picture rendering method, picture rendering device and storage medium
CN109819316A (en) * 2018-12-28 2019-05-28 北京字节跳动网络技术有限公司 Handle method, apparatus, storage medium and the electronic equipment of face paster in video
CN110020577A (en) * 2018-01-10 2019-07-16 武汉斗鱼网络科技有限公司 Face key point extends calculation method, storage medium, electronic equipment and system
CN110378991A (en) * 2018-11-07 2019-10-25 深圳格调网络运营有限公司 The matching process of virtual environment drag and textures
WO2019233256A1 (en) * 2018-06-07 2019-12-12 奇酷互联网络科技(深圳)有限公司 Human face sticker generating method and apparatus, readable storage medium and mobile terminal
CN111383170A (en) * 2018-12-28 2020-07-07 广州市百果园网络科技有限公司 Method and device for adjusting picture key points and terminal
CN112489157A (en) * 2020-12-18 2021-03-12 广州视源电子科技股份有限公司 Photo frame drawing method, device and storage medium
CN113687823A (en) * 2021-07-30 2021-11-23 稿定(厦门)科技有限公司 Quadrilateral block nonlinear transformation method and system based on HTML (Hypertext markup language)
CN118154753A (en) * 2024-05-11 2024-06-07 中国铁路设计集团有限公司 Material mapping processing method in urban rail engineering BIM model
CN118154753B (en) * 2024-05-11 2024-07-05 中国铁路设计集团有限公司 Material mapping processing method in urban rail engineering BIM model

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614059B (en) * 2018-12-19 2023-01-10 森大(深圳)技术有限公司 Gerber file processing method and device and computer readable storage medium
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
CN113487717B (en) * 2021-07-13 2024-02-23 网易(杭州)网络有限公司 Picture processing method and device, computer readable storage medium and electronic equipment
CN114429666B (en) * 2022-04-06 2022-07-01 深圳市大头兄弟科技有限公司 Video face replacement method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
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

Cited By (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018176958A1 (en) * 2017-03-28 2018-10-04 武汉斗鱼网络科技有限公司 Adaptive mapping method and system depending on movement of key points 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
CN109587390A (en) * 2017-09-29 2019-04-05 腾讯科技(深圳)有限公司 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
CN107679497A (en) * 2017-10-11 2018-02-09 齐鲁工业大学 Video face textures effect processing method and generation system
CN107808372B (en) * 2017-11-02 2022-01-28 北京奇虎科技有限公司 Image crossing processing method and device, computing equipment and computer storage medium
CN107808372A (en) * 2017-11-02 2018-03-16 北京奇虎科技有限公司 Image penetration management method, apparatus, computing device and computer-readable storage medium
CN108205822B (en) * 2017-12-13 2020-09-08 中兴通讯股份有限公司 Picture pasting method and device
CN108205822A (en) * 2017-12-13 2018-06-26 中兴通讯股份有限公司 Chart 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
CN110020577A (en) * 2018-01-10 2019-07-16 武汉斗鱼网络科技有限公司 Face key point extends calculation method, storage medium, electronic equipment and system
CN108921000A (en) * 2018-04-16 2018-11-30 深圳市深网视界科技有限公司 Head angle mark, prediction model training, prediction technique, equipment and medium
CN108921000B (en) * 2018-04-16 2024-02-06 深圳市深网视界科技有限公司 Head angle labeling, prediction model training, prediction method, device and medium
WO2019233256A1 (en) * 2018-06-07 2019-12-12 奇酷互联网络科技(深圳)有限公司 Human face sticker generating method and apparatus, readable storage medium and mobile terminal
CN110378991A (en) * 2018-11-07 2019-10-25 深圳格调网络运营有限公司 The matching process of virtual environment drag and textures
CN111383170A (en) * 2018-12-28 2020-07-07 广州市百果园网络科技有限公司 Method and device for adjusting picture key points and terminal
CN109819316A (en) * 2018-12-28 2019-05-28 北京字节跳动网络技术有限公司 Handle method, apparatus, storage medium and the electronic equipment of face paster in video
CN111383170B (en) * 2018-12-28 2023-08-15 广州市百果园网络科技有限公司 Picture key point adjusting method, device and terminal
CN112489157A (en) * 2020-12-18 2021-03-12 广州视源电子科技股份有限公司 Photo frame drawing method, device and storage medium
CN112489157B (en) * 2020-12-18 2024-03-19 广州视源电子科技股份有限公司 Photo frame drawing method, device and storage medium
CN113687823A (en) * 2021-07-30 2021-11-23 稿定(厦门)科技有限公司 Quadrilateral block nonlinear transformation method and system based on HTML (Hypertext markup language)
CN113687823B (en) * 2021-07-30 2023-08-01 稿定(厦门)科技有限公司 Quadrilateral block nonlinear transformation method and system based on HTML
CN118154753A (en) * 2024-05-11 2024-06-07 中国铁路设计集团有限公司 Material mapping processing method in urban rail engineering BIM model
CN118154753B (en) * 2024-05-11 2024-07-05 中国铁路设计集团有限公司 Material mapping processing method in urban rail engineering BIM model

Also Published As

Publication number Publication date
WO2018176958A1 (en) 2018-10-04
CN107122774B (en) 2019-12-03

Similar Documents

Publication Publication Date Title
CN107122774A (en) A kind of adaptive chart pasting method moved with key point in image and system
US8730323B2 (en) Image converter
Zaragoza et al. As-projective-as-possible image stitching with moving DLT
US7839422B2 (en) Gradient-domain compositing
CN111401266B (en) Method, equipment, computer equipment and readable storage medium for positioning picture corner points
Li et al. A geodesic-preserving method for image warping
CN109829953A (en) Image collecting device scaling method, device, computer equipment and storage medium
CN107633526A (en) A kind of image trace point acquisition methods and equipment, storage medium
CN103838437A (en) Touch positioning control method based on projection image
JP6096634B2 (en) 3D map display system using virtual reality
Jung et al. Robust upright adjustment of 360 spherical panoramas
WO2014110954A1 (en) Method, device and computer-readable storage medium for panoramic image completion
WO2021012599A1 (en) Image adjustment method, apparatus, and computer device
CN106997579A (en) The method and apparatus of image mosaic
CN107103513A (en) A kind of virtual try-in method of glasses
CN107146197A (en) A kind of reduced graph generating method and device
CN115830135A (en) Image processing method and device and electronic equipment
CN116932119B (en) Virtual screen display method, device, equipment and computer readable storage medium
CN107545222A (en) The method and its system of display target image in virtual reality scenario
CN112927163A (en) Image data enhancement method and device, electronic equipment and storage medium
US8988466B2 (en) Panoramic image straightening
CN113724141B (en) Image correction method and device and electronic equipment
CN113610864B (en) Image processing method, device, electronic equipment and computer readable storage medium
Au et al. Ztitch: A mobile phone application for immersive panorama creation, navigation, and social sharing
CN114511448B (en) Method, device, equipment and medium for splicing images

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