CN112165571B - Certificate image acquisition method, device and equipment - Google Patents

Certificate image acquisition method, device and equipment Download PDF

Info

Publication number
CN112165571B
CN112165571B CN202010941425.8A CN202010941425A CN112165571B CN 112165571 B CN112165571 B CN 112165571B CN 202010941425 A CN202010941425 A CN 202010941425A CN 112165571 B CN112165571 B CN 112165571B
Authority
CN
China
Prior art keywords
certificate
target
image acquisition
acquisition frame
determining
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
CN202010941425.8A
Other languages
Chinese (zh)
Other versions
CN112165571A (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.)
Alipay Labs Singapore Pte Ltd
Original Assignee
Alipay Labs Singapore Pte 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 Alipay Labs Singapore Pte Ltd filed Critical Alipay Labs Singapore Pte Ltd
Priority to CN202010941425.8A priority Critical patent/CN112165571B/en
Publication of CN112165571A publication Critical patent/CN112165571A/en
Application granted granted Critical
Publication of CN112165571B publication Critical patent/CN112165571B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/50Constructional details
    • H04N23/53Constructional details of electronic viewfinders, e.g. rotatable or detachable
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Image Analysis (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the specification discloses a certificate image acquisition method, a certificate image acquisition device and certificate image acquisition equipment, wherein the method comprises the following steps: when a target certificate enters a camera shooting range displayed on a screen, acquiring a first image of the target certificate, and determining the type of the target certificate based on the first image and a preset certificate classification model; determining a certificate template corresponding to the target certificate based on the type of the target certificate, and displaying the certificate template in a certificate image acquisition frame on a screen, wherein the certificate template comprises at least one auxiliary positioning pattern; after guiding a user to place a target certificate into a certificate image acquisition frame based on an auxiliary positioning pattern, detecting whether the edge of the target certificate is aligned with the certificate image acquisition frame based on a preset edge alignment algorithm, and acquiring a certificate image of the target certificate by taking the certificate image acquisition frame as a boundary if the edge of the target certificate is aligned with the certificate image acquisition frame.

Description

Certificate image acquisition method, device and equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for acquiring a certificate image.
Background
With the development of network and terminal technologies, more and more services can be processed through terminals, and the processing of many services in industries such as securities, banks, insurance and the like can be realized through terminal devices such as mobile phones and the like. When these services are handled through a terminal device, it is often necessary to scan the relevant certificate of the user to obtain the certificate image of the user, so as to authenticate the identity of the user.
At present, in the process of scanning a certificate of a user and acquiring a certificate image by a client, a user needs to be prompted to manually select a certificate type, and the user is repeatedly prompted to place the certificate in a target area so as to acquire the certificate image meeting conditions. The acquisition mode can lead to overlong acquisition time and even failure of acquisition, is not ideal enough, and needs to be improved urgently.
Disclosure of Invention
The embodiment of the specification provides a certificate image acquisition method, a certificate image acquisition device and certificate image acquisition equipment, so as to provide a better certificate image acquisition scheme.
In order to solve the above technical problem, the embodiments of the present specification are implemented as follows:
in a first aspect, a method for acquiring a document image is provided, including:
when a target certificate enters a camera shooting range displayed on a screen, acquiring a first image of the target certificate, and determining the type of the target certificate based on the first image and a preset certificate classification model;
determining a certificate template corresponding to the target certificate based on the type of the target certificate, and displaying the certificate template in a certificate image acquisition frame on the screen, wherein the certificate template comprises at least one auxiliary positioning pattern, and the appearance of the certificate image acquisition frame is matched with that of the certificate template;
after guiding a user to place the target certificate into the certificate image acquisition frame based on the auxiliary positioning pattern, detecting whether the edge of the target certificate is aligned with the certificate image acquisition frame based on a preset edge alignment algorithm;
and after the edge of the target certificate is aligned with the certificate image acquisition frame, acquiring the certificate image of the target certificate by taking the certificate image acquisition frame as a boundary.
In a second aspect, a document image capture device is provided, comprising:
the classification module is used for collecting a first image of the target certificate when the target certificate enters a camera shooting range displayed on a screen, and determining the type of the target certificate based on the first image and a preset certificate classification model;
the template display module is used for determining a certificate template corresponding to the target certificate based on the type of the target certificate and displaying the certificate template in a certificate image acquisition frame on the screen, wherein the certificate template comprises at least one auxiliary positioning pattern, and the appearance of the certificate image acquisition frame is matched with that of the certificate template;
the edge alignment detection module is used for detecting whether the edge of the target certificate is aligned with the certificate image acquisition frame or not based on a preset edge alignment algorithm after guiding a user to place the target certificate into the certificate image acquisition frame based on the auxiliary positioning pattern;
and the image acquisition module is used for acquiring the certificate image of the target certificate by taking the certificate image acquisition frame as a boundary after the edge of the target certificate is aligned with the certificate image acquisition frame.
In a third aspect, an electronic device is provided, including:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
when a target certificate enters a camera shooting range displayed on a screen, acquiring a first image of the target certificate, and determining the type of the target certificate based on the first image and a preset certificate classification model;
determining a certificate template corresponding to the target certificate based on the type of the target certificate, and displaying the certificate template in a certificate image acquisition frame on the screen, wherein the certificate template comprises at least one auxiliary positioning pattern, and the appearance of the certificate image acquisition frame is matched with that of the certificate template;
after guiding a user to place the target certificate into the certificate image acquisition frame based on the auxiliary positioning pattern, detecting whether the edge of the target certificate is aligned with the certificate image acquisition frame based on a preset edge alignment algorithm;
and after the edge of the target certificate is aligned with the certificate image acquisition frame, acquiring the certificate image of the target certificate by taking the certificate image acquisition frame as a boundary.
In a fourth aspect, a computer-readable storage medium is presented, the computer-readable storage medium storing one or more programs that, when executed by an electronic device that includes a plurality of application programs, cause the electronic device to:
when a target certificate enters a camera shooting range displayed on a screen, acquiring a first image of the target certificate, and determining the type of the target certificate based on the first image and a preset certificate classification model;
determining a certificate template corresponding to the target certificate based on the type of the target certificate, and displaying the certificate template in a certificate image acquisition frame on the screen, wherein the certificate template comprises at least one auxiliary positioning pattern, and the appearance of the certificate image acquisition frame is matched with that of the certificate template;
after guiding a user to place the target certificate into the certificate image acquisition frame based on the auxiliary positioning pattern, detecting whether the edge of the target certificate is aligned with the certificate image acquisition frame based on a preset edge alignment algorithm;
and after the edge of the target certificate is aligned with the certificate image acquisition frame, acquiring the certificate image of the target certificate by taking the certificate image acquisition frame as a boundary.
According to at least one technical scheme provided by the embodiment of the specification, on one hand, when the target certificate enters a camera shooting range displayed on a screen, a first image of the target certificate is collected, and the type of the target certificate is automatically determined based on the first image and a preset certificate classification model, so that the operation of manually selecting the certificate type by a user is avoided; on the other hand, the certificate template which is corresponding to the target certificate and contains at least one auxiliary positioning pattern can be determined based on the type of the target certificate and is displayed in the certificate image acquisition frame on the screen, so that a user is guided to more accurately place the target certificate in the certificate image acquisition frame, the edge of the target certificate is aligned with the certificate image acquisition frame, and a certificate image which meets the conditions is acquired. Therefore, the time for acquiring the certificate image can be shortened, the condition of acquisition failure is avoided, and the acquisition experience of a user is greatly improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic flow chart diagram of a method for capturing a document image according to one embodiment of the present disclosure.
FIG. 2 is one of the schematic diagrams of an exemplary image capture interface variation of a document provided by the present specification.
FIG. 3 is a second schematic diagram of an exemplary image capture interface variation of a document provided in the present specification.
FIG. 4 is a third schematic diagram of an exemplary image capture interface variation of a document provided by the present disclosure.
Fig. 5 is one of the schematic diagrams of an edge alignment algorithm provided by an embodiment of the present disclosure.
Fig. 6 is a second schematic diagram of the principle of an edge alignment algorithm provided in an embodiment of the present disclosure.
FIG. 7 is a schematic flow chart diagram of a method for capturing an image of a document according to another embodiment of the present disclosure.
FIG. 8 is a schematic flow chart diagram of a method for capturing an image of a document according to another embodiment of the present disclosure.
FIG. 9 is one of the variations of another exemplary credential image capture interface provided in this specification.
FIG. 10 is a second schematic view of another exemplary credential image capture interface variation provided by the present specification.
Fig. 11 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification.
FIG. 12 is a schematic diagram of a document image capture device according to one embodiment of the present disclosure.
FIG. 13 is a schematic diagram of a document image capture device according to another embodiment of the present disclosure.
FIG. 14 is a schematic diagram of a credential image capture device provided in another embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some 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 in the present application without making any creative effort, shall fall within the protection scope of this document.
In order to solve the problem that the acquisition of a certificate image is too long and acquisition failure is easy to occur in the related art, embodiments of the present specification provide a certificate image acquisition method, apparatus and device, where the method and apparatus may be executed by an electronic device, specifically, by a terminal device or software installed in the terminal device. Wherein the terminal device includes but is not limited to: any one of smart terminal devices such as a smart phone, a Personal Computer (PC), a notebook computer, a tablet computer, an electronic reader, a web tv, and a wearable device. The method and the device can be applied to any scene needing to acquire the certificate image.
A method for capturing an image of a document will be described.
As shown in fig. 1, an embodiment of the present specification provides a document image capture method, which may include:
step 102, start.
And step 104, responding to the client starting instruction, and displaying a certificate image acquisition interface in the screen.
In practical application, a user opens a client, clicks to enter a certificate image acquisition interface, and the certificate image acquisition interface is displayed in a screen. FIG. 2 illustrates a schematic view of an exemplary credential image capture interface. As shown in fig. 2, after entering the certificate image capture interface, a camera shooting range 21 is displayed in the interface, and a certificate image capture frame 22 is displayed in the camera shooting range 21. The certificate image acquisition frame is used for framing the range of the finally acquired certificate image, and generally, after a user puts a certificate into the certificate image acquisition frame, the certificate image is acquired by taking the certificate image acquisition frame as a boundary.
And 106, when the target certificate enters the camera shooting range displayed on the screen, acquiring a first image of the target certificate, and determining the type of the target certificate based on the first image and a preset certificate classification model.
The target certificate is a certificate of an image to be acquired held by a user.
Generally, when the whole target certificate or a preset part (such as a part including a head portrait and a chip) of the target certificate enters the camera shooting range 21 shown in fig. 2, an image of the target certificate is collected as a first image, and the first image is input into a preset certificate classification model obtained through pre-training, so as to obtain the type of the target certificate.
As an example, the preset certificate classification model may be a Convolutional Neural Network (CNN) model trained in advance for a sample based on images of multiple types of certificates (which may be thousands of existing identity certificates). Of course, the preset certificate classification model may also be a classification model obtained by training based on other algorithms, which is not limited in this specification.
And 108, determining a certificate template corresponding to the target certificate based on the type of the target certificate, and displaying the certificate template in a certificate image acquisition frame on a screen, wherein the certificate template comprises at least one auxiliary positioning pattern, and the shape of the certificate image acquisition frame is matched with that of the certificate template.
Correspondingly, a plurality of certificate templates can be correspondingly made and correspondingly stored for various types of certificates, wherein the various types comprise the types of the target certificates. Therefore, after the type of the target certificate is determined, the certificate template corresponding to the certificate of the type can be found based on the target certificate type.
Specifically, for a type of document, the document template includes at least one auxiliary positioning pattern, the at least one auxiliary positioning pattern may be determined based on at least one mark included in the type of document, and a position of one auxiliary positioning pattern in the document template is consistent with a position, an outline (e.g., contour) and a proportion of a corresponding mark in the type of document.
Optionally, before step 108, at least one mark included in a corresponding type of document (including the type of the target document) may be marked in the image of the document, for example, an identification card, at least one mark such as a face, a country symbol or a mark may be marked; and determining at least one secondary positioning pattern contained in a document template for the type of document based on the at least one mark. Then, in step 108, the certificate template is displayed together with the auxiliary positioning pattern contained therein, as shown in fig. 3, the certificate template is displayed in the certificate image capturing frame 22, and the certificate template contains a face auxiliary positioning pattern 23.
When the at least one mark included in the certificate of the type is marked in the image of the corresponding type of certificate, the at least one mark included in the certificate of the type can be marked manually, or can be marked automatically based on a preset mark detection model and the image of the certificate of the type. The preset mark detection model can be obtained through supervised training based on a large number of certificate images in advance.
Optionally, for convenience of management, the marks in the certificates with the same shape and different types may be normalized, so that the sizes of the certificate templates corresponding to the certificates with the same shape and different types are uniform.
The matching of the shape of the certificate image acquisition frame and the shape of the certificate template of the target certificate can be understood as that the shape of the certificate image acquisition frame and the shape of the certificate image acquisition frame are the same, the size of the certificate image acquisition frame and the placing direction and the position of the certificate image acquisition frame are the same, or the outlines of the certificate image acquisition frame and the certificate template of the target certificate are completely overlapped. The document template of the target document is typically displayed as a mask in the document image capture frame.
Optionally, if the shape of the certificate image capture frame does not match the shape of the certificate template of the target certificate, adjusting the certificate image capture frame so that the shape of the certificate image capture frame matches the shape of the certificate template of the target certificate. For example, when the credential image capture frame is a transverse rectangle and the profile of the credential template of the target credential is an upright rectangle, the credential image capture frame needs to be adjusted from a transverse orientation to a vertical orientation, and if the size and scale (aspect ratio) of the credential image capture frame is not consistent with the profile of the credential template of the target credential, the size and scale of the credential image capture frame also needs to be adjusted.
And 110, guiding a user to place the target certificate into the certificate image acquisition frame based on the auxiliary positioning pattern.
In a specific embodiment, if the secondary positioning pattern is determined based on a mark contained in a corresponding type of document, the step 110 may include: determining at least one token included in a target document based on a type of the target document; and prompting a user to move the mark in the target certificate to the position of the auxiliary positioning pattern corresponding to the mark, and matching the size of the mark with the size of the corresponding auxiliary positioning pattern so as to guide the user to place the target certificate in the certificate image acquisition frame. For example, as shown in fig. 3, the user is prompted to move the face mark in the target document to the position of the face auxiliary positioning pattern 23, and the face mark in the target document and the face auxiliary positioning pattern 23 are overlapped as much as possible, so as to achieve the purpose of guiding the user to place the identity card in the document image capturing frame 22.
In a second specific embodiment, if the secondary positioning pattern is determined based on a mark contained in a corresponding type of document, the step 110 may comprise: detecting at least one mark contained in the target certificate based on the preset mark detection model and the first image; and tracking the detected mark, prompting a user to move the mark in the target certificate to the position of the auxiliary positioning pattern corresponding to the mark, and matching the size of the mark and the size of the corresponding auxiliary positioning pattern so as to guide the user to place the target certificate in the certificate image acquisition frame. For example, as shown in fig. 3, the face mark in the target document may be automatically detected and tracked, and then the user is prompted to move the face mark in the target document to the position where the face auxiliary positioning pattern 23 is located, and the face mark in the target document and the face auxiliary positioning pattern 23 are overlapped as much as possible, so as to achieve the purpose of guiding the user to place the identity card in the document image collection frame 22.
In a third specific embodiment, if the secondary positioning pattern is determined based on a mark included in a corresponding type of document, the document image capture frame is a non-rectangular quadrilateral frame, and the target document is rectangular, the step 110 may include: and after the user is prompted to incline the target certificate to a preset direction by a preset angle, moving the mark in the target certificate to the position of the auxiliary positioning pattern corresponding to the mark, and matching the size of the mark and the size of the corresponding auxiliary positioning pattern so as to guide the user to place the target certificate into the certificate image acquisition frame. As shown in fig. 4, the certificate image capturing frame is trapezoidal, and the target certificate is rectangular, so that the user can be prompted to hold the front end of the certificate in the certificate image capturing frame after the front end of the certificate is tilted downward by about 15 degrees, and then be prompted to move the face mark in the target certificate to the position of the face auxiliary positioning pattern 24, and the face mark in the target certificate and the face auxiliary positioning pattern 24 are overlapped as much as possible, so as to achieve the purpose of guiding the user to place the identity card in the certificate image capturing frame.
It should be noted that the third embodiment is proposed because some types of documents are provided with the anti-counterfeiting mark, and the anti-counterfeiting mark in the document image needs to be acquired according to a certain inclination angle to identify the anti-counterfeiting mark. That is to say, the certificate image collecting method provided in the embodiments of the present specification can also automatically guide the user to complete the collection of the anti-counterfeit mark, thereby further shortening the collecting time of the certificate image meeting the conditions.
112, detecting whether the edge of the target certificate is aligned with the certificate image acquisition frame or not based on a preset edge alignment algorithm; if so, step 114 is performed, otherwise as described below with respect to the embodiment shown in FIG. 5.
There are many kinds of preset edge alignment algorithms, two of which are listed below.
First, the preset edge alignment algorithm may be a line detection algorithm (hough transform of image processing) in the related art, and accordingly, the step 112 may include: and detecting whether the edge of the target certificate is aligned with the certificate image acquisition frame or not based on a straight line detection algorithm.
Secondly, the preset edge alignment algorithm may be an algorithm based on variance variation, and accordingly, the step 112 may include the following steps:
step 1, collecting a second image of the target certificate displayed in the certificate image collecting frame;
and 2, determining coordinates of the four sides of the certificate image acquisition frame in the screen, and drawing four small rectangles by taking the four sides as middle lines and preset lengths as widths respectively.
As shown in fig. 5, coordinates of four sides a, b, c and d of the certificate image capturing frame 22 in the screen are determined, and then four small rectangles are drawn with a, b, c and d as middle lines (or centers) and 2t (preset length) as width: r1, R2, R3 and R4.
Step 3, determining the variance of each row of pixels of the second image in a small rectangle taking the longitudinal side as a central line for the longitudinal side of the four sides, determining the score of the corresponding longitudinal side of the target certificate in the small rectangle based on the variance of each row of pixels, and determining whether the corresponding longitudinal side of the target certificate is aligned with the certificate image acquisition frame based on the score; and determining the variance of each column of pixels of the second image in a small rectangle taking the transverse side as a center line for the transverse side of the four sides, determining the score of the corresponding transverse side of the target certificate in the small rectangle based on the variance of each column of pixels, and determining whether the corresponding transverse side of the target certificate is aligned with the certificate image acquisition frame based on the score.
For example, as shown in fig. 6, for a longitudinal side a on the left side of the certificate image capture frame 22, the variance of each row of pixels (specifically, pixel values) of the second image in a small rectangle R1 with a as a center line is determined: f1, f2, …, fi, … and fn, wherein i is 1,2, …, n is a positive integer, and n represents the total number of rows of pixels in the small rectangle R1; then, a ratio of f2 to fn larger than f1 is determined, and based on the ratio, a score of a corresponding longitudinal side of the small rectangle R1 on which the target document exists is obtained; and finally, comparing whether the score is larger than a preset threshold value, if so, determining that the corresponding longitudinal edge of the target certificate is aligned with the edge a of the certificate image acquisition frame, otherwise, determining that the longitudinal edge of the target certificate is not aligned.
In the above example, the variance f1 of the first line is used as a reference, because the first line generally has no certificate edge and exists from the second line.
Similarly, for a lateral side c (d similarly) to the left of the document image capture box 22, the variance of the columns of pixels (specifically, pixel values) of the second image in a small rectangle R3 with c as the center line can be determined: f1, f2, …, fj, … and fm, wherein j is 1,2, …, m is a positive integer, and m represents the total column number of pixels in the small rectangle R3; then, a ratio of f2 to fm larger than f1 is determined, and based on the ratio, a score of the corresponding transverse side of the target document existing in the small rectangle R3 is obtained; and finally, comparing whether the score is larger than a preset threshold value, if so, determining that the corresponding transverse edge of the target certificate is aligned with the edge c of the certificate image acquisition frame, otherwise, determining that the transverse edge of the target certificate is not aligned.
And step 114, collecting the certificate image of the target certificate by taking the certificate image collection frame as a boundary.
On one hand, when a target certificate enters a camera shooting range displayed on a screen, a first image of the target certificate is collected, and the type of the target certificate is automatically determined based on the first image and a preset certificate classification model, so that the operation of manually selecting the certificate type by a user is avoided; on the other hand, the certificate template which is corresponding to the target certificate and contains at least one auxiliary positioning pattern can be determined based on the type of the target certificate and is displayed in the certificate image acquisition frame on the screen, so that a user is guided to more accurately place the target certificate in the certificate image acquisition frame, the edge of the target certificate is aligned with the certificate image acquisition frame, and a certificate image which meets the conditions is acquired. Therefore, the time for acquiring the certificate image can be shortened, the condition of acquisition failure is avoided, and the acquisition experience of a user is greatly improved.
Fig. 7 shows a method for capturing a document image according to another embodiment of the present disclosure, which may include, in addition to the above steps 102 to 112, as shown in fig. 7:
and step 116, in the case that the judgment result in the step 112 is negative, adjusting the certificate image acquisition frame based on the detected edge of the target certificate so that the edge of the target certificate is aligned with the certificate image acquisition frame, and then returning to execute the step 112.
The specific adjustment measure can be to reduce or enlarge the size of the certificate image acquisition frame, and optionally, the proportion (such as the length-width ratio) of the certificate image acquisition frame can be also adjusted appropriately.
Of course, the user can be prompted to place the target certificate into the certificate image acquisition frame again without adjusting the certificate image acquisition frame.
It can be understood that, in addition to the technical effect obtained by the certificate image capturing method provided by the embodiment shown in fig. 1, the certificate image capturing method provided by the embodiment shown in fig. 7 can automatically adjust the certificate image capturing frame to align the edge of the target certificate with the certificate image capturing frame, so that the trouble that a user needs to repeatedly and manually adjust the target certificate to just place the target certificate in the whole certificate image capturing frame can be further avoided, the certificate image capturing time can be further prolonged, the situation of capturing failure can be further avoided, and the capturing experience of the user can be improved as much as possible.
Fig. 8 shows a method for capturing a document image according to another embodiment of the present disclosure, which may include, in addition to the above steps 102 to 114, as shown in fig. 7:
and step 118, displaying the acquired certificate image of the target certificate, and prompting a user to confirm.
And 120, after the user confirms, confirming that the certificate image acquisition of the target certificate is finished.
First, as shown in fig. 9, the user may be guided to place the target document into the document image capturing frame 72 based on the face assist positioning pattern 73 in the document image capturing frame 72, and to align the edge of the target document with the document image capturing frame 72 as much as possible. Then, as shown in FIG. 10, after determining that the edge of the target document is aligned with the document image capture frame 72 based on the step 112, the step 114 is executed to capture and display the document image 73 of the target document on the screen for the user to confirm whether the document image is complete and clear, if the user selects "confirm", the capture is completed, and if the user selects "rephoto", the step S104 is executed again.
It can be understood that through the embodiment shown in fig. 8, the certificate image of the user collected by the client can be ensured to meet the use requirement, and the trouble that the user is prompted to rephotop after a certain time due to incomplete or unclear certificate image in the background of the client is avoided.
Optionally, in the embodiment shown in any one of fig. 1, 7 and 8, after the edge of the target document is aligned with the document image capture frame (step 112) and before capturing the document image of the target document with the document image capture frame as a boundary (step 114), the method may further comprise: and highlighting all edges of the certificate image acquisition frame based on a preset highlighting mode to inform a user that the edge of the target certificate is aligned with the certificate image acquisition frame and start to acquire the certificate image, so that the user experience is improved. The preset highlighting manner may include, but is not limited to, one of highlighting, highlighting in a preset color and flashing, and the like, as shown in fig. 3, 4 and 9, after the edge of the target certificate is aligned with the certificate image capturing frame, the certificate image capturing frame is turned blue.
The above is a description of embodiments of the method provided in this specification, and the electronic device provided in this specification is described below.
Fig. 11 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification. Referring to fig. 11, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 11, but that does not indicate only one bus or one type of bus.
And a memory for storing the program. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the certificate image acquisition device on a logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
when a target certificate enters a camera shooting range displayed on a screen, acquiring a first image of the target certificate, and determining the type of the target certificate based on the first image and a preset certificate classification model;
determining a certificate template corresponding to the target certificate based on the type of the target certificate, and displaying the certificate template in a certificate image acquisition frame on the screen, wherein the certificate template comprises at least one auxiliary positioning pattern, and the appearance of the certificate image acquisition frame is matched with that of the certificate template;
after guiding a user to place the target certificate into the certificate image acquisition frame based on the auxiliary positioning pattern, detecting whether the edge of the target certificate is aligned with the certificate image acquisition frame based on a preset edge alignment algorithm;
and after the edge of the target certificate is aligned with the certificate image acquisition frame, acquiring the certificate image of the target certificate by taking the certificate image acquisition frame as a boundary.
The certificate image acquisition method disclosed in the embodiment of fig. 1, 7 or 8 in the present specification can be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in one or more embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with one or more embodiments of the present disclosure may be embodied directly in hardware, in a software module executed by a hardware decoding processor, or in a combination of the hardware and software modules executed by a hardware decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device can also execute the certificate image acquisition method provided by the embodiment shown in fig. 1, fig. 7 or fig. 8, and the description of the electronic device is not repeated herein.
Of course, besides the software implementation, the electronic device in this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Embodiments of the present specification also propose a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, are capable of causing the portable electronic device to perform the method of the embodiment shown in fig. 1, 7 or 8, and in particular to perform the following:
when a target certificate enters a camera shooting range displayed on a screen, acquiring a first image of the target certificate, and determining the type of the target certificate based on the first image and a preset certificate classification model;
determining a certificate template corresponding to the target certificate based on the type of the target certificate, and displaying the certificate template in a certificate image acquisition frame on the screen, wherein the certificate template comprises at least one auxiliary positioning pattern, and the appearance of the certificate image acquisition frame is matched with that of the certificate template;
after guiding a user to place the target certificate into the certificate image acquisition frame based on the auxiliary positioning pattern, detecting whether the edge of the target certificate is aligned with the certificate image acquisition frame based on a preset edge alignment algorithm;
and after the edge of the target certificate is aligned with the certificate image acquisition frame, acquiring the certificate image of the target certificate by taking the certificate image acquisition frame as a boundary.
The following is a description of the apparatus provided in this specification.
As shown in fig. 12, one embodiment of the present description provides a credential image capture device 1200. in one software implementation, the device 1200 can include: a response on module 1201, a classification module 1202, a template display module 1203, a guidance module 1204, an edge alignment detection module 1205, and an image acquisition module 1206.
And the starting response module 1201 responds to the client starting instruction and displays the certificate image acquisition interface in the screen.
The classification module 1202 collects a first image of the target document when the target document enters a camera shooting range displayed on a screen, and determines the type of the target document based on the first image and a preset document classification model.
The template display module 1203 determines a certificate template corresponding to the target certificate based on the type of the target certificate, and displays the certificate template in a certificate image acquisition frame on a screen, where the certificate template includes at least one auxiliary positioning pattern, and the shape of the certificate image acquisition frame matches with the shape of the certificate template.
A guidance module 1204 that guides a user to place the target document into the document image capture frame based on the secondary positioning pattern.
An edge alignment detection module 1205 that detects whether the edge of the target document is aligned with the document image capture frame based on a preset edge alignment algorithm; if aligned, the image acquisition module 1206 described below is triggered, otherwise as described below with reference to the embodiment shown in FIG. 13.
And the image acquisition module 1206 acquires the certificate image of the target certificate by taking the certificate image acquisition frame as a boundary.
It should be noted that the certificate image capturing apparatus 1200 shown in fig. 12 can implement the method shown in fig. 1 and obtain the same technical effect, and the detailed content can refer to the method shown in fig. 1 and is not repeated.
Fig. 13 shows a credential image capture device provided by another embodiment of the present specification, and as shown in fig. 13, the device may further include, in addition to the above-mentioned opening response module 1201, classification module 1202, template display module 1203, guidance module 1204, edge alignment detection module 1205 and image capture module 1206: an acquisition frame adjustment module 1207.
The capture frame adjusting module 1207, when the determination result of the edge alignment detecting module 1205 is negative, adjusts the certificate image capture frame based on the detected edge of the target certificate, so that the edge of the target certificate is aligned with the certificate image capture frame, and then returns to trigger the edge alignment detecting module 1205.
It should be noted that the certificate image capturing apparatus 1200 shown in fig. 13 can implement the method shown in fig. 1 and obtain the same technical effect, and the detailed content can refer to the method shown in fig. 1 and is not repeated.
Fig. 14 shows a credential image capture device provided by another embodiment of the present specification, and as shown in fig. 14, the device may further include, in addition to the above-mentioned opening response module 1201, classification module 1202, template display module 1203, guidance module 1204, edge alignment detection module 1205, image capture module 1206, and capture frame adjustment module 1207: an image presentation module 1208 and an acquisition confirmation module 1209.
And the image display module 1208 is used for displaying the acquired certificate image of the target certificate and prompting the user to confirm.
And the collection confirmation module 1209 confirms that the certificate image collection of the target certificate is finished after the user confirms.
It should be noted that the certificate image capturing apparatus 1200 shown in fig. 14 can implement the method shown in fig. 1 and obtain the same technical effect, and the detailed content can refer to the method shown in fig. 1 and is not repeated.
Optionally, in the embodiment shown in any of fig. 12-14, credential image capture device 1200 can further include: the highlighting module is used for highlighting all edges of the certificate image acquisition frame based on a preset highlighting mode before the certificate image of the target certificate is acquired by taking the certificate image acquisition frame as a boundary so as to inform a user that the edge of the target certificate is aligned with the certificate image acquisition frame and start to acquire the certificate image, thereby improving the user experience.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of the present disclosure should be included in the scope of protection of one or more embodiments of the present disclosure.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. 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 apparatus that comprises the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

Claims (13)

1. A method of document image capture, comprising:
when a target certificate enters a camera shooting range displayed on a screen, acquiring a first image of the target certificate, and determining the type of the target certificate based on the first image and a preset certificate classification model;
determining a certificate template corresponding to the target certificate based on the type of the target certificate, and displaying the certificate template in a certificate image acquisition frame on the screen, wherein the certificate template comprises at least one auxiliary positioning pattern, and the appearance of the certificate image acquisition frame is matched with that of the certificate template;
after guiding a user to place the target certificate into the certificate image acquisition frame based on the auxiliary positioning pattern, detecting whether the edge of the target certificate is aligned with the certificate image acquisition frame based on a preset edge alignment algorithm;
after the edge of the target certificate is aligned with the certificate image acquisition frame, acquiring a certificate image of the target certificate by taking the certificate image acquisition frame as a boundary;
under the condition that the edge of the target certificate is determined to be not aligned with the certificate image acquisition frame, adjusting the certificate image acquisition frame based on the detected edge of the target certificate to enable the edge of the target certificate to be aligned with the certificate image acquisition frame, and then executing the step of acquiring the certificate image of the target certificate by taking the certificate image acquisition frame as a boundary;
wherein, the certificate image acquisition frame is the rectangle, whether the edge based on predetermineeing the edge alignment algorithm detection target certificate with certificate image acquisition frame aligns includes:
collecting a second image of the target certificate displayed in the certificate image collection frame;
determining coordinates of four sides of the certificate image acquisition frame in the screen, and drawing four small rectangles by taking the four sides as middle lines and preset lengths as widths respectively;
for the longitudinal side of the four sides, determining the variance of each row of pixels of the second image in a small rectangle taking the longitudinal side as a central line, determining the ratio from the variance of the second row of pixels to the variance of the last row of pixels, which is larger than the variance of the first row of pixels, obtaining the score of the corresponding longitudinal side of the target certificate in the small rectangle based on the ratio, comparing whether the score is larger than a preset threshold value, if so, determining that the corresponding longitudinal side of the target certificate is aligned with the side of the certificate image acquisition frame, otherwise, determining that the longitudinal side of the target certificate is not aligned;
and for the transverse side of the four sides, determining the variance of each row of pixels of the second image in a small rectangle taking the transverse side as a central line, determining the proportion from the variance of the second row of pixels to the variance of the last row of pixels, which is greater than the variance of the first row of pixels, obtaining the score of the corresponding transverse side of the target certificate in the small rectangle based on the proportion, comparing whether the score is greater than a preset threshold value, if so, determining that the corresponding transverse side of the target certificate is aligned with the side of the certificate image acquisition frame, otherwise, determining that the transverse side of the target certificate is not aligned.
2. The method of claim 1, further comprising, prior to displaying the target credential template in a credential image capture frame displayed on the screen:
if the appearance of the certificate image acquisition frame is not matched with the appearance of the certificate template, the certificate image acquisition frame is adjusted, so that the appearance of the certificate image acquisition frame is matched with the appearance of the certificate template.
3. The method of claim 1, further comprising:
displaying the acquired certificate image of the target certificate, and prompting a user to confirm;
and after the user confirms, confirming that the certificate image acquisition of the target certificate is finished.
4. The method of claim 1, the secondary positioning pattern being determined based on indicia contained in the type of document, the method further comprising, prior to determining a document template to which the target document corresponds based on the type of target document:
marking out at least one mark contained in the type of document in an image of the type of document;
determining the at least one secondary positioning pattern included in the credential template based on the at least one mark.
5. The method of claim 4, wherein the marking out at least one mark contained in the type of document comprises:
marking at least one mark contained in the type of certificate based on a preset mark detection model and an image of the type of certificate.
6. The method of claim 4, further comprising:
and carrying out normalization processing on the marks in the certificates with the same shape and different types, so that the sizes of the certificate templates corresponding to the certificates with the same shape and different types are uniform.
7. The method of claim 1, the secondary positioning pattern being determined based on indicia contained in the type of document, wherein the guiding a user into the document image capture frame based on the secondary positioning pattern comprises:
determining at least one token included in the target document based on the type of the target document;
and prompting a user to move the mark in the target certificate to the position of the auxiliary positioning pattern corresponding to the mark, and matching the size of the mark with the size of the corresponding auxiliary positioning pattern so as to guide the user to place the target certificate in the certificate image acquisition frame.
8. The method of claim 1, the secondary positioning pattern being determined based on indicia contained in the type of document, wherein the guiding a user into the document image capture frame based on the secondary positioning pattern comprises:
detecting at least one mark contained in the target document based on a preset mark detection model and the first image;
and tracking the detected mark, prompting a user to move the mark in the target certificate to the position of the auxiliary positioning pattern corresponding to the mark, and matching the size of the mark and the size of the corresponding auxiliary positioning pattern so as to guide the user to place the target certificate in the certificate image acquisition frame.
9. The method of claim 1, the secondary positioning pattern being determined based on indicia contained in the type of document, the document image capture frame being a non-rectangular quadrilateral frame, and the target document being rectangular, wherein the guiding a user to place the target document within the document image capture frame based on the secondary positioning pattern comprises:
and after the user is prompted to incline the target certificate to a preset direction by a preset angle, moving the mark in the target certificate to the position of the auxiliary positioning pattern corresponding to the mark, and matching the size of the mark and the size of the corresponding auxiliary positioning pattern so as to guide the user to place the target certificate into the certificate image acquisition frame.
10. The method of any of claims 1-9, after aligning the edge of the target document with the document image capture frame, and before capturing the document image of the target document bounded by the document image capture frame, the method further comprising:
and highlighting all edges of the certificate image acquisition frame based on a preset highlighting mode.
11. A credential image capture device comprising:
the classification module is used for collecting a first image of the target certificate when the target certificate enters a camera shooting range displayed on a screen, and determining the type of the target certificate based on the first image and a preset certificate classification model;
the template display module is used for determining a certificate template corresponding to the target certificate based on the type of the target certificate and displaying the certificate template in a certificate image acquisition frame on the screen, wherein the certificate template comprises at least one auxiliary positioning pattern, and the appearance of the certificate image acquisition frame is matched with that of the certificate template;
the edge alignment detection module is used for detecting whether the edge of the target certificate is aligned with the certificate image acquisition frame or not based on a preset edge alignment algorithm after guiding a user to place the target certificate into the certificate image acquisition frame based on the auxiliary positioning pattern;
the image acquisition module is used for acquiring the certificate image of the target certificate by taking the certificate image acquisition frame as a boundary after the edge of the target certificate is aligned with the certificate image acquisition frame;
the acquisition frame adjusting module is used for adjusting the certificate image acquisition frame based on the detected edge of the target certificate under the condition that the edge of the target certificate is determined to be not aligned with the certificate image acquisition frame, so that the edge of the target certificate is aligned with the certificate image acquisition frame, and then the step of acquiring the certificate image of the target certificate by taking the certificate image acquisition frame as a boundary is executed;
wherein, the certificate image acquisition frame is the rectangle, edge alignment detection module specifically is used for:
collecting a second image of the target certificate displayed in the certificate image collection frame;
determining coordinates of four sides of the certificate image acquisition frame in the screen, and drawing four small rectangles by taking the four sides as middle lines and preset lengths as widths respectively;
for the longitudinal side of the four sides, determining the variance of each row of pixels of the second image in a small rectangle taking the longitudinal side as a central line, determining the ratio from the variance of the second row of pixels to the variance of the last row of pixels, which is larger than the variance of the first row of pixels, obtaining the score of the corresponding longitudinal side of the target certificate in the small rectangle based on the ratio, comparing whether the score is larger than a preset threshold value, if so, determining that the corresponding longitudinal side of the target certificate is aligned with the side of the certificate image acquisition frame, otherwise, determining that the longitudinal side of the target certificate is not aligned;
and for the transverse side of the four sides, determining the variance of each row of pixels of the second image in a small rectangle taking the transverse side as a central line, determining the proportion from the variance of the second row of pixels to the variance of the last row of pixels, which is greater than the variance of the first row of pixels, obtaining the score of the corresponding transverse side of the target certificate in the small rectangle based on the proportion, comparing whether the score is greater than a preset threshold value, if so, determining that the corresponding transverse side of the target certificate is aligned with the side of the certificate image acquisition frame, otherwise, determining that the transverse side of the target certificate is not aligned.
12. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
when a target certificate enters a camera shooting range displayed on a screen, acquiring a first image of the target certificate, and determining the type of the target certificate based on the first image and a preset certificate classification model;
determining a certificate template corresponding to the target certificate based on the type of the target certificate, and displaying the certificate template in a certificate image acquisition frame on the screen, wherein the certificate template comprises at least one auxiliary positioning pattern, and the appearance of the certificate image acquisition frame is matched with that of the certificate template;
after guiding a user to place the target certificate into the certificate image acquisition frame based on the auxiliary positioning pattern, detecting whether the edge of the target certificate is aligned with the certificate image acquisition frame based on a preset edge alignment algorithm;
after the edge of the target certificate is aligned with the certificate image acquisition frame, acquiring a certificate image of the target certificate by taking the certificate image acquisition frame as a boundary;
under the condition that the edge of the target certificate is determined to be not aligned with the certificate image acquisition frame, adjusting the certificate image acquisition frame based on the detected edge of the target certificate to enable the edge of the target certificate to be aligned with the certificate image acquisition frame, and then executing the step of acquiring the certificate image of the target certificate by taking the certificate image acquisition frame as a boundary;
wherein, the certificate image acquisition frame is the rectangle, whether the edge based on predetermineeing the edge alignment algorithm detection target certificate with certificate image acquisition frame aligns includes:
collecting a second image of the target certificate displayed in the certificate image collection frame;
determining coordinates of four sides of the certificate image acquisition frame in the screen, and drawing four small rectangles by taking the four sides as middle lines and preset lengths as widths respectively;
for the longitudinal side of the four sides, determining the variance of each row of pixels of the second image in a small rectangle taking the longitudinal side as a central line, determining the ratio from the variance of the second row of pixels to the variance of the last row of pixels, which is larger than the variance of the first row of pixels, obtaining the score of the corresponding longitudinal side of the target certificate in the small rectangle based on the ratio, comparing whether the score is larger than a preset threshold value, if so, determining that the corresponding longitudinal side of the target certificate is aligned with the side of the certificate image acquisition frame, otherwise, determining that the longitudinal side of the target certificate is not aligned;
and for the transverse side of the four sides, determining the variance of each row of pixels of the second image in a small rectangle taking the transverse side as a central line, determining the proportion from the variance of the second row of pixels to the variance of the last row of pixels, which is greater than the variance of the first row of pixels, obtaining the score of the corresponding transverse side of the target certificate in the small rectangle based on the proportion, comparing whether the score is greater than a preset threshold value, if so, determining that the corresponding transverse side of the target certificate is aligned with the side of the certificate image acquisition frame, otherwise, determining that the transverse side of the target certificate is not aligned.
13. A computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to:
when a target certificate enters a camera shooting range displayed on a screen, acquiring a first image of the target certificate, and determining the type of the target certificate based on the first image and a preset certificate classification model;
determining a certificate template corresponding to the target certificate based on the type of the target certificate, and displaying the certificate template in a certificate image acquisition frame on the screen, wherein the certificate template comprises at least one auxiliary positioning pattern, and the appearance of the certificate image acquisition frame is matched with that of the certificate template;
after guiding a user to place the target certificate into the certificate image acquisition frame based on the auxiliary positioning pattern, detecting whether the edge of the target certificate is aligned with the certificate image acquisition frame based on a preset edge alignment algorithm;
after the edge of the target certificate is aligned with the certificate image acquisition frame, acquiring a certificate image of the target certificate by taking the certificate image acquisition frame as a boundary;
under the condition that the edge of the target certificate is determined to be not aligned with the certificate image acquisition frame, adjusting the certificate image acquisition frame based on the detected edge of the target certificate to enable the edge of the target certificate to be aligned with the certificate image acquisition frame, and then executing the step of acquiring the certificate image of the target certificate by taking the certificate image acquisition frame as a boundary;
wherein, the certificate image acquisition frame is the rectangle, whether the edge based on predetermineeing the edge alignment algorithm detection target certificate with certificate image acquisition frame aligns includes:
collecting a second image of the target certificate displayed in the certificate image collection frame;
determining coordinates of four sides of the certificate image acquisition frame in the screen, and drawing four small rectangles by taking the four sides as middle lines and preset lengths as widths respectively;
for the longitudinal side of the four sides, determining the variance of each row of pixels of the second image in a small rectangle taking the longitudinal side as a central line, determining the ratio from the variance of the second row of pixels to the variance of the last row of pixels, which is larger than the variance of the first row of pixels, obtaining the score of the corresponding longitudinal side of the target certificate in the small rectangle based on the ratio, comparing whether the score is larger than a preset threshold value, if so, determining that the corresponding longitudinal side of the target certificate is aligned with the side of the certificate image acquisition frame, otherwise, determining that the longitudinal side of the target certificate is not aligned;
and for the transverse side of the four sides, determining the variance of each row of pixels of the second image in a small rectangle taking the transverse side as a central line, determining the proportion from the variance of the second row of pixels to the variance of the last row of pixels, which is greater than the variance of the first row of pixels, obtaining the score of the corresponding transverse side of the target certificate in the small rectangle based on the proportion, comparing whether the score is greater than a preset threshold value, if so, determining that the corresponding transverse side of the target certificate is aligned with the side of the certificate image acquisition frame, otherwise, determining that the transverse side of the target certificate is not aligned.
CN202010941425.8A 2020-09-09 2020-09-09 Certificate image acquisition method, device and equipment Active CN112165571B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010941425.8A CN112165571B (en) 2020-09-09 2020-09-09 Certificate image acquisition method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010941425.8A CN112165571B (en) 2020-09-09 2020-09-09 Certificate image acquisition method, device and equipment

Publications (2)

Publication Number Publication Date
CN112165571A CN112165571A (en) 2021-01-01
CN112165571B true CN112165571B (en) 2022-02-08

Family

ID=73857723

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010941425.8A Active CN112165571B (en) 2020-09-09 2020-09-09 Certificate image acquisition method, device and equipment

Country Status (1)

Country Link
CN (1) CN112165571B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112966680B (en) * 2021-03-19 2022-04-15 支付宝(杭州)信息技术有限公司 Certificate picture acquisition method and device and electronic equipment
CN113034356A (en) * 2021-04-22 2021-06-25 平安国际智慧城市科技股份有限公司 Photographing method and device, terminal equipment and storage medium
CN113743396B (en) * 2021-08-31 2023-11-10 支付宝(杭州)信息技术有限公司 Method and device for identifying injection attack in certificate identification process
CN114546230A (en) * 2022-02-18 2022-05-27 北京有竹居网络技术有限公司 Drawing interaction method and device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008018459A1 (en) * 2006-08-08 2008-02-14 Nikon Corporation Image processing method, image processing apparatus, image processing program, and image pickup apparatus
CN110472462A (en) * 2018-05-11 2019-11-19 北京三星通信技术研究有限公司 Attitude estimation method, the processing method based on Attitude estimation and electronic equipment

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103593642A (en) * 2012-08-16 2014-02-19 阿里巴巴集团控股有限公司 Card-information acquisition method and system
CN108429877B (en) * 2017-02-15 2021-08-13 腾讯科技(深圳)有限公司 Image acquisition method and mobile terminal
CN108133207A (en) * 2017-11-24 2018-06-08 阿里巴巴集团控股有限公司 The image of auxiliary items closes the method, apparatus and electronic equipment of rule
CN110213483A (en) * 2019-05-30 2019-09-06 苏宁金融服务(上海)有限公司 A kind of view-finder matching process and device for papers-scanning
CN110287913A (en) * 2019-06-28 2019-09-27 京东数字科技控股有限公司 Image flame detection reminding method and device, user terminal and storage medium
CN116758546A (en) * 2019-08-27 2023-09-15 创新先进技术有限公司 Certificate scanning method, device and equipment
CN111131702A (en) * 2019-12-25 2020-05-08 航天信息股份有限公司 Method and device for acquiring image, storage medium and electronic equipment
CN111159749B (en) * 2019-12-31 2022-08-09 Oppo广东移动通信有限公司 Photographing method, photographing device, mobile terminal and computer readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008018459A1 (en) * 2006-08-08 2008-02-14 Nikon Corporation Image processing method, image processing apparatus, image processing program, and image pickup apparatus
CN110472462A (en) * 2018-05-11 2019-11-19 北京三星通信技术研究有限公司 Attitude estimation method, the processing method based on Attitude estimation and electronic equipment

Also Published As

Publication number Publication date
CN112165571A (en) 2021-01-01

Similar Documents

Publication Publication Date Title
CN112165571B (en) Certificate image acquisition method, device and equipment
CN112333356B (en) Certificate image acquisition method, device and equipment
RU2641449C2 (en) Method and device for area identification
EP3163504B1 (en) Method, device and computer-readable medium for region extraction
KR101864759B1 (en) Method and device for identifying region
CN106295638B (en) Certificate image sloped correcting method and device
WO2017071061A1 (en) Region identification method and device
CN111027504A (en) Face key point detection method, device, equipment and storage medium
CN110869944B (en) Reading test cards using mobile devices
WO2020062804A1 (en) Method and apparatus for recognizing photographed image of driving license in natural scene and electronic device
KR20130126929A (en) Text image trimming method
CN103500337A (en) Quadrangular side frame identifying method and device applied to intelligent wireless communication terminal
WO2020097909A1 (en) Text detection method and apparatus, and storage medium
CN108769803B (en) Recognition method, cutting method, system, equipment and medium for video with frame
CN105894042B (en) The method and apparatus that detection certificate image blocks
WO2020224296A1 (en) Certificate verification and identity verification methods and apparatuses, and devices
CN111709414A (en) AR device, character recognition method and device thereof, and computer-readable storage medium
CN113379713B (en) Certificate image detection method and device
CN110909816B (en) Picture identification method and device
CN115546219B (en) Detection plate type generation method, plate card defect detection method, device and product
US9514451B2 (en) Method, apparatus and system for information identification
CN113221897A (en) Image correction method, image text recognition method, identity verification method and device
CN114359923A (en) Certificate character recognition method and device, computer and storage medium
CN115146646A (en) Method and system for completing bill OCR recognition based on intelligent terminal
CN111144288A (en) Image processing method and device and electronic equipment

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40043466

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant