CN109799984B - Face frame drawing method, device and equipment and computer readable storage medium - Google Patents

Face frame drawing method, device and equipment and computer readable storage medium Download PDF

Info

Publication number
CN109799984B
CN109799984B CN201910037927.5A CN201910037927A CN109799984B CN 109799984 B CN109799984 B CN 109799984B CN 201910037927 A CN201910037927 A CN 201910037927A CN 109799984 B CN109799984 B CN 109799984B
Authority
CN
China
Prior art keywords
face frame
picture
frame design
design draft
mobile terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910037927.5A
Other languages
Chinese (zh)
Other versions
CN109799984A (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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201910037927.5A priority Critical patent/CN109799984B/en
Publication of CN109799984A publication Critical patent/CN109799984A/en
Application granted granted Critical
Publication of CN109799984B publication Critical patent/CN109799984B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The invention discloses a face frame drawing method, which comprises the following steps: acquiring path data corresponding to the face frame design manuscript picture; analyzing the path data to obtain the central point and the size of the picture of the face frame design draft; calculating the translation distance of the center point translated to the center of the screen of the mobile terminal according to the center point of the face frame design draft picture; calculating the scaling of the face frame design draft picture when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal in an equal ratio according to a preset rule according to the size of the face frame design draft picture; and performing path self-drawing according to the path data, the translation distance and the scaling ratio to obtain a user-defined face frame control. The invention also discloses a face frame drawing device, equipment and a computer readable storage medium. The invention can solve the problems of high development and maintenance cost and large memory occupation of the conventional human face frame picture.

Description

Face frame drawing method, device and equipment and computer readable storage medium
Technical Field
The invention relates to the technical field of software, in particular to a face frame drawing method, a face frame drawing device, face frame drawing equipment and a computer readable storage medium.
Background
The face recognition technology is a biometric technology for performing identification based on facial feature information of a person. At present, in the process of face recognition of a terminal such as a mobile phone, a face frame is usually used to frame a user's face, and then the face in the face frame is recognized, where the face frame displayed by the terminal is actually a face frame picture pre-integrated in an SDK (Software Development Kit).
Because the SDK using the face frame is an external product, different external partners have different requirements on the color and the style of the face frame, in order to meet the requirements of different external partners APP on the face frame picture, developers often integrate the face frame pictures with various colors and styles to be published in the SDK, and in order to ensure the compatibility with the external partners APP, compatible resources are added in the SDK, on one hand, the development and maintenance cost of the SDK package is extremely high, on the other hand, the SDK package is too large, so that the mobile phone memory is occupied, the operation effect of the middle-low-end mobile phone is poor, the mobile phone can be blocked and consumes power.
Disclosure of Invention
The invention mainly aims to provide a face frame drawing method, a face frame drawing device, face frame drawing equipment and a computer readable storage medium, and aims to solve the problems that the existing face frame picture is high in development and maintenance cost and large in occupied memory.
In order to achieve the above object, the present invention provides a face frame drawing method, which comprises the following steps:
acquiring path data corresponding to the face frame design manuscript picture;
analyzing the path data to obtain the central point and the size of the picture of the face frame design draft;
calculating the translation distance of the center point translated to the center of the screen of the mobile terminal according to the center point of the face frame design draft picture;
calculating the scaling of the face frame design draft picture when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal in an equal ratio according to a preset rule according to the size of the face frame design draft picture;
and performing path self-drawing according to the path data, the translation distance and the scaling ratio to obtain a user-defined face frame control.
Preferably, the step of obtaining the path data corresponding to the face frame design draft picture includes:
acquiring a face frame design draft picture;
converting the face frame design draft picture into a Scalable Vector Graphics (SVG) picture, and converting the SVG picture into a corresponding configuration file;
and analyzing the configuration file to obtain path data corresponding to the face frame design draft picture.
Preferably, the step of obtaining the face frame design draft picture includes:
reading a face frame design draft picture which is pre-stored in the local mobile terminal;
or receiving a face frame design draft picture sent by an external terminal;
or, downloading the face frame design draft picture from the Internet.
Preferably, the step of calculating a scaling ratio when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal according to a preset rule according to the size of the face frame design draft picture includes:
acquiring the screen size of the mobile terminal;
and calculating the scaling ratio of the face frame design draft picture when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal in an equal ratio after the central point of the face frame design draft picture is translated to the center of the screen of the mobile terminal according to the size of the screen of the mobile terminal and the size of the face frame design draft picture.
Preferably, the step of performing path autographing according to the path data, the translation distance and the scaling ratio to obtain a custom face frame control includes:
generating a graph transformation matrix according to the translation distance and the scaling;
creating a canvas, and drawing a corresponding face frame design draft picture on the canvas according to the path data;
translating and scaling the drawn face frame design draft picture in an equal ratio according to the graph transformation matrix, and cutting off the part of the face frame design draft picture exceeding the whole screen until the face frame design draft picture is scaled in an equal ratio to cover the whole screen of the mobile terminal;
and generating a user-defined face frame control according to the cut face frame design manuscript picture.
Preferably, the step of generating a user-defined face frame control according to the cut face frame design manuscript picture comprises:
and reducing the cut face frame design draft picture according to a preset proportion, and generating a user-defined face frame control according to the reduced face frame design draft picture.
Preferably, after the step of performing path autographing according to the path data, the translation distance, and the scaling ratio to obtain a user-defined face frame control, the method further includes:
and integrating the user-defined face frame control into a software development kit, and issuing the software development kit.
In addition, to achieve the above object, the present invention further provides a face frame drawing device, including:
the acquisition module is used for acquiring path data corresponding to the face frame design manuscript picture;
the analysis module is used for analyzing the path data to obtain the center point and the size of the human face frame design draft picture;
the first calculation module is used for calculating the translation distance of the center point translated to the center of the screen of the mobile terminal according to the center point of the face frame design draft picture;
the second calculation module is used for calculating the scaling of the face frame design draft picture when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal according to the preset rule in an equal ratio mode according to the size of the face frame design draft picture;
and the drawing module is used for performing path self-drawing according to the path data, the translation distance and the scaling ratio to obtain a user-defined face frame control.
Preferably, the obtaining module is further configured to:
acquiring a face frame design draft picture;
converting the face frame design draft picture into a Scalable Vector Graphics (SVG) picture, and converting the SVG picture into a corresponding configuration file;
and analyzing the configuration file to obtain path data corresponding to the face frame design draft picture.
Preferably, the obtaining module is further configured to:
reading a face frame design draft picture which is pre-stored in the local mobile terminal;
or receiving a face frame design draft picture sent by an external terminal;
or, downloading the face frame design draft picture from the Internet.
Preferably, the second calculation module is further configured to:
acquiring the screen size of the mobile terminal;
and calculating the scaling ratio of the face frame design draft picture when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal in an equal ratio after the central point of the face frame design draft picture is translated to the center of the screen of the mobile terminal according to the size of the screen of the mobile terminal and the size of the face frame design draft picture.
Preferably, the rendering module is further configured to:
generating a graph transformation matrix according to the translation distance and the scaling;
creating a canvas, and drawing a corresponding face frame design draft picture on the canvas according to the path data;
translating and scaling the drawn face frame design draft picture in an equal ratio according to the graph transformation matrix, and cutting off the part of the face frame design draft picture exceeding the whole screen until the face frame design draft picture is scaled in an equal ratio to cover the whole screen of the mobile terminal;
and generating a user-defined face frame control according to the cut face frame design manuscript picture.
Preferably, the rendering module is further configured to:
and reducing the cut face frame design draft picture according to a preset proportion, and generating a user-defined face frame control according to the reduced face frame design draft picture.
Preferably, the face frame drawing device further includes:
and the integrated publishing module is used for integrating the user-defined face frame control into a software development kit and publishing the software development kit.
In addition, to achieve the above object, the present invention also provides a face frame drawing apparatus, including: the face frame drawing program is stored on the memory and can run on the processor, and when being executed by the processor, the face frame drawing program realizes the steps of the face frame drawing method.
In addition, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a face frame drawing program, which when executed by a processor, implements the steps of the face frame drawing method as described above.
The method comprises the steps of obtaining path data corresponding to a face frame design manuscript picture; analyzing the path data to obtain the central point and the size of the picture of the face frame design draft; calculating the translation distance of the center point translated to the center of the screen of the mobile terminal according to the center point of the face frame design draft picture; calculating the scaling of the face frame design draft picture when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal in an equal ratio according to a preset rule according to the size of the face frame design draft picture; and performing path self-drawing according to the path data, the translation distance and the scaling ratio to obtain a user-defined face frame control. Through the mode, the translation distance and the scaling of the face frame design draft picture are calculated firstly, and then the self-defined face frame control is obtained in a path self-drawing mode, so that the obtained self-defined face frame control can adapt to the screen sizes of different mobile terminals and can be used for self-defining operation of different external partners.
Drawings
FIG. 1 is a schematic diagram of an apparatus architecture of a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a face frame drawing method according to a first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
The face frame drawing device in the embodiment of the invention can be a mobile terminal such as a smart phone and a tablet personal computer.
As shown in fig. 1, the face frame drawing apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the apparatus shown in fig. 1 is not intended to be limiting of the apparatus and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a face box drawing program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call a face box drawing program stored in the memory 1005 and perform operations in the various embodiments of the face box drawing method described below.
Based on the hardware structure, the embodiment of the face frame drawing method is provided.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of a face frame drawing method of the present invention, where the method includes:
step S10, obtaining path data corresponding to the face frame design manuscript picture;
the face frame drawing method is applied to mobile terminals such as smart phones and tablet computers. Firstly, a mobile terminal acquires Path data corresponding to a face frame design draft picture, wherein the Path data is data used for vector drawing, a class is called as Path in the drawing process of user-defined view (view), the Path can be used for drawing not only simple graphs (such as circles, rectangles, straight lines and the like) but also complex graphs (such as regular polygons, pentagons and the like), and the Path can be used for drawing, cutting and drawing texts.
In an embodiment, the step S10 may include: acquiring a face frame design draft picture; converting the face frame design draft picture into a Scalable Vector Graphics (SVG) picture, and converting the SVG picture into a corresponding configuration file; and analyzing the configuration file to obtain path data corresponding to the face frame design draft picture.
Specifically, the mobile terminal first obtains a pre-designed face frame design draft picture, the face frame design draft picture may be designed by a developer or customized by an external partner, and the present embodiment does not limit features such as color and style of the face frame design draft picture. After the face frame design draft picture is acquired, the mobile terminal can convert the face frame design draft picture into a Scalable Vector Graphics (SVG) picture through preset picture processing software such as photoshop, wherein the SVG is a graphics format based on an extensible markup language and used for describing two-dimensional Vector graphics; then, converting the SVG picture into a corresponding configuration file through an integrated development tool of the mobile terminal, for example, for an Android mobile phone, converting the SVG picture into a corresponding XML (Extensible Markup Language) configuration file through an integrated development tool Android Studio of the mobile terminal, where the configuration file includes path data; and then analyzing the converted configuration file to obtain path data corresponding to the face frame design manuscript picture.
Further, the step of obtaining the face frame design draft picture may include: reading a face frame design draft picture which is pre-stored in the local mobile terminal; or receiving a face frame design draft picture sent by an external terminal; or, downloading the face frame design draft picture from the Internet.
In this embodiment, the mobile terminal may obtain the face frame design draft picture in a variety of ways, including reading a face frame design draft picture pre-stored locally in the mobile terminal, receiving a face frame design draft picture sent by an external terminal (e.g., a computer, a mobile phone, a tablet computer, etc.), downloading the face frame design draft picture from the internet, and the like, and in particular, different face frame design draft picture obtaining ways may be flexibly selected.
In another embodiment, when the mobile terminal obtains the path data corresponding to the face frame design draft picture, an external terminal (e.g., a computer, a mobile phone, a tablet computer, etc.) may convert the face frame design draft picture into the corresponding path data, and then send the converted path data to the mobile terminal, where the mobile terminal directly receives the path data corresponding to the face frame design draft picture sent by the external terminal.
Step S20, analyzing the path data to obtain the center point and the size of the picture of the face frame design draft;
in this step, the mobile terminal analyzes the acquired path data to obtain a central point and a size of the picture of the face frame design draft, where the central point may be represented in a form of coordinates, such as position coordinates of the central point in a mobile terminal screen, and the size may be represented in a form of resolution, such as 800 × 640.
Step S30, calculating the translation distance of the center point translated to the center of the screen of the mobile terminal according to the center point of the face frame design draft picture;
in this embodiment, in order to enable the user-defined face frame control to adapt to the screen sizes of different mobile terminals, an original face frame design draft picture needs to be adjusted, specifically, the face frame design draft picture is translated to the center of a mobile terminal screen, and then the face frame design draft picture is scaled in an equal ratio to cover the whole screen of the mobile terminal.
Firstly, calculating the translation distance of the center point translated to the center of the screen of the mobile terminal according to the center point of the face frame design draft picture, specifically, acquiring the center point coordinate of the face frame design draft picture and the center coordinate of the screen of the mobile terminal, and then obtaining the translation distance of the center point of the face frame design draft picture translated to the center of the screen of the mobile terminal according to the distance between the two coordinates.
Step S40, calculating the scaling of the face frame design draft picture when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal according to the preset rule in an equal ratio mode according to the size of the face frame design draft picture;
and then, according to the size of the face frame design draft picture, calculating the scaling of the face frame design draft picture when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal in an equal ratio according to a preset rule. Specifically, when the size of the face frame design manuscript picture is larger than the size of the screen of the mobile terminal, the face frame design manuscript picture needs to be scaled down, and when the size of the face frame design manuscript picture is smaller than the size of the screen of the mobile terminal, the face frame design manuscript picture needs to be scaled up. The scaling rule corresponding to the face frame design draft picture being scaled to cover the whole screen of the mobile terminal in an equal ratio may be: and the face frame design draft picture is zoomed to just cover the whole screen of the mobile terminal in an equal ratio, and then zooming is stopped, or the face frame design draft picture is zoomed to just cover the whole screen of the mobile terminal in an equal ratio and then is amplified according to a preset ratio. The specific scaling rule and the preset ratio can be flexibly selected by a developer.
It should be noted that, the scaling is performed in an equal ratio, that is, the width and the height of the face frame design draft picture are scaled according to the same ratio, and in the process of scaling in an equal ratio, the center point of the face frame design draft picture is always overlapped with the center of the screen of the mobile terminal.
And step S50, performing path self-drawing according to the path data, the translation distance and the scaling ratio to obtain a user-defined face frame control.
In the step, the mobile terminal carries out path self-drawing according to the obtained path data, the translation distance and the scaling ratio, and the user-defined face frame control is obtained. Specifically, a preset drawing function may be called, a corresponding original face frame design draft picture is drawn according to the path data, and then the original face frame design draft picture is translated and scaled in an equal ratio according to the translation distance and the scaling ratio, so as to finally obtain the user-defined face frame control. It should be noted that, when the aspect ratio of the face frame design draft picture is different from the aspect ratio of the mobile terminal screen, the face frame design draft picture may have a portion exceeding the mobile terminal screen after being zoomed, at this time, the portion exceeding the mobile terminal screen needs to be cut off, and then the customized face frame control is generated according to the cut picture.
Through the mode, the translation distance and the scaling ratio of the face frame design draft picture are firstly calculated in the embodiment, then the customized face frame control is obtained by adopting a path self-drawing mode, the obtained customized face frame control can adapt to the screen sizes of different mobile terminals, and different external partners can perform customized operation.
Further, a second embodiment of the face frame drawing method of the present invention is proposed based on the first embodiment of the face frame drawing method of the present invention.
In this embodiment, the step S40 may further include: acquiring the screen size of the mobile terminal; and calculating the scaling ratio of the face frame design draft picture when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal in an equal ratio after the central point of the face frame design draft picture is translated to the center of the screen of the mobile terminal according to the size of the screen of the mobile terminal and the size of the face frame design draft picture.
Specifically, when calculating the scaling, first obtaining the screen size of the mobile terminal, which may be expressed in the form of resolution, such as 1920 × 1080; and then, calculating the scaling ratio when the center point of the face frame design draft picture is translated to the center of the screen of the mobile terminal, and cutting off the part which exceeds the whole screen of the mobile terminal after scaling when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal. The face frame design draft picture obtained by the zooming rule further reduces the memory occupied by the face frame design draft picture on the premise of ensuring that the face frame design draft picture is adaptive to the screen size of the mobile terminal.
Further, the step S50 may include: generating a graph transformation matrix according to the translation distance and the scaling; creating a canvas, and drawing a corresponding face frame design draft picture on the canvas according to the path data; translating and scaling the drawn face frame design draft picture in an equal ratio according to the graph transformation matrix, and cutting off the part of the face frame design draft picture exceeding the whole screen until the face frame design draft picture is scaled in an equal ratio to cover the whole screen of the mobile terminal; and generating a user-defined face frame control according to the cut face frame design manuscript picture.
Specifically, when the path is self-drawn, the mobile terminal may generate a graph transformation Matrix according to the calculated translation distance and the scaling, then create a canvas, draw a corresponding face frame design draft picture on the canvas according to the path data, then translate and scale the drawn face frame design draft picture according to the graph transformation Matrix, until the face frame design draft picture is scaled to cover the whole screen of the mobile terminal in an equal ratio, cut off the part of the face frame design draft picture exceeding the whole screen, and then generate a user-defined face frame control according to the cut face frame design draft picture.
The step of generating a user-defined face frame control according to the cut face frame design manuscript picture may further comprise: and reducing the cut face frame design draft picture according to a preset proportion, and generating a user-defined face frame control according to the reduced face frame design draft picture.
In an actual application scene such as face recognition, because a face frame is generally smaller than a mobile terminal screen, a mobile terminal can reduce a cut face frame design draft picture according to a preset proportion, and then a user-defined face frame control is generated according to the reduced face frame design draft picture, wherein the reduction is in aspect ratio such as width, and the reduced proportion can be flexibly set according to actual needs. By the method, the design draft of the face frame meets the requirements of practical application scenes, and the memory occupied by the finally generated user-defined face frame control is further reduced.
Of course, in this embodiment, the mobile terminal may also generate the user-defined face frame control directly according to the size of the cut face frame design draft picture without performing reduction processing on the cut face frame design draft picture, and the user-defined face frame control may be flexibly set during specific implementation.
Further, a third embodiment of the face frame drawing method of the present invention is proposed based on the first and second embodiments of the face frame drawing method of the present invention.
In this embodiment, after step S50, the method may further include: and integrating the user-defined face frame control into a software development kit, and issuing the software development kit.
In this embodiment, the final purpose of drawing the custom face box control is to provide the custom face box control for an external partner, and for this reason, the mobile terminal may integrate the drawn custom face box control into a software development kit SDK, and then release the software development kit. External partner can be integrated to the APP of self development with the SDK package that is integrated with self-defined face frame to possess the APP of face identification function as an example, when the user uses this APP to carry out face identification through mobile terminal, mobile terminal shows self-defined face frame control in application interface, the user can be according to the colour, the style etc. of self-defined face frame control of own needs, thereby satisfy user's individualized demand.
Compared with the prior art, developers do not need to design face frame pictures with various colors and styles, and only need to integrate the user-defined face frame control into the SDK package for publishing, so that the development and maintenance cost of the face frame pictures is reduced.
The invention also provides a face frame drawing device. The face frame drawing device of the embodiment of the invention comprises:
the acquisition module is used for acquiring path data corresponding to the face frame design manuscript picture;
the analysis module is used for analyzing the path data to obtain the center point and the size of the human face frame design draft picture;
the first calculation module is used for calculating the translation distance of the center point translated to the center of the screen of the mobile terminal according to the center point of the face frame design draft picture;
the second calculation module is used for calculating the scaling of the face frame design draft picture when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal according to the preset rule in an equal ratio mode according to the size of the face frame design draft picture;
and the drawing module is used for performing path self-drawing according to the path data, the translation distance and the scaling ratio to obtain a user-defined face frame control.
Further, the obtaining module is further configured to:
acquiring a face frame design draft picture;
converting the face frame design draft picture into a Scalable Vector Graphics (SVG) picture, and converting the SVG picture into a corresponding configuration file;
and analyzing the configuration file to obtain path data corresponding to the face frame design draft picture.
Further, the obtaining module is further configured to:
reading a face frame design draft picture which is pre-stored in the local mobile terminal;
or receiving a face frame design draft picture sent by an external terminal;
or, downloading the face frame design draft picture from the Internet.
Further, the second calculation module is further configured to:
acquiring the screen size of the mobile terminal;
and calculating the scaling ratio of the face frame design draft picture when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal in an equal ratio after the central point of the face frame design draft picture is translated to the center of the screen of the mobile terminal according to the size of the screen of the mobile terminal and the size of the face frame design draft picture.
Further, the rendering module is further configured to:
generating a graph transformation matrix according to the translation distance and the scaling;
creating a canvas, and drawing a corresponding face frame design draft picture on the canvas according to the path data;
translating and scaling the drawn face frame design draft picture in an equal ratio according to the graph transformation matrix, and cutting off the part of the face frame design draft picture exceeding the whole screen until the face frame design draft picture is scaled in an equal ratio to cover the whole screen of the mobile terminal;
and generating a user-defined face frame control according to the cut face frame design manuscript picture.
Further, the rendering module is further configured to:
and reducing the cut face frame design draft picture according to a preset proportion, and generating a user-defined face frame control according to the reduced face frame design draft picture.
Further, the face frame drawing device further includes:
and the integrated publishing module is used for integrating the user-defined face frame control into a software development kit and publishing the software development kit.
The operations executed by the program modules can refer to the embodiments of the face frame drawing method of the present invention, and are not described herein again.
The invention also provides a computer readable storage medium.
The computer-readable storage medium of the present invention stores thereon a face frame drawing program, which when executed by a processor implements the steps of the face frame drawing method as described above.
The method implemented when the face frame drawing program running on the processor is executed may refer to each embodiment of the face frame drawing method of the present invention, and details are not described here.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (15)

1. A face frame drawing method is characterized by comprising the following steps:
acquiring path data corresponding to the face frame design manuscript picture;
analyzing the path data to obtain the central point and the size of the picture of the face frame design draft;
calculating the translation distance of the center point translated to the center of the screen of the mobile terminal according to the center point of the face frame design draft picture;
calculating the scaling of the face frame design draft picture when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal according to a preset rule in an equal ratio mode according to the size of the face frame design draft picture, wherein the preset rule is as follows: the face frame design draft image is zoomed in an equal proportion until the face frame design draft image just covers the whole screen of the mobile terminal, and then zooming is stopped, or the face frame design draft image is zoomed in an equal proportion until the face frame design draft image just covers the whole screen of the mobile terminal, and then is amplified according to a preset ratio;
and performing path self-drawing according to the path data, the translation distance and the scaling ratio to obtain a user-defined face frame control.
2. The method for drawing a face frame according to claim 1, wherein the step of obtaining path data corresponding to the picture of the face frame design draft comprises:
acquiring a face frame design draft picture;
converting the face frame design draft picture into a Scalable Vector Graphics (SVG) picture, and converting the SVG picture into a corresponding configuration file;
and analyzing the configuration file to obtain path data corresponding to the face frame design draft picture.
3. The method for drawing a face frame according to claim 2, wherein the step of obtaining a picture of a design draft of the face frame comprises:
reading a face frame design draft picture which is pre-stored in the local mobile terminal;
or receiving a face frame design draft picture sent by an external terminal;
or, downloading the face frame design draft picture from the Internet.
4. The face frame drawing method according to any one of claims 1 to 3, wherein the step of calculating a scaling ratio at which the face frame design draft picture is scaled to cover the entire screen of the mobile terminal according to a preset rule based on the size of the face frame design draft picture includes:
acquiring the screen size of the mobile terminal;
and calculating the scaling ratio of the face frame design draft picture when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal in an equal ratio after the central point of the face frame design draft picture is translated to the center of the screen of the mobile terminal according to the size of the screen of the mobile terminal and the size of the face frame design draft picture.
5. The method for drawing a face frame according to claim 4, wherein the step of performing path autograph according to the path data, the translation distance and the scaling to obtain a custom face frame control comprises:
generating a graph transformation matrix according to the translation distance and the scaling;
creating a canvas, and drawing a corresponding face frame design draft picture on the canvas according to the path data;
translating and scaling the drawn face frame design draft picture in an equal ratio according to the graph transformation matrix, and cutting off the part of the face frame design draft picture exceeding the whole screen until the face frame design draft picture is scaled in an equal ratio to cover the whole screen of the mobile terminal;
and generating a user-defined face frame control according to the cut face frame design manuscript picture.
6. The face frame drawing method of claim 5, wherein the step of generating a custom face frame control from the cropped face frame design manuscript picture comprises:
and reducing the cut face frame design draft picture according to a preset proportion, and generating a user-defined face frame control according to the reduced face frame design draft picture.
7. The method for drawing a face frame according to any one of claims 1 to 3, wherein after the step of performing path self-drawing according to the path data and the translation distance and the scaling ratio to obtain a user-defined face frame control, the method further comprises:
and integrating the user-defined face frame control into a software development kit, and issuing the software development kit.
8. A face frame drawing device, characterized in that the face frame drawing device comprises:
the acquisition module is used for acquiring path data corresponding to the face frame design manuscript picture;
the analysis module is used for analyzing the path data to obtain the center point and the size of the human face frame design draft picture;
the first calculation module is used for calculating the translation distance of the center point translated to the center of the screen of the mobile terminal according to the center point of the face frame design draft picture;
a second calculating module, configured to calculate, according to the size of the face frame design draft picture, a scaling ratio at which the face frame design draft picture is scaled to cover the entire screen of the mobile terminal according to a preset rule, where the preset rule is: the face frame design draft image is zoomed in an equal proportion until the face frame design draft image just covers the whole screen of the mobile terminal, and then zooming is stopped, or the face frame design draft image is zoomed in an equal proportion until the face frame design draft image just covers the whole screen of the mobile terminal, and then is amplified according to a preset ratio;
and the drawing module is used for performing path self-drawing according to the path data, the translation distance and the scaling ratio to obtain a user-defined face frame control.
9. The face frame rendering apparatus of claim 8, wherein the obtaining module is further configured to:
acquiring a face frame design draft picture;
converting the face frame design draft picture into a Scalable Vector Graphics (SVG) picture, and converting the SVG picture into a corresponding configuration file;
and analyzing the configuration file to obtain path data corresponding to the face frame design draft picture.
10. The face frame drawing apparatus according to claim 8 or 9, wherein the second calculation module is further configured to:
acquiring the screen size of the mobile terminal;
and calculating the scaling ratio of the face frame design draft picture when the face frame design draft picture is scaled to cover the whole screen of the mobile terminal in an equal ratio after the central point of the face frame design draft picture is translated to the center of the screen of the mobile terminal according to the size of the screen of the mobile terminal and the size of the face frame design draft picture.
11. The face frame rendering apparatus of claim 10, wherein the rendering module is further configured to:
generating a graph transformation matrix according to the translation distance and the scaling;
creating a canvas, and drawing a corresponding face frame design draft picture on the canvas according to the path data;
translating and scaling the drawn face frame design draft picture in an equal ratio according to the graph transformation matrix, and cutting off the part of the face frame design draft picture exceeding the whole screen until the face frame design draft picture is scaled in an equal ratio to cover the whole screen of the mobile terminal;
and generating a user-defined face frame control according to the cut face frame design manuscript picture.
12. The face frame rendering apparatus of claim 11, wherein the rendering module is further configured to:
and reducing the cut face frame design draft picture according to a preset proportion, and generating a user-defined face frame control according to the reduced face frame design draft picture.
13. The face frame drawing device according to claim 8 or 9, further comprising:
and the integrated publishing module is used for integrating the user-defined face frame control into a software development kit and publishing the software development kit.
14. A face frame drawing device characterized by comprising: a memory, a processor and a face box drawing program stored on the memory and executable on the processor, the face box drawing program when executed by the processor implementing the steps of the face box drawing method according to any one of claims 1 to 7.
15. A computer-readable storage medium, characterized in that a face frame drawing program is stored thereon, which when executed by a processor implements the face frame drawing method according to any one of claims 1 to 7.
CN201910037927.5A 2019-01-15 2019-01-15 Face frame drawing method, device and equipment and computer readable storage medium Active CN109799984B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910037927.5A CN109799984B (en) 2019-01-15 2019-01-15 Face frame drawing method, device and equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910037927.5A CN109799984B (en) 2019-01-15 2019-01-15 Face frame drawing method, device and equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109799984A CN109799984A (en) 2019-05-24
CN109799984B true CN109799984B (en) 2022-04-26

Family

ID=66559423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910037927.5A Active CN109799984B (en) 2019-01-15 2019-01-15 Face frame drawing method, device and equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109799984B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535056B (en) * 2021-06-17 2023-12-05 深圳软牛科技有限公司 Frame selection adjustment method based on InkCanvas and related equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101925904A (en) * 2007-12-12 2010-12-22 3M创新有限公司 Document verification using dynamic document identification framework
CN103218595A (en) * 2013-03-29 2013-07-24 深圳市金立通信设备有限公司 Terminal and method for recognizing two-dimensional codes
CN108304001A (en) * 2018-02-09 2018-07-20 成都新舟锐视科技有限公司 A kind of Face datection tracking, ball machine head rotation control method and ball machine

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5517435B2 (en) * 2008-10-22 2014-06-11 キヤノン株式会社 Automatic focusing device, automatic focusing method, and imaging device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101925904A (en) * 2007-12-12 2010-12-22 3M创新有限公司 Document verification using dynamic document identification framework
CN103218595A (en) * 2013-03-29 2013-07-24 深圳市金立通信设备有限公司 Terminal and method for recognizing two-dimensional codes
CN108304001A (en) * 2018-02-09 2018-07-20 成都新舟锐视科技有限公司 A kind of Face datection tracking, ball machine head rotation control method and ball machine

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
android自定义虹软人脸识别框/人脸抓拍框/人脸追踪框;大力-哥;《https://blog.csdn.net/qq137722697/article/details/81538067》;20180809;第1-5页 *

Also Published As

Publication number Publication date
CN109799984A (en) 2019-05-24

Similar Documents

Publication Publication Date Title
US10599914B2 (en) Method and apparatus for human face image processing
US7853873B2 (en) Data processing apparatus, data processing method, and computer program for generating electronic data from a paper document
CN108427546B (en) Full screen adaptation method of display device, display device and storage medium
CN110263301B (en) Method and device for determining color of text
CN112102437A (en) Canvas-based radar map generation method and device, storage medium and terminal
CN110232726B (en) Creative material generation method and device
CN111553131A (en) PSD file analysis method, device, equipment and readable storage medium
KR20070003418A (en) Method for providing mobile webpage by employing to dynamic template
CN104794106A (en) Annotating method and device
CN113342435A (en) Expression processing method and device, computer equipment and storage medium
CN109799984B (en) Face frame drawing method, device and equipment and computer readable storage medium
CN114004905A (en) Method, device and equipment for generating character style image and storage medium
US20060140513A1 (en) Dynamic image production method and system
CN106293658B (en) Interface component generation method and equipment
CN109242929A (en) Conversion method, device, storage medium and the equipment of path coordinate figure
WO2023207454A9 (en) Image processing method, image processing apparatuses and readable storage medium
CN111107264A (en) Image processing method, image processing device, storage medium and terminal
CN111372009A (en) Image processing method and processing equipment
CN110717891A (en) Picture detection method and device based on grouping batch and storage medium
CN114942854A (en) Screenshot method of GIF (graphic interchange Format) dynamic image and related equipment
CN115423680A (en) Face makeup migration method, device and computer-readable storage medium
CN110913193B (en) Image processing method, device, apparatus and computer readable storage medium
CN115953597A (en) Image processing method, apparatus, device and medium
JPH086948A (en) Machine translation apparatus
CN113223186A (en) Processing method, equipment, product and device for realizing augmented reality

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