CN111489347B - Business license picture quality detection method and device, computer equipment and storage medium - Google Patents

Business license picture quality detection method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111489347B
CN111489347B CN202010295135.0A CN202010295135A CN111489347B CN 111489347 B CN111489347 B CN 111489347B CN 202010295135 A CN202010295135 A CN 202010295135A CN 111489347 B CN111489347 B CN 111489347B
Authority
CN
China
Prior art keywords
picture
business license
license picture
positioning
target
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
CN202010295135.0A
Other languages
Chinese (zh)
Other versions
CN111489347A (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.)
Shenzhen Qianhai Huanrong Lianyi Information Technology Service Co Ltd
Original Assignee
Shenzhen Qianhai Huanrong Lianyi Information Technology Service 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 Shenzhen Qianhai Huanrong Lianyi Information Technology Service Co Ltd filed Critical Shenzhen Qianhai Huanrong Lianyi Information Technology Service Co Ltd
Priority to CN202010295135.0A priority Critical patent/CN111489347B/en
Publication of CN111489347A publication Critical patent/CN111489347A/en
Application granted granted Critical
Publication of CN111489347B publication Critical patent/CN111489347B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to a business license picture quality detection method, a device, a computer device and a storage medium, wherein the method comprises the steps of obtaining a business license picture uploaded by a terminal; image positioning is carried out on the business license picture by utilizing a pattern recognition model so as to obtain a positioning result; judging whether the business license picture is positioned successfully or not according to the positioning result; if the calculation is successful, calculating the proportion of the occupied graph and the inclination of the characters according to the positioning result so as to obtain an index value; judging whether the business license picture can be optimized according to the index value; if the optimization is not possible, generating prompt information, and feeding the prompt information back to the terminal so as to display the prompt information on the terminal; if the business license picture can be optimized, optimizing the business license picture to generate a processing result; and feeding back the processing result to the terminal so as to display the processing result on the terminal. The invention realizes the detection of the quality of business license pictures, avoids influencing the progress and the efficiency of business processes, only saves the optimized business license pictures and can save the storage space.

Description

Business license picture quality detection method and device, computer equipment and storage medium
Technical Field
The present invention relates to a method for detecting picture quality, and more particularly, to a method, apparatus, computer device, and storage medium for detecting picture quality of business license.
Background
The business license is a certificate issued by the business administration authority to business enterprises and individual operators and permitted to conduct a certain production and operation activity, and is also an identification of the enterprise, and the business license is equivalent to an identity card of the enterprise. When enterprises participate in some platform projects, business license pictures need to be uploaded, at present, the picture quality detection is not carried out on the business license pictures at the ports of the project uploading pictures, but the size of the pictures is limited, the received quality of the business license pictures such as correctness, safety, definition, angle and contrast can not be controlled in a limited mode, the business license pictures which are uploaded successfully can not be identified effectively easily, the problem that the business license pictures can be solved only through manual intervention is solved, the progress and efficiency of business processes are affected easily, storage space is wasted, and garbage pictures are generated.
Therefore, it is necessary to design a new method to detect the quality of business license pictures, correspondingly optimize business license pictures, prompt business license pictures which cannot be optimized, avoid affecting the progress and efficiency of business processes, and save storage space.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a business license picture quality detection method, a business license picture quality detection device, computer equipment and a storage medium.
In order to achieve the above purpose, the present invention adopts the following technical scheme: the business license picture quality detection method comprises the following steps:
acquiring a business license picture uploaded by a terminal;
image positioning is carried out on the business license picture by utilizing a pattern recognition model so as to obtain a positioning result;
judging whether the business license picture is positioned successfully or not according to the positioning result;
if the business license picture is successfully positioned, calculating the proportion of the picture and the character gradient according to the positioning result to obtain an index value;
judging whether the business license picture can be optimized or not according to the index value;
if the business license picture can not be optimized, generating prompt information, and feeding the prompt information back to the terminal so as to display the prompt information on the terminal;
if the business license picture can be optimized, optimizing the business license picture to generate a processing result;
feeding back the processing result to the terminal so as to display the processing result on the terminal;
the pattern recognition model is obtained by training a YOLO target detection network by using sample picture data with business license position coordinate labels.
The further technical scheme is as follows: after judging whether the business license picture is positioned successfully according to the positioning result, the method further comprises the following steps:
and if the business license picture is positioned unsuccessfully, executing the generation of the prompt information, and feeding the prompt information back to the terminal so as to display the prompt information at the terminal.
The further technical scheme is as follows: the loss function of the YOLO target detection network comprises a loss function for calculating a center coordinate loss value, a loss function for calculating width and height loss values of a boundary box, a loss function for calculating a picture category loss value and a loss function for calculating a confidence loss value.
The further technical scheme is as follows: the positioning result comprises a picture category, and when the picture category is the category in which the target exists, the positioning result also comprises the position coordinates and the confidence of the target area.
The further technical scheme is as follows: judging whether the business license picture is positioned successfully according to the positioning result comprises the following steps:
judging whether the picture category in the positioning result is a category in which a target exists;
if the picture category in the positioning result is the category with the target existence, judging whether the confidence coefficient is not smaller than a confidence coefficient threshold value or not;
If the confidence coefficient is not smaller than a confidence coefficient threshold value, the business license picture is successfully positioned;
if the confidence coefficient is smaller than a confidence coefficient threshold value, the business license picture is unsuccessfully positioned;
if the picture category in the positioning result is not the category with the target existing, the business license picture positioning is unsuccessful.
The further technical scheme is as follows: and calculating the graph occupation proportion and the character gradient according to the positioning result to obtain an index value, wherein the method comprises the following steps of:
calculating the pixel size according to the target area position coordinates in the positioning result, and calculating the proportion of the map according to the pixel size;
cutting the business license picture according to the target area position coordinates in the positioning result to obtain a target picture;
OCR recognition is carried out on the target picture so as to obtain the position of the text region;
calculating the character gradient according to the position of the character area;
and integrating the proportion of the duty ratio map and the character gradient to obtain an index value.
The further technical scheme is as follows: the optimizing processing of the business license picture to generate a processing result comprises the following steps:
and rotating the business license picture by a corresponding angle according to the character gradient, and removing the watermark of the business license picture to generate a processing result.
The invention also provides a business license picture quality detection device, which comprises:
the picture acquisition unit is used for acquiring business license pictures uploaded by the terminal;
the positioning unit is used for performing image positioning on the business license picture by using a pattern recognition model so as to obtain a positioning result;
the positioning judging unit is used for judging whether the business license picture is positioned successfully or not according to the positioning result;
the index calculation unit is used for calculating the proportion of the occupied picture and the inclination of the characters according to the positioning result if the business license picture is successfully positioned, so as to obtain an index value;
the optimization judging unit is used for judging whether the business license picture can be optimized or not according to the index value;
the information generation unit is used for generating prompt information if the business license picture cannot be optimized, and feeding the prompt information back to the terminal so as to display the prompt information on the terminal;
the optimizing unit is used for optimizing the business license picture if the business license picture can be optimized, so as to generate a processing result;
and the result feedback unit is used for feeding back the processing result to the terminal so as to display the processing result on the terminal.
The invention also provides a computer device which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the method when executing the computer program.
The present invention also provides a storage medium storing a computer program which, when executed by a processor, performs the above-described method.
Compared with the prior art, the invention has the beneficial effects that: according to the invention, the picture is positioned by adopting the picture recognition model formed by the intelligent recognition framework based on the TensorFlow, the picture occupation proportion and the character inclination angle are carried out on the picture which detects the target and can effectively recognize the position coordinate of the target area, when the two indexes meet the requirements, the existing python picture processing tool library can be used for optimizing the business license picture, the quality of the business license picture is detected, the business license picture which can be optimized is correspondingly optimized, the non-optimized business license picture is prompted, the progress and the efficiency of the business process are prevented from being influenced, and only the business license picture after the optimization is saved, so that the storage space can be saved.
The invention is further described below with reference to the drawings and specific embodiments.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of an application scenario of a business license picture quality detection method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a business license image quality detection method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a business license image quality detection method according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart of a business license image quality detection method according to an embodiment of the present invention;
FIG. 5 is a schematic block diagram of a business license picture quality detection device provided by an embodiment of the present invention;
FIG. 6 is a schematic block diagram of a location determining unit of a business license picture quality detecting device according to an embodiment of the present invention;
FIG. 7 is a schematic block diagram of an index calculation unit of a business license picture quality detection device according to an embodiment of the present invention;
Fig. 8 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Referring to fig. 1 and fig. 2, fig. 1 is a schematic view of an application scenario of a business license image quality detection method according to an embodiment of the present invention. Fig. 2 is a schematic flowchart of a business license picture quality detection method according to an embodiment of the present invention. The business license picture quality detection method is applied to the server. The server performs data interaction with the terminal, the business license picture is uploaded through the terminal, the quality of the business license picture is detected by the server, the business license picture which can be optimized is optimized, prompt information is generated for the business license picture which cannot be optimized, and the prompt information is sent to the terminal for prompting.
Fig. 2 is a flowchart of a business license picture quality detection method according to an embodiment of the present invention. As shown in fig. 2, the method includes the following steps S110 to S180.
S110, acquiring business license pictures uploaded by the terminal.
In this embodiment, the business license picture is a picture of a business license taken through the terminal.
S120, image positioning is carried out on the business license picture by using a pattern recognition model so as to obtain a positioning result.
In this embodiment, the positioning result refers to the type of the obtained picture and the position coordinates and confidence of the target area under specific conditions after the uploaded business license picture is subjected to target detection and positioning.
Specifically, the business license picture is subjected to image positioning based on a pattern recognition technology of TensorFlow.
The pattern recognition model is obtained by training a YOLO target detection network by using sample picture data with business license position coordinate labels, and specifically, the YOLO target detection network resets the picture size to 448x448 when training; putting the picture into a network for processing; the non-maximum suppression processing is performed to obtain a result. YOLO, unlike conventional detection algorithms, employs a sliding window to find a target. YOLO directly employs a single convolutional neural network to predict multiple region and class probabilities.
After uploading business license pictures, the user firstly performs positioning analysis on the picture target patterns, and mainly comprises the existence of a target area, the pixel size of the target area, the proportion of the target area to the whole picture and the gradient of the picture characters; and comparing whether the feedback meets the uploading quality requirement or not according to a predefined threshold value, wherein the specific threshold value is set by analyzing a picture set with the optimal effect in the actual recognition condition.
In an embodiment, the loss function of the YOLO target detection network includes a loss function that calculates center coordinate loss values, a loss function that calculates width and height loss values of bounding boxes, a loss function that calculates picture category loss values, a loss function that calculates confidence loss values.
Wherein, the loss function for calculating the center coordinate loss value is that The loss function predicts a loss value for the bounding box position (x, y). Lambda (lambda) coordi=0 Is a given constant. The function calculates the sum of each bounding box predictor for each grid cell.
If there is a target in the grid cell, the jth bounding box predictor is valid for that prediction.
A corresponding bounding box is predicted for each grid cell YOLO. During training, only one bounding box predictor is desired for each target. Based on which prediction has the highest real-time IOU (cross-over-Union) and the ground truth, it is confirmed that it is valid for predicting one target. (x) i ,y i ) Is the location of the prediction bounding box,is the actual position obtained from the sample picture data.
Calculating the width and height loss values of the bounding box as a loss functionw i 、h i Width and height of the bounding box for prediction; / >Is the actual width and height of the target area derived from the sample picture data.
Calculating a loss function of a picture category loss value asp i (c) For the predicted picture category +.>Is the actual picture category derived from the sample picture data.
Calculating a confidence loss value as a loss function C i For confidence of prediction, ++>The prediction bounding box refers to a predicted target region, which is the intersection of the prediction bounding box and the ground truth. When there is an object in one cell, +.>Equal to 1, otherwise, the value is 0. Where lambda is noobji=0 Parameters are in different weighted parts of the loss function. This is critical to the stability of the model. The highest penalty is λ prediction for coordinates coordi=0 When there is no =5When a target is detected, there is a minimum confidence predictive penalty lambda noobji=0 =0.5。
Specifically, the positioning result includes a picture category, and when the picture category is a category in which a target exists, the positioning result further includes a position coordinate of the target area and a confidence level.
And S130, judging whether the business license picture is positioned successfully or not according to the positioning result.
In one embodiment, referring to fig. 3, the step S130 may include steps S131 to S134.
S131, judging whether the picture category in the positioning result is a category in which a target exists;
S132, if the picture category in the positioning result is a category with a target existing, judging whether the confidence coefficient is not smaller than a confidence coefficient threshold value;
s133, if the confidence coefficient is not smaller than a confidence coefficient threshold value, the business license picture is successfully positioned;
s134, if the confidence coefficient is smaller than a confidence coefficient threshold value, the business license picture is positioned unsuccessfully;
and if the picture category in the positioning result is not the category in which the target exists, executing the step S134.
When the target cannot be positioned in the picture positioning process, the current business license picture is not clear and cannot meet the current requirement; when a target can be detected in the picture positioning process, whether the confidence coefficient corresponding to the target area meets the requirement or not needs to be judged, and when the confidence coefficient meets the requirement, the business license picture meets the picture quality requirement.
And S140, if the business license picture is successfully positioned, calculating the proportion of the picture and the character gradient according to the positioning result to obtain an index value.
In this embodiment, the index value refers to the duty ratio of the target area and the character gradient.
In one embodiment, referring to fig. 4, the step S140 may include steps S141 to S145.
S141, calculating the pixel size according to the target area position coordinates in the positioning result, and calculating the proportion of the map according to the pixel size.
In this embodiment, the map proportion refers to a proportion of the target area occupying the entire business license picture.
The pixel size of the target area can be obtained according to the position coordinates of the target area, so that the area of the target area is obtained, and the area of the target area in the whole business license picture is used for calculating the occupation ratio.
S142, cutting the business license picture according to the target area position coordinates in the positioning result to obtain a target picture.
In this embodiment, the target picture refers to a picture having only a target, and for business license pictures, the target picture refers to a picture including only business license related information. And the targets are separated from the background, and only the target pictures are analyzed, so that the accuracy of the whole quality detection is improved.
S143, performing OCR (optical character recognition ) recognition on the target picture to obtain the position of the text region.
And performing character recognition on the target picture by adopting OCR to obtain the position of the character area.
S144, calculating the character gradient according to the position of the character area.
In this embodiment, the character gradient refers to a gradient angle of the character area with respect to the horizontal line.
The alignment angle of the text region, i.e., the text tilt angle, can be obtained by using the position of the text region and the OCR technique.
And cutting out the target area for OCR recognition once, and calculating the character gradient according to the position of the character area marked by OCR to be used as a character gradient index of the picture.
S145, integrating the proportion of the duty ratio map and the character gradient to obtain an index value.
And comparing the obtained indexes with the configured threshold values, and prompting the result, for example, if all the indexes meet the picture quality requirement or a certain part of indexes are not met, for example, if the picture pixels are insufficient, prompting the picture blurring.
And S150, judging whether the business license picture can be optimized or not according to the index value.
In this embodiment, when the index value exceeds the configured threshold, it indicates that the business license picture is not optimizable, and when the index value does not exceed the configured threshold, it indicates that the business license picture is optimizable.
And S160, if the business license picture can not be optimized, generating prompt information, and feeding the prompt information back to the terminal so as to display the prompt information at the terminal.
In this embodiment, the prompt information includes information that is not satisfactory and cannot be optimized, and requires the picture to be uploaded again.
And S170, if the business license picture can be optimized, optimizing the business license picture to generate a processing result.
In this embodiment, the processing result refers to the optimized picture.
Specifically, the business license picture is rotated by a corresponding angle according to the character gradient, and the watermark of the business license picture is removed to generate a processing result.
Specifically, the processing optimization is carried out on the pictures based on the Python picture library, and the operations comprise angle adjustment, effective area extraction, contrast optimization, watermark removal and the like.
For optimizing the picture contrast, the picture contrast can be judged according to the three-channel color number parameters of the picture, the effect of increasing the black and white of the picture visually more obviously can be achieved by changing the pigment channel of the picture to be optimized, and the accuracy of OCR can be improved; the seal optimization process firstly extracts the seal through the HSV color space, then acquires the needed information, judges the red channel information, removes the red pigment, and can visually remove the seal effect on the picture.
S180, feeding back the processing result to the terminal so as to display the processing result on the terminal.
And feeding back the final processing result to the terminal, displaying the business license picture which meets the requirements and is optimized, and storing the processing result into a disk.
If the business license picture positioning is unsuccessful, the step S160 is executed.
The specific picture can be subjected to all-round quality inspection and optimization aiming at business license. And at the same time, the user can be guided to use the specifications and habits well. Improving the efficiency of the subsequent process.
The method is characterized in that a plurality of indexes of the picture are detected, and by means of checking and marking core target graphics or characters, effective probability of the picture, target pattern angle, contrast, safety and other element information can be calculated, the picture which can be optimized can be directly optimized for landing, and the picture which cannot be optimally solved can be directly prompted for re-uploading, so that the operation of a follow-up business process can be greatly improved, and the storage of a picture disk can be optimized.
According to the business license picture quality detection method, the picture is positioned by adopting the pattern recognition model formed by the intelligent recognition framework based on the TensorFlow, the picture occupation proportion and the character inclination angle are carried out on the picture which detects the target and can effectively recognize the position coordinates of the target area, when the two indexes meet the requirements, the existing python picture processing tool library can be used for optimizing the business license picture, the quality of the business license picture is detected, the business license picture which can be optimized is correspondingly optimized, the non-optimized business license picture is prompted, the progress and the efficiency of a business process are prevented from being influenced, and only the business license picture after optimization is saved, so that the storage space can be saved.
Fig. 5 is a schematic block diagram of a business license picture quality detection apparatus 300 according to an embodiment of the present invention. As shown in fig. 5, the present invention further provides a business license picture quality detection device 300 corresponding to the above business license picture quality detection method. The business license picture quality detection apparatus 300 includes a unit for performing the business license picture quality detection method described above, and may be configured in a server. Specifically, referring to fig. 5, the business license picture quality detection apparatus 300 includes a picture acquisition unit 301, a positioning unit 302, a positioning determination unit 303, an index calculation unit 304, an optimization determination unit 305, an information generation unit 306, an optimization unit 307, and a result feedback unit 308.
A picture obtaining unit 301, configured to obtain a business license picture uploaded by the terminal; the positioning unit 302 is configured to perform image positioning on the business license picture by using a pattern recognition model, so as to obtain a positioning result; a positioning judging unit 303, configured to judge whether the business license picture is successfully positioned according to the positioning result; the index calculating unit 304 is configured to calculate a graph occupation ratio and a text gradient according to the positioning result if the business license picture is successfully positioned, so as to obtain an index value; an optimization judging unit 305, configured to judge whether the business license picture can be optimized according to the index value; the information generating unit 306 is configured to generate a prompt message if the business license picture cannot be optimized, and feed back the prompt message to the terminal, so as to display the prompt message at the terminal; an optimizing unit 307, configured to perform optimization processing on the business license picture if the business license picture can be optimized, so as to generate a processing result; and a result feedback unit 308, configured to feedback the processing result to the terminal, so as to display the processing result on the terminal.
Specifically, the optimizing unit 307 is configured to rotate the business license picture by a corresponding angle according to the text gradient, and remove the watermark of the business license picture to generate a processing result.
In one embodiment, as shown in fig. 6, the location determining unit 303 includes a category determining subunit 3031 and a confidence determining subunit 3032.
A category judging subunit 3031, configured to judge whether the picture category in the positioning result is a category in which a target exists, and if the picture category in the positioning result is not the category in which the target exists, the business license picture positioning is unsuccessful; a confidence coefficient judging subunit 3032, configured to judge whether the confidence coefficient is not less than a confidence coefficient threshold value if the picture class in the positioning result is a class in which a target exists; if the confidence coefficient is not smaller than a confidence coefficient threshold value, the business license picture is successfully positioned; if the confidence level is less than a confidence level threshold, the business license picture is positioned unsuccessfully.
In one embodiment, as shown in fig. 7, the index calculating unit 304 includes a proportion calculating subunit 3041, a cutting subunit 3042, an identifying subunit 3043, a gradient calculating subunit 3044, and an integrating subunit 3045.
The proportion calculating subunit 3041 is configured to calculate a pixel size according to the target area position coordinate in the positioning result, and calculate a map occupation proportion according to the pixel size; a cutting subunit 3042, configured to cut the business license picture according to the target area position coordinate in the positioning result, so as to obtain a target picture; a recognition subunit 3043, configured to perform OCR recognition on the target picture to obtain a position of a text region; an inclination calculation subunit 3044, configured to calculate a text inclination according to the location of the text region; and an integrating subunit 3045, configured to integrate the ratio of the duty ratio map and the text gradient to obtain an index value.
It should be noted that, as will be clearly understood by those skilled in the art, the specific implementation process of the business license picture quality detection apparatus 300 and each unit may refer to the corresponding description in the foregoing method embodiments, and for convenience and brevity of description, the description is omitted here.
The business license picture quality detection apparatus 300 described above may be implemented in the form of a computer program that can run on a computer device as shown in fig. 8.
Referring to fig. 8, fig. 8 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 is a server, and the server may be a stand-alone server or a server cluster formed by a plurality of servers.
With reference to FIG. 8, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform a business license picture quality detection method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the non-volatile storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to perform a business license picture quality detection method.
The network interface 505 is used for network communication with other devices. It will be appreciated by those skilled in the art that the architecture shown in fig. 8 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting of the computer device 500 to which the present inventive arrangements may be implemented, as a particular computer device 500 may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
Wherein the processor 502 is configured to execute a computer program 5032 stored in a memory to implement the steps of:
acquiring a business license picture uploaded by a terminal; image positioning is carried out on the business license picture by utilizing a pattern recognition model so as to obtain a positioning result; judging whether the business license picture is positioned successfully or not according to the positioning result; if the business license picture is successfully positioned, calculating the proportion of the picture and the character gradient according to the positioning result to obtain an index value; judging whether the business license picture can be optimized or not according to the index value; if the business license picture can not be optimized, generating prompt information, and feeding the prompt information back to the terminal so as to display the prompt information on the terminal; if the business license picture can be optimized, optimizing the business license picture to generate a processing result; and feeding back the processing result to the terminal so as to display the processing result on the terminal.
The pattern recognition model is obtained by training a YOLO target detection network by using sample picture data with business license position coordinate labels.
The loss function of the YOLO target detection network comprises a loss function for calculating a center coordinate loss value, a loss function for calculating width and height loss values of a boundary box, a loss function for calculating a picture category loss value and a loss function for calculating a confidence loss value.
The positioning result comprises a picture category, and when the picture category is the category in which the target exists, the positioning result also comprises the position coordinates and the confidence of the target area.
In one embodiment, after implementing the step of determining whether the business license picture is successfully located according to the location result, the processor 502 further implements the following steps:
and if the business license picture is positioned unsuccessfully, executing the generation of the prompt information, and feeding the prompt information back to the terminal so as to display the prompt information at the terminal.
In an embodiment, when implementing the step of determining whether the business license picture is successfully located according to the locating result, the processor 502 specifically implements the following steps:
judging whether the picture category in the positioning result is a category in which a target exists; if the picture category in the positioning result is the category with the target existence, judging whether the confidence coefficient is not smaller than a confidence coefficient threshold value or not; if the confidence coefficient is not smaller than a confidence coefficient threshold value, the business license picture is successfully positioned; if the confidence coefficient is smaller than a confidence coefficient threshold value, the business license picture is unsuccessfully positioned; if the picture category in the positioning result is not the category with the target existing, the business license picture positioning is unsuccessful.
In one embodiment, when the step of calculating the graph occupation ratio and the text inclination according to the positioning result to obtain the index value is implemented by the processor 502, the following steps are specifically implemented:
calculating the pixel size according to the target area position coordinates in the positioning result, and calculating the proportion of the map according to the pixel size; cutting the business license picture according to the target area position coordinates in the positioning result to obtain a target picture; OCR recognition is carried out on the target picture so as to obtain the position of the text region; calculating the character gradient according to the position of the character area; and integrating the proportion of the duty ratio map and the character gradient to obtain an index value.
In one embodiment, when the step of optimizing the business license picture to generate the processing result is implemented by the processor 502, the following steps are specifically implemented:
and rotating the business license picture by a corresponding angle according to the character gradient, and removing the watermark of the business license picture to generate a processing result.
It should be appreciated that in an embodiment of the application, the processor 502 may be a central processing unit (Central Processing Unit, CPU), the processor 502 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (Application Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that all or part of the flow in a method embodying the above described embodiments may be accomplished by computer programs instructing the relevant hardware. The computer program comprises program instructions, and the computer program can be stored in a storage medium, which is a computer readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer readable storage medium. The storage medium stores a computer program which, when executed by a processor, causes the processor to perform the steps of:
acquiring a business license picture uploaded by a terminal; image positioning is carried out on the business license picture by utilizing a pattern recognition model so as to obtain a positioning result; judging whether the business license picture is positioned successfully or not according to the positioning result; if the business license picture is successfully positioned, calculating the proportion of the picture and the character gradient according to the positioning result to obtain an index value; judging whether the business license picture can be optimized or not according to the index value; if the business license picture can not be optimized, generating prompt information, and feeding the prompt information back to the terminal so as to display the prompt information on the terminal; if the business license picture can be optimized, optimizing the business license picture to generate a processing result; and feeding back the processing result to the terminal so as to display the processing result on the terminal.
The pattern recognition model is obtained by training a YOLO target detection network by using sample picture data with business license position coordinate labels.
The loss function of the YOLO target detection network comprises a loss function for calculating a center coordinate loss value, a loss function for calculating width and height loss values of a boundary box, a loss function for calculating a picture category loss value and a loss function for calculating a confidence loss value.
The positioning result comprises a picture category, and when the picture category is the category in which the target exists, the positioning result also comprises the position coordinates and the confidence of the target area.
In one embodiment, after executing the computer program to implement the step of determining whether the business license picture is successfully located according to the location result, the processor further implements the following steps:
and if the business license picture is positioned unsuccessfully, executing the generation of the prompt information, and feeding the prompt information back to the terminal so as to display the prompt information at the terminal.
In one embodiment, when the processor executes the computer program to implement the step of determining whether the business license picture is successfully positioned according to the positioning result, the following steps are specifically implemented:
Judging whether the picture category in the positioning result is a category in which a target exists; if the picture category in the positioning result is the category with the target existence, judging whether the confidence coefficient is not smaller than a confidence coefficient threshold value or not; if the confidence coefficient is not smaller than a confidence coefficient threshold value, the business license picture is successfully positioned; if the confidence coefficient is smaller than a confidence coefficient threshold value, the business license picture is unsuccessfully positioned; if the picture category in the positioning result is not the category with the target existing, the business license picture positioning is unsuccessful.
In one embodiment, when the processor executes the computer program to implement the step of calculating the map occupation ratio and the text inclination according to the positioning result to obtain the index value, the processor specifically implements the following steps:
calculating the pixel size according to the target area position coordinates in the positioning result, and calculating the proportion of the map according to the pixel size; cutting the business license picture according to the target area position coordinates in the positioning result to obtain a target picture; OCR recognition is carried out on the target picture so as to obtain the position of the text region; calculating the character gradient according to the position of the character area; and integrating the proportion of the duty ratio map and the character gradient to obtain an index value.
In one embodiment, when the processor executes the computer program to implement the step of optimizing the business license picture to generate a processing result, the following steps are specifically implemented:
and rotating the business license picture by a corresponding angle according to the character gradient, and removing the watermark of the business license picture to generate a processing result.
The storage medium may be a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, or other various computer-readable storage media that can store program codes.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be combined, divided and deleted according to actual needs. In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The integrated unit may be stored in a storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a terminal, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (9)

1. The business license picture quality detection method is characterized by comprising the following steps:
acquiring a business license picture uploaded by a terminal;
image positioning is carried out on the business license picture by utilizing a pattern recognition model so as to obtain a positioning result;
judging whether the business license picture is positioned successfully or not according to the positioning result;
if the business license picture is successfully positioned, calculating the proportion of the picture and the character gradient according to the positioning result to obtain an index value;
judging whether the business license picture can be optimized or not according to the index value;
if the business license picture can not be optimized, generating prompt information, and feeding the prompt information back to the terminal so as to display the prompt information on the terminal;
if the business license picture can be optimized, optimizing the business license picture to generate a processing result;
Feeding back the processing result to the terminal so as to display the processing result on the terminal;
the pattern recognition model is obtained by training a YOLO target detection network by adopting sample picture data with business license position coordinate labels;
judging whether the business license picture is positioned successfully according to the positioning result comprises the following steps:
judging whether the picture category in the positioning result is a category in which a target exists;
if the picture category in the positioning result is the category with the target existence, judging whether the confidence coefficient is not less than a confidence coefficient threshold value;
if the confidence coefficient is not smaller than a confidence coefficient threshold value, the business license picture is successfully positioned;
if the confidence coefficient is smaller than a confidence coefficient threshold value, the business license picture is unsuccessfully positioned;
if the picture category in the positioning result is not the category in which the target exists, the business license picture positioning is unsuccessful;
when the target cannot be positioned in the picture positioning process, the current business license picture is not clear and cannot meet the current requirement; when a target can be detected in the picture positioning process, whether the confidence coefficient corresponding to the target area meets the requirement or not needs to be judged, and when the confidence coefficient meets the requirement, the business license picture meets the picture quality requirement.
2. The business license picture quality detection method according to claim 1, wherein after the determining whether the business license picture is successfully located according to the locating result, further comprises:
and if the business license picture is positioned unsuccessfully, executing the generation of the prompt information, and feeding the prompt information back to the terminal so as to display the prompt information at the terminal.
3. The business license picture quality detection method of claim 2, wherein the loss function of the YOLO target detection network comprises a loss function that calculates center coordinate loss values, a loss function that calculates width and height loss values of bounding boxes, a loss function that calculates picture category loss values, a loss function that calculates confidence loss values.
4. The business license picture quality detection method according to claim 3, wherein the positioning result includes a picture category, and when the picture category is a category in which a target exists, the positioning result further includes a position coordinate of the target area and a confidence level.
5. The business license picture quality detection method according to claim 1, wherein the calculating the occupancy map scale and the text gradient according to the positioning result to obtain the index value comprises:
Calculating the pixel size according to the target area position coordinates in the positioning result, and calculating the proportion of the map according to the pixel size;
cutting the business license picture according to the target area position coordinates in the positioning result to obtain a target picture;
OCR recognition is carried out on the target picture so as to obtain the position of the text region;
calculating the character gradient according to the position of the character area;
integrating the proportion of the map and the character gradient to obtain an index value.
6. The business license picture quality detection method according to claim 1, wherein the optimizing the business license picture to generate a processing result includes:
and rotating the business license picture by a corresponding angle according to the character gradient, and removing the watermark of the business license picture to generate a processing result.
7. Business license picture quality detection device, characterized by comprising:
the picture acquisition unit is used for acquiring business license pictures uploaded by the terminal;
the positioning unit is used for performing image positioning on the business license picture by using a pattern recognition model so as to obtain a positioning result;
The positioning judging unit is used for judging whether the business license picture is positioned successfully or not according to the positioning result;
the index calculation unit is used for calculating the proportion of the occupied picture and the inclination of the characters according to the positioning result if the business license picture is successfully positioned, so as to obtain an index value;
the optimization judging unit is used for judging whether the business license picture can be optimized or not according to the index value;
the information generation unit is used for generating prompt information if the business license picture cannot be optimized, and feeding the prompt information back to the terminal so as to display the prompt information on the terminal;
the optimizing unit is used for optimizing the business license picture if the business license picture can be optimized, so as to generate a processing result;
the result feedback unit is used for feeding back the processing result to the terminal so as to display the processing result on the terminal;
the positioning judging unit comprises a category judging subunit and a confidence judging subunit;
a category judging subunit, configured to judge whether a picture category in the positioning result is a category in which a target exists, and if the picture category in the positioning result is not the category in which the target exists, the business license picture positioning is unsuccessful; the confidence coefficient judging subunit is used for judging whether the confidence coefficient is not smaller than a confidence coefficient threshold value if the picture class in the positioning result is the class with the target existence; if the confidence coefficient is not smaller than a confidence coefficient threshold value, the business license picture is successfully positioned; if the confidence coefficient is smaller than a confidence coefficient threshold value, the business license picture is unsuccessfully positioned;
When the target cannot be positioned in the picture positioning process, the current business license picture is not clear and cannot meet the current requirement; when a target can be detected in the picture positioning process, whether the confidence coefficient corresponding to the target area meets the requirement or not needs to be judged, and when the confidence coefficient meets the requirement, the business license picture meets the picture quality requirement.
8. A computer device, characterized in that it comprises a memory on which a computer program is stored and a processor which, when executing the computer program, implements the method according to any of claims 1-6.
9. A storage medium storing a computer program which, when executed by a processor, performs the method of any one of claims 1 to 6.
CN202010295135.0A 2020-04-15 2020-04-15 Business license picture quality detection method and device, computer equipment and storage medium Active CN111489347B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010295135.0A CN111489347B (en) 2020-04-15 2020-04-15 Business license picture quality detection method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010295135.0A CN111489347B (en) 2020-04-15 2020-04-15 Business license picture quality detection method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111489347A CN111489347A (en) 2020-08-04
CN111489347B true CN111489347B (en) 2023-10-31

Family

ID=71811000

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010295135.0A Active CN111489347B (en) 2020-04-15 2020-04-15 Business license picture quality detection method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111489347B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112950337A (en) * 2021-04-27 2021-06-11 拉扎斯网络科技(上海)有限公司 Image processing method and device, electronic equipment and storage medium
CN113255671B (en) * 2021-07-05 2022-04-22 浙江智慧视频安防创新中心有限公司 Target detection method, system, device and medium for object with large length-width ratio

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109886264A (en) * 2019-01-08 2019-06-14 深圳禾思众成科技有限公司 A kind of character detecting method, equipment and computer readable storage medium
WO2019174130A1 (en) * 2018-03-14 2019-09-19 平安科技(深圳)有限公司 Bill recognition method, server, and computer readable storage medium
CN110569769A (en) * 2019-08-29 2019-12-13 浙江大搜车软件技术有限公司 image recognition method and device, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019174130A1 (en) * 2018-03-14 2019-09-19 平安科技(深圳)有限公司 Bill recognition method, server, and computer readable storage medium
CN109886264A (en) * 2019-01-08 2019-06-14 深圳禾思众成科技有限公司 A kind of character detecting method, equipment and computer readable storage medium
CN110569769A (en) * 2019-08-29 2019-12-13 浙江大搜车软件技术有限公司 image recognition method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111489347A (en) 2020-08-04

Similar Documents

Publication Publication Date Title
CN111507957B (en) Identity card picture conversion method and device, computer equipment and storage medium
EP3176751B1 (en) Information processing device, information processing method, computer-readable recording medium, and inspection system
CN106683073B (en) License plate detection method, camera and server
CN111489347B (en) Business license picture quality detection method and device, computer equipment and storage medium
WO2012039496A1 (en) Track estimation device and program
CN108960081B (en) Palm image recognition method and device and computer readable storage medium
CN110913243A (en) Video auditing method, device and equipment
CN110502977B (en) Building change classification detection method, system, device and storage medium
CN116168351B (en) Inspection method and device for power equipment
WO2021159802A1 (en) Graphical captcha recognition method, apparatus, computer device, and storage medium
US20220398824A1 (en) Reading system, reading device, reading method, and storage medium
JP2015103188A (en) Image analysis device, image analysis method, and image analysis program
CN112434640B (en) Method, device and storage medium for determining rotation angle of document image
CN107330470B (en) Method and device for identifying picture
CN111652117A (en) Method and medium for segmenting multi-document image
CN114445716B (en) Key point detection method, key point detection device, computer device, medium, and program product
CN110263736A (en) A kind of component identification method, apparatus, storage medium and system
CN111833289B (en) Defect identification method, device and equipment
CN112232338A (en) Data entry method, device, equipment and storage medium for underwriting and claim settlement process
Srinark et al. A microarray image analysis system based on multiple snakes
CN111833288B (en) Image recognition method, device and equipment
CN110751158A (en) Digital identification method and device in therapeutic bed display and storage medium
US9202097B2 (en) Information processing apparatus, information processing method, and computer program product
CN117874158B (en) Self-adaptive adjustment method and device for clustered map position data
CN115631493B (en) Text region determining method, system and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant