CN112434687A - Picture detection method, device, equipment and storage medium - Google Patents

Picture detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN112434687A
CN112434687A CN202011386422.9A CN202011386422A CN112434687A CN 112434687 A CN112434687 A CN 112434687A CN 202011386422 A CN202011386422 A CN 202011386422A CN 112434687 A CN112434687 A CN 112434687A
Authority
CN
China
Prior art keywords
area
highlight
region
certificate
picture
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
CN202011386422.9A
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.)
Tianmian Information Technology Shenzhen Co ltd
Original Assignee
Tianmian Information Technology Shenzhen 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 Tianmian Information Technology Shenzhen Co ltd filed Critical Tianmian Information Technology Shenzhen Co ltd
Priority to CN202011386422.9A priority Critical patent/CN112434687A/en
Publication of CN112434687A publication Critical patent/CN112434687A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/50Extraction of image or video features by performing operations within image blocks; by using histograms, e.g. histogram of oriented gradients [HoG]; by summing image-intensity values; Projection analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Multimedia (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Biomedical Technology (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Biophysics (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Character Input (AREA)

Abstract

The invention relates to a picture detection method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring the uploaded certificate picture, and analyzing the certificate type of the certificate picture; if the certificate type of the certificate picture is the preset certificate type, rotating the certificate picture to enable the certificate picture to be in a positive placing state; acquiring a binary image of a certificate picture in a putting state, and acquiring a key information area based on the binary image; acquiring a histogram of a certificate picture in a normally placed state, and acquiring a highlight area of the certificate picture based on the histogram; analyzing whether the key information area and the highlight area have overlapped areas or not, and if the key information area and the highlight area have overlapped areas, analyzing whether the overlapped areas are light reflecting areas or not; if so, prompting to upload the certificate picture again, and if not, sending the certificate picture to a server for identification. The invention can improve the efficiency of certificate image recognition.

Description

Picture detection method, device, equipment and storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for detecting a picture.
Background
In the process of certificate collection, a terminal device shoots a certificate image and uploads the certificate image to a background server, and the background server performs character recognition and portrait recognition on the certificate. During identification, due to the influence of factors such as shooting environment light, shooting angle and the like, a shot certificate image may have a light reflection area, and text information and portrait information in the light reflection area cannot be identified, and need to be collected again by the terminal equipment and uploaded to the background server until the text information and the portrait information are successfully identified. Repeated shooting and waiting for the identification result can reduce the efficiency of certificate identification and waste the time of the client and the system resources.
Disclosure of Invention
The invention aims to provide a picture detection method, a picture detection device, picture detection equipment and a storage medium, and aims to improve the efficiency of certificate picture identification.
The invention provides a picture detection method, which comprises the following steps:
acquiring an uploaded certificate picture, and analyzing the certificate type of the certificate picture;
if the certificate type of the certificate picture is a preset certificate type, performing rotation processing on the certificate picture to enable the certificate picture to be in a positive placement state;
acquiring a binary image of a certificate picture in a putting state, and acquiring a key information area based on the binary image;
acquiring a histogram of a certificate picture in a putting state, and acquiring a highlight area of the certificate picture based on the histogram;
analyzing whether the key information area and the highlight area have overlapped areas or not, and if the key information area and the highlight area have overlapped areas, analyzing whether the overlapped areas are light reflecting areas or not;
if yes, the user is prompted to upload the certificate picture again, and if not, the certificate picture is sent to a server for recognition.
The present invention also provides a picture detection apparatus, comprising:
the analysis module is used for acquiring the uploaded certificate picture and analyzing the certificate type of the certificate picture;
the rotation module is used for performing rotation processing on the certificate picture if the certificate type of the certificate picture is a preset certificate type, so that the certificate picture is in a positive placement state;
the first acquisition module is used for acquiring a binary image of a certificate picture in a putting state and acquiring a key information area based on the binary image;
the second acquisition module is used for acquiring a histogram of the certificate picture in the putting state and acquiring a highlight area of the certificate picture based on the histogram;
the detection module is used for analyzing whether the key information area and the highlight area have a superposed area or not, and if the key information area and the highlight area have the superposed area, analyzing whether the superposed area is a light reflecting area or not;
and the processing module is used for prompting to upload the certificate picture again if the certificate picture is true, and sending the certificate picture to the server for identification if the certificate picture is false.
The invention also provides a computer device, which includes a memory and a processor connected to the memory, wherein the memory stores a computer program operable on the processor, and the processor executes the computer program to implement the steps of the picture detection method.
The present invention also provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the above-mentioned picture detection method.
The invention has the beneficial effects that: before the characters and the portrait in the certificate image are identified by the server, the key information area and the highlight area of the certificate image are acquired, whether the key information area and the highlight area are overlapped is analyzed, if the overlapped area exists, whether the overlapped area is a light reflection area is further analyzed, the key information cannot be accurately identified due to light reflection, if the key information is the light reflection area, shooting is directly carried out again, the server does not need to be waited for identification, and if the key information is detected to be not light reflection, the key information area and the highlight area are uploaded to the server for character identification and portrait identification.
Drawings
FIG. 1 is a schematic diagram of an application environment of an embodiment of a method for detecting a picture according to the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a method for detecting pictures according to the present invention;
FIG. 3 is a detailed flowchart of step S5 in FIG. 2;
FIG. 4 is a schematic structural diagram of an embodiment of an image detection apparatus according to the present invention;
FIG. 5 is a diagram illustrating a hardware architecture of an embodiment of a computer device according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. 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 invention.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Fig. 1 is a schematic view of an application environment of an embodiment of the picture detection method according to the present invention. In fig. 1, a computer device 1 is connected to a server 2 through a network, the computer device 1 acquires an uploaded certificate picture, detects the certificate picture, sends the certificate picture to the server 2 for identification if the certificate picture is detected to have no reflective area, and prompts a client to upload the certificate picture again if the certificate picture is detected to have a reflective area.
The method provided by the invention can be applied to the application environment as shown in FIG. 1. The computer device 1 may include, but is not limited to, various personal computers, notebook computers, tablet computers, smart phones, and portable wearable devices.
Fig. 2 is a schematic flow chart of a first embodiment of the picture detection method according to the present invention. Taking the application of the method in the environment of fig. 1 as an example, the method includes:
step S1, acquiring the uploaded certificate picture, and analyzing the certificate type of the certificate picture;
classifying the certificate pictures by using a pre-trained classifier to obtain certificate types corresponding to the certificate pictures;
the classifier can be constructed by collecting a large number of different certificate pictures, firstly, the type of each collected certificate picture is labeled, and then, the labeled certificate pictures are used as sample data and input into the classifier for training.
The classifier may adopt a common classification model, such as a CNN (convolutional neural network model), an RNN (recurrent neural network), an SVM (support vector machine) model, and the like, and the input is a certificate picture, and the output is a certificate type corresponding to the input certificate picture, or the output is a score that the input certificate picture belongs to various certificate types, in the latter case, the certificate type with the highest score may be obtained as the certificate type to which the corresponding certificate picture belongs.
Step S2, if the certificate type of the certificate picture is a preset certificate type, the certificate picture is rotated to be in a positive placing state;
wherein the predetermined credential types may include: identification cards, passports, drivers licenses, and the like. The step can carry out rotation processing on the certificate picture of the preset certificate type through two modes:
the first mode is as follows: through detecting the edge of certificate in the certificate picture, draw the edge line of certificate, judge according to edge line and horizontal direction's contained angle whether the certificate is in and just putting the state, if the contained angle is 0 degree, for just putting the state, if the contained angle is not 0 degree, then is not just putting the state, need rotate the certificate picture, the angle of rotatory angle is the angle of above-mentioned contained angle, until the document is in and just putting the state.
The second mode is as follows: the method can provide a deep learning model for classifying orientations of certificates in certificate pictures, input the certificate pictures into the trained deep learning model, obtain the orientations of the certificates in the certificate pictures, such as a first orientation of 45-135 degrees, a second orientation of 135-225 degrees, a third orientation of 225-315 degrees and a fourth orientation of 315-45 degrees, and rotate the orientations of the certificates in the certificate pictures according to angles corresponding to the orientations until the orientations are rotated to 0 degree. In order to improve the precision, the second mode can be followed by the first mode to perform further rotation processing so as to perform fine adjustment on the certificate picture.
The deep learning model is, for example, a CNN (convolutional neural network model), an RNN (recurrent neural network), and the like, and the classifier may be referred to above, which is not described herein again.
Step S3, acquiring a binary image of the certificate picture in the placing state, and acquiring a key information area based on the binary image;
the gray levels of the binary image in the image are only two, namely the gray level of any pixel point in the image is 0 or 255, and the gray levels represent black and white respectively.
In an embodiment mode, the image detection can be performed on the binary image by using the existing method to obtain a key information area; or, in another embodiment, templates corresponding to various certificate types can be manufactured in advance, and the templates include key information areas corresponding to the certificate types. And matching the binary image with a template corresponding to the certificate type to extract a key information area.
For the certificate picture, the key information area comprises a portrait area and each text area.
Step S4, acquiring a histogram of the certificate picture in the putting state, and acquiring a highlight area of the certificate picture based on the histogram;
the histogram is used for representing the distribution of the pixel values of the picture, a certain number of cells are used for specifying the range of the representing pixel values, and each cell can obtain the number of pixels falling into the representing range of the cell. The pixel values range from 0-255 for grayscale images.
For the histogram of the certificate picture, the area where the plurality of pixels with pixel values larger than the preset pixel value are located is determined as the highlight area, for example, the preset pixel value is 99% of the maximum pixel value in the histogram. The preset pixel value in this embodiment is not fixed, and different environments and angles for taking different certificate pictures are considered, so that the corresponding preset pixel value of each certificate picture needs to be determined according to each certificate picture, and thus, the highlight area of each certificate picture can be found out.
Step S5, analyzing whether the key information area and the highlight area have overlapped areas, and if so, analyzing whether the overlapped areas are light reflecting areas;
the embodiment analyzes whether the key information area and the highlight area of the certificate picture have overlapped areas, and if the key information area and the highlight area do not have overlapped areas, the certificate picture can be directly sent to a server for identifying the key information; if the overlapped area exists, whether the overlapped area reflects light needs to be further analyzed, key information cannot be identified due to light reflection, and the certificate picture needs to be uploaded again.
Further, as shown in fig. 3, the step S5 specifically includes:
step S51, analyzing whether each text area and the highlight area have overlapped areas, and if the text area and the highlight area have overlapped areas, analyzing whether the text area and the highlight area have overlapped areas as a light reflection area; and
and step S52, analyzing whether the portrait area and the highlight area have overlapped areas, and if so, analyzing whether the area where the portrait area and the highlight area are overlapped is a light reflecting area.
If a text area is overlapped with the highlight area, or a portrait area is overlapped with the highlight area, or the text area is overlapped with the highlight area and the portrait area is overlapped with the highlight area, specific analysis needs to be carried out on the overlapped area to judge whether the overlapped area reflects light.
Further, step S51 specifically includes:
for each text area, carrying out vertical projection, and acquiring a character area corresponding to the text area based on the vertical projection image;
if the character area and the highlight area have overlapped areas, calculating the definition of the area where the character area and the highlight area are overlapped, and if the definition is smaller than a preset first threshold value, determining the area where the character area and the highlight area are overlapped as a light reflecting area;
and performing binarization on each text region, and then performing vertical projection to obtain a vertical projection image. The character area and the character space area can be obtained by vertically projecting the image. For the character spacing region, the length thereof is the character spacing length. The two text regions may have the same or different character spacing lengths.
When the character area and the high-brightness area are overlapped, calculating the definition of the overlapped area of the character area and the high-brightness area by using a Laplacian operator, if the definition is smaller than a preset first threshold value, the overlapped area is a light reflecting area, and if the definition is larger than or equal to the preset first threshold value, the overlapped area is not the light reflecting area, so that the character can be normally recognized. Wherein the predetermined first threshold is determined from the a priori values.
The step S51 further includes:
acquiring a character interval region corresponding to the text region based on the vertical projection image;
if the character spacing area and the highlight area have overlapped areas and the length of the character spacing area is larger than or equal to a preset length threshold value, the area where the character spacing area and the highlight area are overlapped is a light reflecting area.
When the character spacing area and the highlight area have overlapped areas, and the length of the character spacing area is greater than or equal to a preset length threshold value, the overlapped areas are light reflecting areas. The preset length threshold value is a multiple of the character interval length in the text area, and the character interval length is increased if the characters are lost in consideration of the situation that the characters are lost, and the overlapped area is judged to be the light reflecting area in the situation. In order to obtain the true character interval length, in the vertically projected image, all the character interval lengths are analyzed, and a plurality of lengths having the same character interval length are taken as the true character interval length in the present embodiment, for example, for a certain text region, the 1 st character interval length is 2, the 2 nd character interval length is 2, the 3 rd character interval length is 3, and the 4 th character interval length is 2, and then the true character interval length is taken as 2. Preferably, the predetermined length threshold is 1.5 times the length of the character space in the text region.
The step S51 further includes:
if the character spacing area and the highlight area are overlapped, and the length of the character spacing area is smaller than a preset length threshold, calculating a first brightness variance of the area where the character spacing area and the highlight area are overlapped, and calculating a second brightness variance of the character spacing area adjacent to the character spacing area, wherein if the difference value between the first brightness variance and the second brightness variance is larger than or equal to a preset second threshold, the area where the character spacing area and the highlight area are overlapped is a light reflecting area.
When the character spacing area and the highlight area have overlapped areas and the length of the character spacing area is smaller than a preset length threshold value, calculating a first brightness variance of the overlapped areas, calculating a second brightness variance of the adjacent character spacing areas, and if the difference value between the first brightness variance and the second brightness variance is larger than or equal to a preset second threshold value, the area where the character spacing area and the highlight area are overlapped is a light reflecting area. In this embodiment, the distribution of the brightness of the character spacing region is considered, if the difference between the brightness distribution of the character spacing region and the brightness distribution of the adjacent character spacing region is not large, the character can be recognized normally, and if the difference is large, the character cannot be recognized due to the influence of the highlight region, and the overlapped region is determined to be the light reflection region. Wherein the predetermined second threshold is determined from the a priori values.
Further, step S52 specifically includes:
acquiring position information of a portrait key point, and adjusting the portrait area according to the position information;
if the adjusted portrait area and the highlight area have a superposed area, counting the number of first pixel points of the superposed area of the adjusted portrait area and the highlight area, and counting the number of second pixel points of the adjusted portrait area;
and if the ratio of the number of the first pixel points to the number of the second pixel points is greater than or equal to a predetermined third threshold value, the region where the adjusted portrait region and the highlight region coincide is a light reflecting region.
The obtained portrait area may include areas occupied by people and other areas unrelated to people. The position information of the key points of the portrait at least comprises position information corresponding to the positions of the glasses, the ears, the nose, the mouth and the chin. The portrait area is adjusted according to the position information of the portrait key points, and other areas irrelevant to people in the portrait area can be removed.
When the adjusted portrait area and the highlight area are overlapped, counting the number of first pixel points of the adjusted portrait area and the highlight area, counting the number of second pixel points of the adjusted portrait area, and if the ratio of the number of the first pixel points to the number of the second pixel points is greater than or equal to a preset third threshold value, determining that the highlight area affects the recognition of the portrait, and the portrait cannot be recognized, so that the overlapped area is determined to be a light reflecting area. If the ratio is less than a predetermined third threshold, the highlight region is considered to not affect the identification of the portrait. Preferably, the third threshold is 0.1%.
And step S6, if yes, prompting to upload the certificate picture again, and if not, sending the certificate picture to a server for identification.
The embodiment analyzes whether the key information area and the highlight area of the certificate picture have overlapped areas, and if the key information area and the highlight area do not have overlapped areas, the certificate picture can be directly sent to a server for identifying the key information; if the overlapped area exists, whether the overlapped area reflects light needs to be further analyzed, key information cannot be identified due to light reflection, and the certificate picture needs to be uploaded again.
In the embodiment, before characters and a portrait in a certificate image are identified by a server, a key information area and a highlight area of the certificate image are acquired, whether the key information area and the highlight area are overlapped is analyzed, if the key information area and the highlight area are overlapped, whether the overlapped area is a reflection area is further analyzed, the key information cannot be accurately identified due to reflection, if the key information is reflected, shooting is directly carried out again, the server does not need to be waited for identification, if the key information is detected to be not reflected, the key information is uploaded to the server for character identification and portrait identification, and the efficiency of certificate image identification can be improved.
In an embodiment, the present invention provides an image detection apparatus, which corresponds to the above-mentioned embodiments one-to-one. As shown in fig. 4, the picture detection apparatus includes:
the analysis module 101 is used for acquiring the uploaded certificate picture and analyzing the certificate type of the certificate picture;
the rotation module 102 is configured to, if the certificate type of the certificate picture is a predetermined certificate type, perform rotation processing on the certificate picture so that the certificate picture is in a positive placement state;
the first acquisition module 103 is used for acquiring a binary image of a certificate picture in a normally placed state and acquiring a key information area based on the binary image;
the second acquisition module 104 is configured to acquire a histogram of the certificate picture in the placed state, and acquire a highlight area of the certificate picture based on the histogram;
the detection module 105 is configured to analyze whether the key information area and the highlight area have an overlapped area, and if the key information area and the highlight area have an overlapped area, analyze whether the overlapped area is a light reflection area;
and the processing module 106 is used for prompting to upload the certificate picture again if the certificate picture is true, and sending the certificate picture to the server for identification if the certificate picture is false.
The specific definition of the image detection apparatus can refer to the definition of the image detection method in the foregoing, and is not described herein again. All or part of the modules in the picture detection device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which is a device capable of automatically performing numerical calculation and/or information processing according to instructions set or stored in advance. The Computer device may be a PC (Personal Computer), or a smart phone, a tablet Computer, a Computer, or a server group consisting of a single network server and a plurality of network servers, or a cloud consisting of a large number of hosts or network servers based on cloud computing, where cloud computing is one of distributed computing, and is a super virtual Computer consisting of a group of loosely coupled computers.
As shown in fig. 5, the computer device may include, but is not limited to, a memory 11, a processor 12, and a network interface 13, which are communicatively connected to each other through a system bus, wherein the memory 11 stores a computer program that is executable on the processor 12. It should be noted that fig. 5 only shows a computer device with components 11-13, but it should be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
The memory 11 may be a non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM). In this embodiment, the readable storage medium of the memory 11 is generally used for storing an operating system and various types of application software installed in the computer device, for example, program codes of a computer program in an embodiment of the present invention. Further, the memory 11 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 12 may be, in some embodiments, a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor, or other data Processing chip, and is used for executing program codes stored in the memory 11 or Processing data, such as executing computer programs.
The network interface 13 may comprise a standard wireless network interface, a wired network interface, and the network interface 13 is generally used for establishing communication connection between the computer device and other electronic devices.
The computer program is stored in the memory 11 and includes at least one computer readable instruction stored in the memory 11, which is executable by the processor 12 to implement the method of the embodiments of the present application, including:
acquiring an uploaded certificate picture, and analyzing the certificate type of the certificate picture;
if the certificate type of the certificate picture is a preset certificate type, performing rotation processing on the certificate picture to enable the certificate picture to be in a positive placement state;
acquiring a binary image of a certificate picture in a putting state, and acquiring a key information area based on the binary image;
acquiring a histogram of a certificate picture in a putting state, and acquiring a highlight area of the certificate picture based on the histogram;
analyzing whether the key information area and the highlight area have overlapped areas or not, and if the key information area and the highlight area have overlapped areas, analyzing whether the overlapped areas are light reflecting areas or not;
if yes, the user is prompted to upload the certificate picture again, and if not, the certificate picture is sent to a server for recognition.
In one embodiment, the present invention further provides a computer-readable storage medium, which may be a non-volatile and/or volatile memory, and on which a computer program is stored, and when the computer program is executed by a processor, the steps of the picture detection method in the above embodiments are implemented, for example, steps S1 to S6 shown in fig. 2. Alternatively, the computer program, when executed by the processor, implements the functions of the modules/units of the picture detection apparatus in the above-described embodiments, such as the functions of the modules 101 to 106 shown in fig. 4. To avoid repetition, further description is omitted here.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program that instructs associated hardware to perform the processes of the embodiments of the methods described above when executed.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method 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, apparatus, article, or method.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A picture detection method is characterized by comprising the following steps:
acquiring an uploaded certificate picture, and analyzing the certificate type of the certificate picture;
if the certificate type of the certificate picture is a preset certificate type, performing rotation processing on the certificate picture to enable the certificate picture to be in a positive placement state;
acquiring a binary image of a certificate picture in a putting state, and acquiring a key information area based on the binary image;
acquiring a histogram of a certificate picture in a putting state, and acquiring a highlight area of the certificate picture based on the histogram;
analyzing whether the key information area and the highlight area have overlapped areas or not, and if the key information area and the highlight area have overlapped areas, analyzing whether the overlapped areas are light reflecting areas or not;
if yes, the user is prompted to upload the certificate picture again, and if not, the certificate picture is sent to a server for recognition.
2. The picture detection method according to claim 1, wherein the key information area includes a portrait area and each text area, and the step of analyzing whether the key information area and the highlight area have a region that is overlapped, and if the key information area and the highlight area have a region that is overlapped, analyzing whether the overlapped region is a light reflection region specifically includes:
analyzing whether the text area and the highlight area have overlapped areas or not, and if the text area and the highlight area have overlapped areas, analyzing whether the text area and the highlight area have overlapped areas or not as a light reflecting area; and
and analyzing whether the portrait area and the highlight area have overlapped areas or not, and if so, analyzing whether the area where the portrait area and the highlight area are overlapped is a light reflecting area or not.
3. The picture detection method according to claim 2, wherein the step of analyzing whether each text region and the highlight region have a region that is overlapped, and if there is a region that is overlapped between a text region and the highlight region, analyzing whether the region that is overlapped between the text region and the highlight region is a highlight region comprises:
for each text area, carrying out vertical projection, and acquiring a character area corresponding to the text area based on the vertical projection image;
if the character area and the highlight area have an overlapped area, calculating the definition of the overlapped area of the character area and the highlight area, and if the definition is smaller than a preset first threshold value, determining the overlapped area of the character area and the highlight area as a light reflecting area.
4. The picture detection method according to claim 3, wherein the step of analyzing whether each text region and the highlight region have a region that coincides with each other, and if there is a region that text region and the highlight region have a region that coincides with each other, analyzing whether the region that text region and the highlight region have a coincidence with each other is a highlight region, further comprises:
acquiring a character interval region corresponding to the text region based on the vertical projection image;
if the character spacing area and the highlight area have overlapped areas and the length of the character spacing area is larger than or equal to a preset length threshold value, the area where the character spacing area and the highlight area are overlapped is a light reflecting area.
5. The picture detection method according to claim 4, wherein the step of analyzing whether each text region and the highlight region have a region that coincides with each other, and if there is a region that text region and the highlight region have a region that coincides with each other, analyzing whether the region that text region and the highlight region have a coincidence with each other is a highlight region, further comprises:
if the character spacing area and the highlight area are overlapped, and the length of the character spacing area is smaller than a preset length threshold, calculating a first brightness variance of the area where the character spacing area and the highlight area are overlapped, and calculating a second brightness variance of the character spacing area adjacent to the character spacing area, wherein if the difference value between the first brightness variance and the second brightness variance is larger than or equal to a preset second threshold, the area where the character spacing area and the highlight area are overlapped is a light reflecting area.
6. The picture detection method according to claim 2, wherein the step of analyzing whether the portrait area and the highlight area have an overlapping area, and if the portrait area and the highlight area have an overlapping area, analyzing whether the area where the portrait area and the highlight area overlap is a light reflection area specifically includes:
acquiring position information of a portrait key point, and adjusting the portrait area according to the position information;
if the adjusted portrait area and the highlight area have a superposed area, counting the number of first pixel points of the superposed area of the adjusted portrait area and the highlight area, and counting the number of second pixel points of the adjusted portrait area;
and if the ratio of the number of the first pixel points to the number of the second pixel points is greater than or equal to a predetermined third threshold value, the region where the adjusted portrait region and the highlight region coincide is a light reflecting region.
7. The picture detection method according to claim 6, wherein the third threshold is 0.1%.
8. A picture detection device, comprising:
the analysis module is used for acquiring the uploaded certificate picture and analyzing the certificate type of the certificate picture;
the rotation module is used for performing rotation processing on the certificate picture if the certificate type of the certificate picture is a preset certificate type, so that the certificate picture is in a positive placement state;
the first acquisition module is used for acquiring a binary image of a certificate picture in a putting state and acquiring a key information area based on the binary image;
the second acquisition module is used for acquiring a histogram of the certificate picture in the putting state and acquiring a highlight area of the certificate picture based on the histogram;
the detection module is used for analyzing whether the key information area and the highlight area have a superposed area or not, and if the key information area and the highlight area have the superposed area, analyzing whether the superposed area is a light reflecting area or not;
and the processing module is used for prompting to upload the certificate picture again if the certificate picture is true, and sending the certificate picture to the server for identification if the certificate picture is false.
9. A computer device comprising a memory and a processor connected to the memory, the memory having stored therein a computer program operable on the processor, wherein the processor, when executing the computer program, implements the steps of the picture detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the picture detection method according to any one of claims 1 to 7.
CN202011386422.9A 2020-12-01 2020-12-01 Picture detection method, device, equipment and storage medium Pending CN112434687A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011386422.9A CN112434687A (en) 2020-12-01 2020-12-01 Picture detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011386422.9A CN112434687A (en) 2020-12-01 2020-12-01 Picture detection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112434687A true CN112434687A (en) 2021-03-02

Family

ID=74697611

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011386422.9A Pending CN112434687A (en) 2020-12-01 2020-12-01 Picture detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112434687A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106228168A (en) * 2016-07-29 2016-12-14 北京小米移动软件有限公司 The reflective detection method of card image and device
JP2018160152A (en) * 2017-03-23 2018-10-11 日本電気株式会社 Character recognition device, character recognition method, and program
CN109492643A (en) * 2018-10-11 2019-03-19 平安科技(深圳)有限公司 Certificate recognition methods, device, computer equipment and storage medium based on OCR
JP2019208252A (en) * 2019-07-22 2019-12-05 株式会社ニコン Image reproducing apparatus
CN111091126A (en) * 2019-12-12 2020-05-01 京东数字科技控股有限公司 Certificate image reflection detection method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106228168A (en) * 2016-07-29 2016-12-14 北京小米移动软件有限公司 The reflective detection method of card image and device
JP2018160152A (en) * 2017-03-23 2018-10-11 日本電気株式会社 Character recognition device, character recognition method, and program
CN109492643A (en) * 2018-10-11 2019-03-19 平安科技(深圳)有限公司 Certificate recognition methods, device, computer equipment and storage medium based on OCR
JP2019208252A (en) * 2019-07-22 2019-12-05 株式会社ニコン Image reproducing apparatus
CN111091126A (en) * 2019-12-12 2020-05-01 京东数字科技控股有限公司 Certificate image reflection detection method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111191567B (en) Identity data processing method, device, computer equipment and storage medium
US10635946B2 (en) Eyeglass positioning method, apparatus and storage medium
US20190012450A1 (en) Biometric-based authentication method, apparatus and system
US20200065460A1 (en) Method and computer readable storage medium for remote interview signature
WO2019033572A1 (en) Method for detecting whether face is blocked, device and storage medium
WO2019062080A1 (en) Identity recognition method, electronic device, and computer readable storage medium
US11367310B2 (en) Method and apparatus for identity verification, electronic device, computer program, and storage medium
CN111325104B (en) Text recognition method, device and storage medium
CN111191539A (en) Certificate authenticity verification method and device, computer equipment and storage medium
EP4109332A1 (en) Certificate authenticity identification method and apparatus, computer-readable medium, and electronic device
CN111626163B (en) Human face living body detection method and device and computer equipment
US20150227946A1 (en) Generating barcode and authenticating based on barcode
US20190294919A1 (en) Reading Test Cards Using a Mobile Device
CN110795714A (en) Identity authentication method and device, computer equipment and storage medium
AU2016208411B2 (en) Identifying shapes in an image by comparing bézier curves
CN113298158B (en) Data detection method, device, equipment and storage medium
EP3869448A1 (en) Iris authentication device, iris authentication method, and recording medium
CN112330331A (en) Identity verification method, device and equipment based on face recognition and storage medium
CN113111880B (en) Certificate image correction method, device, electronic equipment and storage medium
CN111144372A (en) Vehicle detection method, device, computer equipment and storage medium
CN108985251B (en) User instruction matching method and device, computer equipment and storage medium
CN105787419A (en) Palm detection method and palm detection system for palm image
WO2021036185A1 (en) Certificate identification method and device
CN110956102A (en) Bank counter monitoring method and device, computer equipment and storage medium
CN114861241A (en) Anti-peeping screen method based on intelligent detection and related equipment thereof

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