CN111383176A - Certificate photo generation method, client and server - Google Patents

Certificate photo generation method, client and server Download PDF

Info

Publication number
CN111383176A
CN111383176A CN202010191062.0A CN202010191062A CN111383176A CN 111383176 A CN111383176 A CN 111383176A CN 202010191062 A CN202010191062 A CN 202010191062A CN 111383176 A CN111383176 A CN 111383176A
Authority
CN
China
Prior art keywords
target image
image
certificate
neural network
image processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010191062.0A
Other languages
Chinese (zh)
Inventor
徐立
李泓冰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qiwei Visual Media Technology Co ltd
Original Assignee
Beijing Qiwei Visual Media 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 Beijing Qiwei Visual Media Technology Co ltd filed Critical Beijing Qiwei Visual Media Technology Co ltd
Priority to CN202010191062.0A priority Critical patent/CN111383176A/en
Publication of CN111383176A publication Critical patent/CN111383176A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4046Scaling the whole image or part thereof using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person

Abstract

The application provides a certificate photo generation method, a client and a server, wherein the method comprises the following steps: acquiring an initial image under the condition of receiving a preset instruction; the initial image is an image of a certificate photo to be generated; sending the initial image to a server; receiving a target image sent by a server; the target image is an image obtained by the server side through character recognition and background removal on the initial image through the trained convolutional neural network model; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology; acquiring target image processing parameters; the target image processing parameters include at least: head portrait ratio, background fill color, and image scale; and according to the target image processing parameters, carrying out background filling and cutting on the target image to obtain the certificate photo. The method and the device can generate the certificate photo and can generate the certificate photo quickly.

Description

Certificate photo generation method, client and server
Technical Field
The present application relates to the field of image processing, and in particular, to a method for generating a certificate photo, a client, and a server.
Background
With the continuous strengthening of the comprehensive strength of China, the opportunities for people to travel and develop and exchange culture in international trade are more and more, and different countries and regions have different requirements and sizes for the certificate photos when going out of the country.
Because the work of the user is busy at present, a scheme for quickly generating the certificate photo is urgently needed.
Disclosure of Invention
The application provides a method for generating a certificate photo, a client and a server, and aims to generate the certificate photo quickly.
In order to achieve the above object, the present application provides the following technical solutions:
the application provides a method for generating a certificate photo, which is applied to a client and comprises the following steps:
acquiring an initial image under the condition of receiving a preset instruction; the initial image is an image of a certificate photo to be generated;
sending the initial image to a server;
receiving a target image sent by the server; the target image is an image obtained by the server side through character recognition and background removal on the initial image through a trained convolutional neural network model; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology;
acquiring target image processing parameters; the target image processing parameters include at least: head portrait ratio, background fill color, and image scale;
and according to the target image processing parameters, carrying out background filling and cutting on the target image to obtain a certificate photo.
Optionally, the acquiring target image processing parameters includes:
receiving the type of the certificate to be used;
and determining the image processing parameters corresponding to the certificate categories to be used from the preset corresponding relationship between the preset certificate categories and the image processing parameters to obtain the target image processing parameters.
Optionally, the acquiring an initial image includes:
driving a camera to shoot to obtain the initial image stored in a preset file;
and reading the initial image from the preset file.
Optionally, the background filling and cutting the target image according to the target image processing parameter to obtain the certificate photo corresponding to the certificate category to be used includes:
filling the background of the target image according to the background filling color in the target image processing parameters to obtain an image with the filled background;
and cutting the image after the background is filled according to the head portrait proportion and the image proportion in the target image processing parameters to obtain the certificate photo corresponding to the type of the certificate to be used.
The application also provides a method for generating the certificate photo, which is applied to a server and comprises the following steps:
under the condition of receiving an initial image sent by a client, inputting the initial image into a trained convolutional neural network model for character recognition and background removal to obtain a target image; the initial image is an image of a certificate photo to be generated; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology;
and sending the target image to the client.
The application also provides a method for generating the certificate photo, which is applied to the client and comprises the following steps:
acquiring an initial image under the condition of receiving a preset instruction; the initial image is an image of a certificate photo to be generated;
receiving parameters to be processed; the parameters to be processed are condition parameters required for generating certificate photos;
sending the initial image and the parameter to be processed to a server;
receiving a certificate photo which is sent by the server and corresponds to the parameter to be processed; the certificate photo corresponding to the certificate category to be used is the server, the initial image is input into the trained convolutional neural network model for character recognition and background removal, a target image is obtained, and the server fills and cuts the background of the target image according to the parameter to be processed; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology.
The application also provides a method for generating the certificate photo, which is applied to a server and comprises the following steps:
under the condition of receiving an initial image and parameters to be processed sent by a client, inputting the initial image into a trained convolutional neural network model for character recognition and background removal to obtain a target image; the initial image is an image of a certificate photo to be generated; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology; the parameters to be processed are condition parameters required for generating certificate photos;
determining image processing parameters which are indicated by the parameters to be processed and used for processing the target image to obtain target image processing parameters; the target image processing parameters include at least: head portrait ratio, background fill color, and image scale;
according to the target image processing parameters, carrying out background filling and cutting on the target image to obtain a certificate photo corresponding to the type of the certificate to be used;
and sending the certificate photo to the client.
Optionally, the parameters to be processed include categories of certificates to be used; the determining the image processing parameters indicated by the parameters to be processed and used for processing the target image to obtain the target image processing parameters includes:
and determining the image processing parameters corresponding to the certificate categories to be used from the preset corresponding relationship between the preset certificate categories and the image processing parameters to obtain the target image processing parameters.
The present application further provides a client, including:
the first acquisition module is used for acquiring an initial image under the condition of receiving a preset instruction; the initial image is an image of a certificate photo to be generated;
the first sending module is used for sending the initial image to a server;
the first receiving module is used for receiving a target image sent by the server; the target image is an image obtained by the server side through character recognition and background removal on the initial image through a trained convolutional neural network model; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology;
the second acquisition module is used for acquiring target image processing parameters; the target image processing parameters include at least: head portrait ratio, background fill color, and image scale;
and the processing module is used for carrying out background filling and cutting on the target image according to the target image processing parameters to obtain the certificate photo corresponding to the type of the certificate to be used.
Optionally, the second obtaining module is configured to obtain a target image processing parameter, and includes:
the second acquisition module is specifically used for receiving the types of the certificates to be used; and determining the image processing parameters corresponding to the certificate categories to be used from the preset corresponding relationship between the preset certificate categories and the image processing parameters to obtain the target image processing parameters.
Optionally, the first obtaining module is configured to obtain the initial image when a preset instruction is received, and the obtaining module includes:
the first acquisition module is specifically used for driving a camera to shoot to obtain the initial image stored in a preset file; and reading the initial image from the preset file.
Optionally, the processing module is configured to perform background filling and clipping on the target image according to the target image processing parameter, so as to obtain the certificate photo corresponding to the to-be-used certificate category, and the processing module includes:
the processing module is specifically used for filling the background of the target image according to the background filling color in the target image processing parameters to obtain an image with the filled background; and cutting the image after the background is filled according to the head portrait proportion and the image proportion in the target image processing parameters to obtain the certificate photo corresponding to the type of the certificate to be used.
The present application further provides a server, including:
the generating module is used for inputting the initial image into the trained convolutional neural network model for character recognition and background removal under the condition of receiving the initial image sent by the client to obtain a target image; the initial image is an image of a certificate photo to be generated; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology;
and the second sending module is used for sending the target image to the client.
The present application further provides a client, including:
the third acquisition module is used for acquiring an initial image under the condition of receiving a preset instruction; the initial image is an image of a certificate photo to be generated;
the second receiving module is used for receiving the parameters to be processed; the parameters to be processed are condition parameters required for generating certificate photos;
the third sending module is used for sending the initial image and the parameter to be processed to a server;
the third receiving module is used for receiving the certificate photo which is sent by the server and corresponds to the parameter to be processed; the certificate photo corresponding to the certificate category to be used is the server, the initial image is input into the trained convolutional neural network model for character recognition and background removal, a target image is obtained, and the server fills and cuts the background of the target image according to the parameter to be processed; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology.
The present application further provides a server, including:
the input module is used for inputting the initial image into the trained convolutional neural network model for character recognition and background removal under the condition of receiving the initial image and the parameters to be processed, which are sent by the client, so as to obtain a target image; the initial image is an image of a certificate photo to be generated; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology; the parameters to be processed are condition parameters required for generating certificate photos;
the determining module is used for determining the image processing parameters which are indicated by the parameters to be processed and used for processing the target image to obtain target image processing parameters; the target image processing parameters include at least: head portrait ratio, background fill color, and image scale;
the execution module is used for carrying out background filling and cutting on the target image according to the target image processing parameters to obtain a certificate photo corresponding to the type of the certificate to be used;
and the fourth sending module is used for sending the certificate photo to the client.
Optionally, the parameters to be processed include categories of certificates to be used; the determining module is configured to determine an image processing parameter indicated by the parameter to be processed and used for processing the target image, and obtain a target image processing parameter, and includes:
the determining module is specifically configured to determine the image processing parameters corresponding to the categories of the certificates to be used from a preset corresponding relationship between preset certificate categories and image processing parameters, so as to obtain the target image processing parameters.
According to the method and the device for generating the certificate photo, the client side obtains the initial image under the condition that the client side receives the preset instruction; the initial image is an image of a certificate photo to be generated; sending the initial image to a server; receiving a target image sent by a server;
the target image is an image obtained by the server side through the trained convolutional neural network model to recognize the person of the initial image and remove the photo background from the image after the person is recognized, and the trained convolutional neural network model is obtained by training the preset convolutional neural network model through the deep learning technology, so that the server side can quickly obtain the target image. Furthermore, the time from the acquisition of the initial image to the acquisition of the certificate photo is shorter for the client.
The client receives the certificate category to be used; determining image processing parameters corresponding to the types of the certificates to be used to obtain target image processing parameters; wherein the target image processing parameters at least include: head portrait ratio, background fill color, and image scale; and then, the client can perform background filling and cutting on the target image according to the target image processing parameters to obtain the certificate photo corresponding to the certificate category to be used. Therefore, the certificate photo can be generated.
In conclusion, the method for generating the certificate photo can generate the certificate photo and can generate the certificate photo quickly.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method of generating a credential photo as disclosed in an embodiment of the present application;
FIG. 2(a) is a schematic diagram of an initial image disclosed in an embodiment of the present application;
FIG. 2(b) is a schematic diagram of a target image disclosed in an embodiment of the present application;
fig. 2(c) is a schematic diagram of an image obtained after background filling is performed on a target image according to an embodiment of the present application;
FIG. 2(d) is a schematic illustration of a generated certificate photo as disclosed in an embodiment of the present application;
FIG. 3 is a schematic diagram of an image labeled with desired image processing parameters corresponding to a American visa disclosed in an embodiment of the present application;
FIG. 4 is a flow chart of yet another credential photo generation method disclosed in an embodiment of the present application;
fig. 5 is a schematic structural diagram of a client disclosed in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a server disclosed in an embodiment of the present application;
fig. 7 is a schematic structural diagram of another client disclosed in the embodiment of the present application;
fig. 8 is a schematic structural diagram of another server disclosed in the embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In this embodiment of the application, as an example, the client may be an android client program written in a C + + language, the version of an android system may be 7.0, and the server may be written in a C + + language, but may also be written in other languages in practice, and this embodiment of the application is not limited to a specific programming language.
Fig. 1 is a method for generating a certificate photo according to an embodiment of the present application, including the following steps:
s101, the client acquires an initial image under the condition that a preset instruction is received.
In this step, the preset instruction may be an instruction sent by the user to instruct generation of the certificate photo, specifically, a specific form of the preset instruction may be determined according to an actual situation, and the specific form of the preset instruction is not limited in this embodiment. For example, the preset instruction may be an instruction generated by clicking a "generate certificate photo" key on the client interface by the user.
In this embodiment, the initial image is an image of a certificate photo to be generated.
Optionally, in this embodiment, the manner of acquiring the initial image by the client when receiving the preset instruction may include the following steps a1 to a 2:
and A1, driving the camera to take a picture to obtain an initial image stored in a preset file.
The client drives a camera of the terminal to shoot, and the terminal stores an initial image obtained by shooting in a preset file, wherein a storage address of the preset file in the terminal can be set according to actual conditions, and the preset file is not limited in this embodiment.
For example, a user can open a photographing interface to select a self-photographing mode, start a 1200 ten thousand pixel camera, photograph a half-length view of the user, and generate a 2M-sized JPG picture format after photographing and store the JPG picture format in a gallery folder designated by a system, that is, in a preset folder.
And A2, reading the initial image from the preset file.
In this step, the client reads an initial image from a preset file.
For example, the client reads an initial image from the gallery folder, and specifically, the client may use an image with the latest generation date in the gallery folder as the initial image. Of course, the client selects the initial image from the images in the designated gallery folder by using the date generation mode, which is only one implementation mode for the client to read the initial image from the gallery folder.
S102, the client sends the initial image to the server.
For example, the client runs on a mobile phone, and then may be sent to the server through the 4G network.
As an example, the initial image sent by the client to the server may be as shown in fig. 2 (a).
S103, under the condition that the server receives the initial image sent by the client, the initial image is input into the trained convolutional neural network model to be subjected to character recognition and background removal, and a target image is obtained.
In this embodiment, the trained convolutional neural network model is obtained by training a preset Convolutional Neural Network (CNN) through a deep learning technique. The training samples are preset character images, the training samples are input into a preset convolution application network model, deep learning is adopted for training, and for convenience in description, the trained convolution neural network model is called as a trained convolution neural network model. The trained convolutional neural network model has the capability of accurately identifying the person from the person image and removing the background except the person, wherein the removing of the background can be specifically to set the background to be transparent. For convenience of description, an image obtained by performing person recognition and background removal on the trained convolutional neural network is referred to as a target image.
As an example, for the initial image of fig. 2(a), the target image obtained in this step is shown in fig. 2 (b). In fig. 2(b), the mosaic area shows the result of background removal of the trained convolutional neural network.
As an example, the target image may be a PNG format image with channel (AlphaChannel).
And S104, the server sends the target image to the client.
And S105, the client acquires target image processing parameters.
In the present embodiment, the target image processing parameter is used to indicate: and obtaining parameters for processing the target image by the certificate photo required by the user. In this embodiment, the target image processing parameters include at least: the image recognition method comprises the following steps of head portrait ratio, background filling color and image ratio, wherein the head portrait ratio is the ratio of the head portrait to the certificate photo. In practice, the target image processing parameter may further include other parameters according to actual requirements, and the specific content of the target image processing parameter is not limited in this embodiment.
Optionally, in this step, the manner for the client to obtain the target image processing parameter may include two types, the first type: and selecting target image processing parameters on an interface of the client by the user. And the second method comprises the following steps: the user selects the certificate category to be used on the client interface. The corresponding relation between the certificate type and the image processing parameters is established in advance in the client, and the client can determine the image processing parameters corresponding to the certificate type to be used directly according to the corresponding relation and the certificate type to be used, so that the target image processing parameters are obtained. Wherein, preset certificate classification can include: identity cards, passports, port passes, graduation cards, job qualifications, and the like. The certificate category to be used is one or more of preset certificate categories. In practice, the specific content of the certificate category to be used needs to be determined according to the actual situation, and the specific content of the certificate category to be used is not limited in this embodiment.
Taking the category of the certificate to be used as the visa of the united states as an example, the target image processing parameters may include: the background filling color was white, the image ratio was 51mm by 51mm, and the head portrait ratio was 50% to 69%, specifically, as shown in fig. 3.
And S106, the client side carries out background filling and cutting on the target image according to the target image processing parameters to obtain the certificate photo corresponding to the certificate category to be used.
Optionally, a specific implementation manner of this step may include step B1 to step B2:
and B1, filling the background of the target image according to the background filling color in the target image processing parameters to obtain the image with the filled background.
As an example, when the target image is fig. 2(b) and the background filling color is green, the image after background filling obtained in this step is as shown in fig. 2 (c).
And B2, cutting the image with the filled background according to the head portrait proportion and the image proportion in the target image processing parameters to obtain the certificate photo corresponding to the certificate type to be used.
As an example, for the target image indicated in fig. 2(b), the background filling colors are pure blue, pure red and pure green, respectively, and the resulting certificate photo is as shown in fig. 2 (d).
In the embodiment, after the server performs character recognition and background removal on the initial image to obtain the target image, the server sends the target image to the client, and the client processes the target image according to the image processing parameters corresponding to the types of the certificates to be used to obtain the certificate photos corresponding to the types of the certificates to be used.
In practice, the target image is processed according to the image processing parameters corresponding to the certificate type to be used, and the processing can be executed by a client side and a server side. The advantage that the user can preview the certificate photo in real time can be achieved only by the client side execution.
Specifically, as shown in fig. 4, the method for generating a certificate photo executed by a server according to target image processing parameters for a target image includes the following steps:
s401, the client side obtains an initial image under the condition that a preset instruction is received.
In this step, the initial image is an image of a certificate photo to be generated. The specific implementation manner of this step may refer to S101, which is not described herein again.
S402, the client side obtains the parameters to be processed.
In this step, the parameters to be processed are the condition parameters required for generating the certificate photo, wherein the certificate photo is the certificate photo required by the user.
Optionally, the parameter to be processed may be a target image processing parameter, and the parameter to be processed may also be a certificate category to be used. By way of example, the user may select the desired picture undertone and format at the client interface, or directly select the credential category to be used. The specific content of the certificate category to be used may refer to the certificate category in S105, which is not described herein again.
And S403, the client sends the initial image and the parameters to be processed to the server.
In this step, the client sends the initial image and the parameters to be processed to the server, so that the server generates a certificate photo according to the initial image and the parameters to be processed. Specifically, the process of the server side generating the certificate photo according to the initial image and the parameter to be processed is as follows S404 to S406.
As an example, after the user clicks the send key at the client, the to-be-processed parameter is sent to the server.
S404, under the condition that the server receives the initial image and the parameters to be processed sent by the client, the initial image is input into the trained convolutional neural network model to be subjected to character recognition and background removal, and a target image is obtained.
In this step, the initial image is an image of a certificate photo to be generated. The trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology.
The specific implementation manner of this step may refer to S103, which is not described herein again.
S405, the server side determines image processing parameters corresponding to the parameters to be processed to obtain target image processing parameters.
In this step, the target image processing parameters include at least: avatar fraction, background fill color, and image scale.
Specifically, in this step, if the parameter to be processed is the target image processing parameter, the server directly takes the parameter to be processed as the target image processing parameter. If the parameter to be processed is the certificate category to be used, the process of determining the image processing parameter corresponding to the certificate category to be used by the server is the same as that in S106, except that the execution main body in this step is the server, and the execution main body in S106 is the client.
S406, the server side carries out background filling and cutting on the target image according to the target image processing parameters to obtain the certificate photo corresponding to the certificate category to be used.
The specific implementation principle of this step is the same as that of S107, and the only difference from S107 is that the execution subject of S107 is the client, and the execution subject of this step is the server.
S407, the server sends the certificate photo to the client.
In this embodiment of the present application, in the embodiments corresponding to fig. 1 and fig. 4, the client may store the certificate photo when the client obtains the certificate photo. In the embodiment of the application, the user can also select to purchase the remote printing and sending service through the client, and when the user selects to purchase the remote printing and sending service, the server can connect the certificate photo to the photo printer through the network to print the real object, and the customer service after printing can be mailed to the user according to the customer data.
The beneficial effects of the embodiment of the application include:
the beneficial effects are that:
in the embodiment of the application, after the server obtains the target image, the client or the server performs operations such as background color filling and image clipping on the target image according to the target image processing parameters to obtain the certificate photo, so that the process of obtaining the certificate photo from the target image is automatically completed, and compared with the method for performing post-editing processing on the shot image by professionals in the prior art, the method for generating the certificate photo provided by the embodiment of the application has higher efficiency.
The beneficial effects are that:
in the embodiment of the application, various certificate photos can be obtained in one generation process of the certificate photos, and compared with the prior art in which one charge is paid for generating one certificate photo, the generation scheme of the certificate photos provided by the embodiment of the application saves more cost.
Fig. 5 is a client provided in an embodiment of the present application, including: a first obtaining module 501, a first sending module 502, a first receiving module 503, a second obtaining module 504 and a processing module 505, wherein,
a first obtaining module 501, configured to obtain an initial image when a preset instruction is received; the initial image is an image of a certificate photo to be generated;
a first sending module 502, configured to send the initial image to the server.
A first receiving module 503, configured to receive a target image sent by a server; the target image is an image obtained by the server side through character recognition and background removal on the initial image through the trained convolutional neural network model; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology.
A second obtaining module 504, configured to obtain target image processing parameters; the target image processing parameters include at least: avatar fraction, background fill color, and image scale.
And the processing module 505 is configured to perform background filling and clipping on the target image according to the target image processing parameter, so as to obtain a certificate photo corresponding to the certificate category to be used.
Optionally, the second obtaining module 504 is configured to obtain target image processing parameters, and includes:
a second obtaining module 504, specifically configured to receive a type of a certificate to be used; and determining the image processing parameters corresponding to the certificate categories to be used from the preset corresponding relationship between the preset certificate categories and the image processing parameters to obtain the target image processing parameters.
Optionally, the first obtaining module 501 is configured to, in a case that a preset instruction is received, obtain an initial image, and includes:
the first obtaining module 501 is specifically configured to drive a camera to take a picture, so as to obtain an initial image stored in a preset file; reading an initial image from a preset file.
Optionally, the processing module 505 is configured to perform background filling and clipping on the target image according to the target image processing parameter, so as to obtain the certificate photo corresponding to the certificate category to be used, and includes:
a processing module 505, configured to specifically fill the background of the target image according to the background filling color in the target image processing parameter, so as to obtain an image after background filling;
and cutting the image after the background is filled according to the head portrait proportion and the image proportion in the target image processing parameters to obtain the certificate photo corresponding to the type of the certificate to be used.
The client provided by the embodiment can generate the certificate photo and can generate the certificate photo quickly.
Fig. 6 is a server according to an embodiment of the present application, including: a generating module 601 and a second sending module 602, wherein,
the generating module 601 is configured to, in a case that an initial image sent by a client is received, input the initial image into a trained convolutional neural network model to perform person identification and background removal, so as to obtain a target image; the initial image is an image of a certificate photo to be generated; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology;
and a second sending module 602, configured to send the target image to the client.
Fig. 7 is a further client provided in the embodiment of the present application, including: a third acquiring module 701, a second receiving module 702, a third sending module 703 and a third receiving module 704, wherein,
a third obtaining module 701, configured to obtain an initial image when a preset instruction is received; the initial image is the image of the certificate photo to be generated.
A second receiving module 702, configured to receive a parameter to be processed; the parameters to be processed are the condition parameters needed for generating the certificate photo.
A third sending module 703, configured to send the initial image and the parameter to be processed to the server.
A third receiving module 704, configured to receive a certificate photo corresponding to the parameter to be processed and sent by the server; the certificate photo corresponding to the certificate category to be used is a server, the initial image is input into the trained convolutional neural network model for character recognition and background removal to obtain a target image, and the server fills and cuts the background of the target image according to the parameters to be processed to obtain the target image; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology.
The client provided by the embodiment can generate the certificate photo and can generate the certificate photo quickly.
Fig. 8 is a further server according to an embodiment of the present application, including: an input module 801, a determination module 802, an execution module 803, and a fourth sending module 804, wherein,
the input module 801 is configured to, under the condition that an initial image and parameters to be processed sent by a client are received, input the initial image into a trained convolutional neural network model for character recognition and background removal to obtain a target image; the initial image is an image of a certificate photo to be generated; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology; the parameters to be processed are the condition parameters needed for generating the certificate photo.
A determining module 802, configured to determine an image processing parameter indicated by a parameter to be processed and used for processing a target image, to obtain a target image processing parameter; the target image processing parameters include at least: avatar fraction, background fill color, and image scale.
And the executing module 803 is configured to perform background filling and clipping on the target image according to the target image processing parameter, so as to obtain a certificate photo corresponding to the type of the certificate to be used.
A fourth sending module 804, configured to send the certificate photo to the client.
Optionally, the parameters to be processed include the type of the certificate to be used; the determining module 802 is configured to determine an image processing parameter indicated by the parameter to be processed and used for processing the target image, and obtain the target image processing parameter, where the determining module includes:
the determining module 802 is specifically configured to determine an image processing parameter corresponding to a certificate category to be used from a preset corresponding relationship between a preset certificate category and an image processing parameter, so as to obtain a target image processing parameter.
The functions described in the method of the embodiment of the present application, if implemented in the form of software functional units and sold or used as independent products, may be stored in a storage medium readable by a computing device. Based on such understanding, part of the contribution of the embodiments of the present application to the prior art or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and including several instructions to enable a computing device (which may be a personal computer, a server, a mobile computing device, or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A generation method of certificate photos is applied to a client and comprises the following steps:
acquiring an initial image under the condition of receiving a preset instruction; the initial image is an image of a certificate photo to be generated;
sending the initial image to a server;
receiving a target image sent by the server; the target image is an image obtained by the server side through character recognition and background removal on the initial image through a trained convolutional neural network model; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology;
acquiring target image processing parameters; the target image processing parameters include at least: head portrait ratio, background fill color, and image scale;
and according to the target image processing parameters, carrying out background filling and cutting on the target image to obtain a certificate photo.
2. The method of claim 1, wherein the obtaining target image processing parameters comprises:
receiving the type of the certificate to be used;
and determining the image processing parameters corresponding to the certificate categories to be used from the preset corresponding relationship between the preset certificate categories and the image processing parameters to obtain the target image processing parameters.
3. The method of claim 1, wherein said acquiring an initial image comprises:
driving a camera to shoot to obtain the initial image stored in a preset file;
and reading the initial image from the preset file.
4. The method of claim 1, wherein the background filling and cropping the target image according to the target image processing parameters to obtain the certificate photo corresponding to the certificate category to be used comprises:
filling the background of the target image according to the background filling color in the target image processing parameters to obtain an image with the filled background;
and cutting the image after the background is filled according to the head portrait proportion and the image proportion in the target image processing parameters to obtain the certificate photo corresponding to the type of the certificate to be used.
5. A method for generating a certificate photo is applied to a server and comprises the following steps:
under the condition of receiving an initial image sent by a client, inputting the initial image into a trained convolutional neural network model for character recognition and background removal to obtain a target image; the initial image is an image of a certificate photo to be generated; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology;
and sending the target image to the client.
6. A generation method of certificate photos is applied to a client and comprises the following steps:
acquiring an initial image under the condition of receiving a preset instruction; the initial image is an image of a certificate photo to be generated;
receiving parameters to be processed; the parameters to be processed are condition parameters required for generating certificate photos;
sending the initial image and the parameter to be processed to a server;
receiving a certificate photo which is sent by the server and corresponds to the parameter to be processed; the certificate photo corresponding to the certificate category to be used is the server, the initial image is input into the trained convolutional neural network model for character recognition and background removal, a target image is obtained, and the server fills and cuts the background of the target image according to the parameter to be processed; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology.
7. A method for generating a certificate photo is applied to a server and comprises the following steps:
under the condition of receiving an initial image and parameters to be processed sent by a client, inputting the initial image into a trained convolutional neural network model for character recognition and background removal to obtain a target image; the initial image is an image of a certificate photo to be generated; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology; the parameters to be processed are condition parameters required for generating certificate photos;
determining image processing parameters which are indicated by the parameters to be processed and used for processing the target image to obtain target image processing parameters; the target image processing parameters include at least: head portrait ratio, background fill color, and image scale;
according to the target image processing parameters, carrying out background filling and cutting on the target image to obtain a certificate photo corresponding to the type of the certificate to be used;
and sending the certificate photo to the client.
8. The method of claim 7, wherein the parameters to be processed include a category of credentials to be used; the determining the image processing parameters indicated by the parameters to be processed and used for processing the target image to obtain the target image processing parameters includes:
and determining the image processing parameters corresponding to the certificate categories to be used from the preset corresponding relationship between the preset certificate categories and the image processing parameters to obtain the target image processing parameters.
9. A client, comprising:
the first acquisition module is used for acquiring an initial image under the condition of receiving a preset instruction; the initial image is an image of a certificate photo to be generated;
the first sending module is used for sending the initial image to a server;
the first receiving module is used for receiving a target image sent by the server; the target image is an image obtained by the server side through character recognition and background removal on the initial image through a trained convolutional neural network model; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology;
the second acquisition module is used for acquiring target image processing parameters; the target image processing parameters include at least: head portrait ratio, background fill color, and image scale;
and the processing module is used for carrying out background filling and cutting on the target image according to the target image processing parameters to obtain the certificate photo corresponding to the type of the certificate to be used.
10. A server, comprising:
the generating module is used for inputting the initial image into the trained convolutional neural network model for character recognition and background removal under the condition of receiving the initial image sent by the client to obtain a target image; the initial image is an image of a certificate photo to be generated; the trained convolutional neural network model is obtained by training a preset convolutional neural network model through a deep learning technology;
and the second sending module is used for sending the target image to the client.
CN202010191062.0A 2020-03-18 2020-03-18 Certificate photo generation method, client and server Pending CN111383176A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010191062.0A CN111383176A (en) 2020-03-18 2020-03-18 Certificate photo generation method, client and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010191062.0A CN111383176A (en) 2020-03-18 2020-03-18 Certificate photo generation method, client and server

Publications (1)

Publication Number Publication Date
CN111383176A true CN111383176A (en) 2020-07-07

Family

ID=71222723

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010191062.0A Pending CN111383176A (en) 2020-03-18 2020-03-18 Certificate photo generation method, client and server

Country Status (1)

Country Link
CN (1) CN111383176A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112927330A (en) * 2021-03-17 2021-06-08 北京七维视觉传媒科技有限公司 Method and system for generating virtual human body image

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107578439A (en) * 2017-07-19 2018-01-12 阿里巴巴集团控股有限公司 Generate the method, apparatus and equipment of target image
CN108764370A (en) * 2018-06-08 2018-11-06 Oppo广东移动通信有限公司 Image processing method, device, computer readable storage medium and computer equipment
CN108986132A (en) * 2018-07-04 2018-12-11 华南理工大学 A method of certificate photo Trimap figure is generated using full convolutional neural networks
CN110889855A (en) * 2019-10-28 2020-03-17 公安部交通管理科学研究所 Certificate photo matting method and system based on end-to-end convolutional neural network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107578439A (en) * 2017-07-19 2018-01-12 阿里巴巴集团控股有限公司 Generate the method, apparatus and equipment of target image
CN108764370A (en) * 2018-06-08 2018-11-06 Oppo广东移动通信有限公司 Image processing method, device, computer readable storage medium and computer equipment
CN108986132A (en) * 2018-07-04 2018-12-11 华南理工大学 A method of certificate photo Trimap figure is generated using full convolutional neural networks
CN110889855A (en) * 2019-10-28 2020-03-17 公安部交通管理科学研究所 Certificate photo matting method and system based on end-to-end convolutional neural network

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112927330A (en) * 2021-03-17 2021-06-08 北京七维视觉传媒科技有限公司 Method and system for generating virtual human body image
CN112927330B (en) * 2021-03-17 2024-04-26 北京七维视觉传媒科技有限公司 Method and system for generating virtual human body image

Similar Documents

Publication Publication Date Title
US7675635B2 (en) Apparatus, method, and program for editing images for a photo album
US7746487B2 (en) Apparatus, method, and program for selecting images in a photo album
JP4344925B2 (en) Image processing apparatus, image processing method, and printing system
CN101923644B (en) Image processing method, image processing apparatus and image forming apparatus
US20050219665A1 (en) Apparatus, method, and program for editing images
US20090017795A1 (en) Method for enhancing services concerning multimedia data in mobile telephony
JP2007087234A (en) Image processing method and apparatus, and program
KR100841657B1 (en) Image processing apparatus, and control method and program of the same
US8169652B2 (en) Album creating system, album creating method and creating program with image layout characteristics
CN101084670A (en) Apparatus, method and program for information processing
US20220319215A1 (en) Image processing method, device, electronic apparatus, and storage medium
CN102541484A (en) Image processing apparatus, image processing method, print order receiving apparatus, and print order receiving method
CN111383176A (en) Certificate photo generation method, client and server
CN103810740A (en) Picture-story book making apparatus and making method
TWI682327B (en) Image integrated printing system and image integrated printing method
JP4926589B2 (en) Image composition apparatus, image composition method, and program
JP2006113658A (en) Image processing apparatus and method, and storage medium with program recorded thereon
CN113177556A (en) Text image enhancement model, training method, enhancement method and electronic equipment
JP5009864B2 (en) Candidate image display method, apparatus, and program
JP2010045462A (en) Image processor
CN100511267C (en) Graph and text image processing equipment and image processing method thereof
JP7147172B2 (en) PRINT MATERIAL MAKING SYSTEM AND PRINT MATERIAL MAKING METHOD
JP2006172333A (en) Print order processing system and print order processing method
JP4191792B1 (en) Mosaic image generating apparatus, method and program
JP2005039801A (en) Image processing system, image processing method, and program

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