CN111553431A - Picture definition detection method and device, computer equipment and storage medium - Google Patents

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

Info

Publication number
CN111553431A
CN111553431A CN202010364110.1A CN202010364110A CN111553431A CN 111553431 A CN111553431 A CN 111553431A CN 202010364110 A CN202010364110 A CN 202010364110A CN 111553431 A CN111553431 A CN 111553431A
Authority
CN
China
Prior art keywords
picture
training
target
text
network
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
CN202010364110.1A
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.)
Shanghai Eye Control Technology Co Ltd
Original Assignee
Shanghai Eye Control Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Eye Control Technology Co Ltd filed Critical Shanghai Eye Control Technology Co Ltd
Priority to CN202010364110.1A priority Critical patent/CN111553431A/en
Publication of CN111553431A publication Critical patent/CN111553431A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • 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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses a picture definition detection method and device, computer equipment and a storage medium. The method comprises the steps of obtaining a target certificate picture, and intercepting at least one target text picture from the target certificate picture, wherein the target text picture contains certificate text information; performing definition classification processing on each target text picture to obtain a classification result, wherein the classification result is used for indicating whether the target text picture is clear or not; and determining the clear state of the target certificate picture according to the classification result of each target text picture. The picture definition detection method provided by the embodiment of the application can improve the detection accuracy.

Description

Picture definition detection method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of image detection technologies, and in particular, to a method and an apparatus for detecting image sharpness, a computer device, and a storage medium.
Background
In daily life, a scene that a user needs to upload a certificate picture to verify the identity of the user often occurs, for example, in vehicle inspection, in order to verify the identity of the user, the user needs to upload a certificate picture such as a driving license, an identity card, a driving license of a vehicle and the like to a detection system, and the detection system needs to check the definition of the uploaded certificate picture.
In the prior art, the process of checking the definition of a certificate picture is generally as follows: inputting the certificate picture into a trained picture detection model, and determining the definition of the certificate picture through the picture detection model, wherein the picture detection model is trained on a sample label formed by an average subjective Opinion Score (MOS).
However, since the MOS is subjective scoring of the subject, the MOS is too subjective, and the definition of the certificate picture is not clearly defined, when the definition of the certificate picture is detected to be clear according to the above method, it cannot be guaranteed that all pixel points on the certificate picture are clear, so that the situation of erroneous judgment is easily caused, and the accuracy is not high.
Disclosure of Invention
In view of the above, it is necessary to provide a picture sharpness detection method, an apparatus, a computer device, and a storage medium for solving the above problem of low accuracy.
A picture definition detection method comprises the following steps:
acquiring a target certificate picture, and intercepting at least one target text picture from the target certificate picture, wherein the target text picture contains certificate text information;
performing definition classification processing on each target text picture to obtain a classification result, wherein the classification result is used for indicating whether the target text picture is clear or not;
and determining the clear state of the target certificate picture according to the classification result of each target text picture.
In an embodiment of the present application, performing sharpness classification processing on each target text picture includes:
acquiring a preset picture classification network, wherein the picture classification network is obtained after an initial picture classification network is trained, the initial picture classification network is obtained according to a trained twin network, and the twin network is used for distinguishing whether the definitions of two text pictures are the same or not;
and inputting the target text picture into a picture classification network, and classifying the target text picture by the picture classification network.
In one embodiment of the present application, the training process of the picture classification network includes:
acquiring a first training sample set and a second training sample set, wherein the first training sample set comprises a plurality of first training samples, the first training samples comprise two training text pictures and a combined label for indicating whether definition labels of the two training text pictures are the same or not, the definition labels are used for indicating the definition states of the training text pictures, the second training sample set comprises a plurality of second training samples, and the second training samples comprise the training text pictures and the definition labels of the training text pictures;
training the initial twin network by using the first training sample set to obtain a trained twin network, and constructing an initial picture classification network according to the trained twin network;
and training the initial picture classification network by using the second training sample set to obtain the picture classification network.
In an embodiment of the present application, constructing an initial picture classification network according to a trained twin network includes:
and taking the trained network parameters of the twin network as the network parameters of the initial picture classification network to obtain the initial picture classification network.
In one embodiment of the present application, obtaining a first set of training samples and a second set of training samples comprises:
acquiring a plurality of training text pictures, and calculating the definition of each training text picture through a Laplace algorithm;
determining a definition label of each training text picture according to the definition of each training text picture;
and obtaining a first training sample set and a second training sample set according to the training text pictures and the definition labels of the training text pictures.
In an embodiment of the present application, determining the clear state of the target document picture according to the classification result of each target text picture includes:
and when each target text picture in the target certificate picture is clear, determining that the target certificate picture is clear.
In one embodiment of the present application, acquiring a target document picture includes:
acquiring a target certificate picture uploaded by a user through a terminal;
correspondingly, the method further comprises:
and when the target certificate picture is fuzzy, sending a picture retransmission instruction to the terminal, wherein the picture retransmission instruction is used for indicating to upload the certificate picture again.
A picture sharpness detection apparatus, the apparatus comprising:
the acquisition module is used for acquiring a target certificate picture and intercepting at least one target text picture from the target certificate picture, wherein the target text picture comprises certificate text information;
the classification module is used for performing definition classification processing on each target text picture to obtain a classification result, and the classification result is used for indicating whether the target text picture is clear or not;
and the clear state determining module is used for determining the clear state of the target certificate picture according to the classification result of each target text picture.
A computer device comprising a memory and a processor, the memory storing a computer program that when executed by the processor performs the steps of:
acquiring a target certificate picture, and intercepting at least one target text picture from the target certificate picture, wherein the target text picture contains certificate text information;
performing definition classification processing on each target text picture to obtain a classification result, wherein the classification result is used for indicating whether the target text picture is clear or not;
and determining the clear state of the target certificate picture according to the classification result of each target text picture.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a target certificate picture, and intercepting at least one target text picture from the target certificate picture, wherein the target text picture contains certificate text information;
performing definition classification processing on each target text picture to obtain a classification result, wherein the classification result is used for indicating whether the target text picture is clear or not;
and determining the clear state of the target certificate picture according to the classification result of each target text picture.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
the picture definition detection method, the picture definition detection device, the computer equipment and the storage medium can improve the detection accuracy. In the image definition detection method, a plurality of target text images containing certificate text information are intercepted from target certificate images, then definition classification processing is carried out on each target text image, whether each target text image is clear or not is determined, and then the definition state of each target certificate image is determined according to whether each target text image is clear or not. In the embodiment of the application, the clear state of the target certificate picture is determined according to whether each target text picture containing the certificate text information on the target certificate picture is clear, and when the target certificate picture is clear, each target text picture on the target certificate picture is clear, so that the accurate judgment of the clear state of the target certificate picture is ensured, and the detection accuracy is improved.
Drawings
Fig. 1 is a schematic diagram of an implementation environment of a picture sharpness detection method according to an embodiment of the present application;
fig. 2 is a flowchart of a method for detecting picture sharpness according to an embodiment of the present disclosure;
fig. 3 is a flowchart of a method for sharpness classification processing according to an embodiment of the present disclosure;
fig. 4 is a flowchart of a method for training a picture classification network according to an embodiment of the present disclosure;
fig. 5 is a flowchart of a method for obtaining a first training sample set and a second training sample set according to an embodiment of the present application;
FIG. 6 is a block diagram of an apparatus for detecting sharpness of a picture according to an embodiment of the present disclosure;
fig. 7 is a block diagram of a computer device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
When the vehicle is inspected every year, the text information in the certificate pictures, such as the driver's driving license, the identification card, the vehicle's driving license and the like, needs to be inspected one by one, and the text information needs to be semantically identified under the condition that the certificate pictures are clear. However, in practical situations, many uploaded certificate pictures are blurred due to shooting problems or light problems, so that recognition of text information in the certificate pictures is affected. Therefore, before the certificate picture is identified, the definition of the certificate picture needs to be detected, and an unclear picture is separately screened out.
In the prior art, the process of checking the definition of a certificate picture is generally as follows: inputting the certificate picture into a trained picture detection model, and determining the definition of the certificate picture through the picture detection model, wherein the picture detection model is trained on a sample label formed by an average subjective Opinion Score (MOS).
However, since the MOS is subjective scoring of the subject, the MOS is too subjective, and the definition of the certificate picture is not clearly defined, when the definition of the certificate picture is detected to be clear according to the above method, it cannot be guaranteed that all pixel points on the certificate picture are clear, so that the situation of erroneous judgment is easily caused, and the accuracy is not high.
The embodiment of the application provides a picture definition detection method, which includes the steps of intercepting a plurality of target text pictures containing certificate text information from target certificate pictures, then carrying out definition classification processing on each target text picture so as to determine whether each target text picture is clear, and then determining the definition state of each target certificate picture according to whether each target text picture is clear. In the embodiment of the application, the clear state of the target certificate picture is determined according to whether each target text picture containing the certificate text information on the target certificate picture is clear, and when the target certificate picture is clear, each target text picture on the target certificate picture is clear, so that the accurate judgment of the clear state of the target certificate picture is ensured, and the detection accuracy is improved.
In the following, a brief description will be given of an implementation environment related to the picture sharpness detection method provided in the embodiment of the present application.
Fig. 1 is a schematic diagram of an implementation environment related to the picture sharpness detection method provided in the embodiment of the present application, as shown in fig. 1, the implementation environment may include a server 101 and a terminal 102, and the server 101 and the terminal 102 may communicate with each other through a wired network or a wireless network.
The terminal 102 may be a smart phone, a tablet computer, a wearable device, and the like. The server 101 may be one server or a server cluster including a plurality of servers.
In the implementation environment shown in fig. 1, the terminal 102 can send the target credential picture to the server 101. The server 101 may perform sharpness detection on the target certificate picture based on the picture sharpness detection method provided in the embodiment of the present application, and obtain a sharpness state of the target certificate picture. Optionally, the server 101 may return the clear status of the target certificate picture to the terminal 102.
Of course, in some possible implementations, an implementation environment related to the picture sharpness detection method provided in the embodiment of the present application may only include the terminal 102.
Under the condition that the implementation environment only includes the terminal 102, after the terminal 102 acquires the target certificate picture, the definition of the target certificate picture can be detected directly based on the picture definition detection method provided by the embodiment of the application.
Please refer to fig. 2, which shows a flowchart of a picture sharpness detecting method provided in the embodiment of the present application, where the picture sharpness detecting method may be applied to a server or a terminal in the implementation environment shown in fig. 1, and the embodiment of the present application only takes the case where the picture sharpness detecting method is applied to the terminal as an example for description, and a technical process when the picture sharpness detecting method is applied to the server is the same as a technical process when the picture sharpness detecting method is applied to the terminal, and the embodiment of the present application is not described again. As shown in fig. 2, the picture sharpness detecting method may include the following steps:
step 201, the terminal acquires a target certificate picture, and captures at least one target text picture from the target certificate picture.
In the embodiment of the application, the target certificate picture may be a single or multiple target certificate pictures, where the certificate text information in the target certificate picture may refer to text information.
The target document picture may be, for example: a driver's license, an identity card, a driver's license or a business license of a vehicle, etc., and the target certificate picture can also be a form picture.
The background of the target certificate picture is not limited, and the target certificate picture can be a real physical scene or a virtual scene. The target document image may have slight curl, fold, large amplitude tilt, uneven light exposure, etc. The colors of the target certificate picture and the certificate text information on the target certificate picture are not limited.
The target text picture is obtained by cutting a strip text area where the certificate text information on the target certificate picture is located. And the text content and the text arrangement mode of the certificate text information on the target certificate picture are not changed in the process of intercepting the target text picture.
In an optional implementation manner, in the embodiment of the present application, a process of capturing at least one target text picture from a target certificate picture by a terminal includes the following steps: and inputting the target certificate picture into the trained segmentation model, wherein the segmentation model can identify a strip text region where each certificate text information on the target certificate picture is located, and segmenting the strip text region from the target certificate picture to obtain the target text picture.
The segmentation model can be a PSENet model, wherein the PSENet model can position texts in any shapes, and the PSENet model provides a progressive scale expansion algorithm, so that adjacent certificate text information can be successfully identified, and different certificate text information can be intercepted into different target text pictures.
Generally, the number of the certificate text information on the target certificate picture is consistent with the number of the target text pictures obtained by segmentation. Each target text picture comprises certificate text information.
Step 202, the terminal performs definition classification processing on each target text picture to obtain a classification result.
In the embodiment of the application, the terminal can carry out definition classification processing on each target text picture one by one, so that the classification result of each target text picture is obtained one by one, and the classification result is used for indicating whether the target text picture is clear or not.
In an alternative implementation manner, before performing the sharpness classification processing on each target text picture, the terminal may perform preprocessing on each target text picture, for example, the preprocessing may include adjusting the size of the target text picture. Optionally, in this embodiment of the application, the size of the adjusted target text picture is a long strip. In the embodiment of the application, the adjusted target text picture does not have the same size in width and height, on one hand, the long-strip property of the long-strip text region is maintained, and on the other hand, the deformation of characters is avoided.
In another alternative implementation manner, in this embodiment of the application, the classification result may be a definition level of the target text picture. The sharpness grade may be represented numerically. For example, a definition level of 0 indicates that the target text picture is clear, a definition level of 1 indicates that the definition of the target text picture is general, and a definition level of 2 indicates that the target text picture is fuzzy.
And 203, the terminal determines the clear state of the target certificate picture according to the classification result of each target text picture.
Optionally, in this embodiment of the application, when each target text picture of the target certificate picture is clear, it is determined that the clear state of the target certificate picture is clear.
And when any one of the target text pictures of the target certificate picture is fuzzy, determining that the clear state of the target certificate picture is fuzzy.
According to the image definition detection method provided by the embodiment of the application, the definition state of the target certificate image is determined according to whether each of a plurality of target text images containing certificate text information on the target certificate image is clear or not. The clarity status of the target document picture can be determined to be clear only if each target text picture on the target document picture is clear. Therefore, the detection accuracy of the definition of the target certificate picture is improved.
In one embodiment of the present application, as shown in fig. 3, step 202 may further include the steps of:
step 301, the terminal acquires a preset picture classification network.
In the embodiment of the application, the picture classification network is pre-stored in a database of the terminal. The image classification network is obtained after an initial image classification network is trained, the initial image classification network is obtained according to a trained twin network, and the twin network is used for distinguishing whether the definitions of the two text images are the same or not.
Optionally, in this embodiment of the application, as shown in fig. 4, a training process of the terminal on the picture classification network may include the following steps:
step 401, the terminal obtains a first training sample set and a second training sample set.
The first training sample set is used for training the twin network, and the second training sample set is used for training the initial image classification network.
In the embodiment of the application, a plurality of training text pictures can be obtained, the definition of each training text picture is marked, a definition label of each training text picture is obtained, and the definition label is used for indicating the definition state of the training text picture. Sharpness labels may include clearness, blur, general clarity, and the like.
In an embodiment of the present application, a plurality of training text pictures may be randomly arranged and combined to obtain a plurality of first training samples, where the first training samples include two training text pictures and a combination label of the first training sample. The combined label is used to indicate whether the sharpness labels of the two training text pictures in the first training sample are the same.
Optionally, in this embodiment of the application, the multiple first training samples obtained after combination may further include at least two training text pictures and a combination label, where two, three, or more training text pictures may be included in the at least two training text pictures. The combined label may be used to indicate whether the sharpness labels corresponding to the at least two training text pictures are the same.
In this embodiment of the application, when the definition labels of two training text pictures in the same first training sample are the same, the combined label may be represented as 1, and when the definition labels of two training text pictures in the same first training sample are different, the combined label may be represented as 0.
In an embodiment of the application, the terminal may combine a training text picture and the definition label of the training text picture to obtain a second training sample, and combine the plurality of training text pictures and the definition label of each training text picture to obtain a plurality of second training samples, thereby obtaining a second training sample set.
And 402, the terminal trains the initial twin network by using the first training sample set to obtain the trained twin network, and constructs an initial picture classification network according to the trained twin network.
In the embodiment of the application, the twin network comprises two basic networks with the same structure, and the two basic networks are associated with each other by sharing the weight. The basic network can be a VGG network (a network proposed by Oxford Visual Geometry Group, VGG for short), an initiation network, a net network or a densenet network.
In the embodiment of the application, the base network of the twin network adopts a resnet18 network. The twin network is used to learn the commonalities and differences of the two training text pictures in each first training sample.
The loss function of the twin network can be selected as coherent loss. And when the initial twin network is trained, calculating a loss value according to the combined label output by the initial twin network and the actual combined label of the first training sample. And updating the weight value related to the basic network according to the loss value.
In this embodiment of the application, the process of constructing the initial picture classification network according to the trained twin network may include:
and taking the trained network parameters of the twin network as the network parameters of the initial picture classification network to obtain the initial picture classification network.
The trained network parameters of the twin network are used as the network parameters of the initial image classification network, so that the image classification network can be converged better and faster.
The network structure of the initial picture classification network is the same as that of the basic network in the twin network, and the network parameters of the initial picture classification network are the same as those of the basic network in the trained twin network.
Since the initial picture classification network only includes one basic network, the loss function of the initial picture classification network is no longer applicable to a coherent loss. In the embodiment of the present application, the loss function of the initial picture classification network may be a softmax loss function, and in the embodiment of the present application, a centerlos (chinese: central loss) is additionally introduced as an auxiliary classification loss function, so that the classification effect is better.
In the embodiment of the present application, the expression of center loss may be shown as formula (1):
Figure BDA0002476125260000101
where m represents the size of the batch size (number of samples selected for training), xiRepresents the ith sampleCenter of the book, cyiThe center of each batch (Chinese: batch) is represented.
cyiAnd updating the position of the center point by using the current sample, calculating the distance C between the current sample and the centers of the M sample groups respectively in each round, and superposing the distance C on the centers of the M sample groups in a gradient mode.
And 403, the terminal trains the initial image classification network by using a second training sample set to obtain an image classification network.
In the embodiment of the present application, a part of the second training samples may be extracted from the second training sample set as the test set. After the initial picture classification network is trained, the trained picture classification network may be tested using a test set.
In the embodiment of the application, the twin network and the picture classification network are adopted to train the model in sequence, so that the trained picture classification network is more stable.
Step 302, the terminal inputs the target text picture into a picture classification network for obtaining a classification result.
In the embodiment of the application, the image classification network is used for classifying the target text image and outputting the classification result as the definition of the judgment target text image.
In the embodiment of the application, the commonalities and differences of the training text pictures are learned through the twin network, so that the trained twin network can identify whether the definition labels of the two training text pictures are the same or not. On the basis that whether the definition labels of the two pictures are the same or not can be identified, a second training sample consisting of the training text picture and the definition labels is learned, so that the picture classification network can rapidly and accurately classify the text pictures, and the accuracy of classifying the target text pictures is improved.
In another embodiment of the present application, as shown in fig. 5, the obtaining of the first training sample set and the second training sample set in step 401 may include the following steps;
step 501, obtaining a plurality of training text pictures, and calculating the definition of each training text picture through a laplacian algorithm.
The laplacian algorithm is an edge detection algorithm, can be used for determining the intensity of the change of the picture features on the training text picture, and is commonly used for sharpening the picture or evaluating the definition of the picture.
In the embodiment of the present application, the mathematical expression of the laplace algorithm may be as shown in formula (2):
Figure BDA0002476125260000111
wherein the content of the first and second substances,
Figure BDA0002476125260000112
and f (x, y) represents the gray value of the pixel point of the x-th line and the y-th line in the target text picture.
The gradient value of each pixel point on the target text picture can be obtained according to the formula (1), and the gradient value of the pixel point can be used for expressing the continuous change condition of the gray around the pixel point. And calculating the definition of the target text picture according to the gradient value of the pixel point of each pixel point of the target text picture.
Step 502, determining the definition label of each training text picture according to the definition of each training text picture.
In the embodiment of the application, a plurality of definition thresholds can be set, a plurality of training text pictures are divided into a plurality of classification sets according to the definition thresholds, different classification sets correspond to different definition labels, and training text pictures in the same classification combination correspond to the same definition label.
It should be noted that, because the accuracy of calculating the definition of the training sample picture by the laplacian algorithm is not high, it is easy to occur that a fuzzy training text picture appears in the classification set with a clear definition label, and a clear training text picture appears in the classification set with a fuzzy definition label. Therefore, after the training text pictures are classified, the training text pictures in each classification set need to be manually screened, and the clear states of the training text pictures in the same classification set are ensured to be consistent.
In machine learning, it is generally assumed that each class in the training samples is equal in number, that is, the number of each class is balanced, however, in a real application scenario, the number of training text pictures included in each classification set may be different, for example, the number of training text pictures in a classification set with a fuzzy definition label is small, and the number of training text pictures in a classification set with a clear definition label is large. Therefore, the number of the training text pictures with clear definition labels in the first training sample set and the second training sample set formed based on the classification set is larger, and the number of the training text pictures with fuzzy definition labels is smaller. In the network training process, the image classification network focuses on the feature learning that the definition label is a clear training text image, and the 'light vision' definition label is the feature learning of a fuzzy training text image, so that the classification capability of the image classification network is influenced.
When the number of the training text pictures with the fuzzy definition labels is small, in the embodiment of the application, a part of candidate text pictures can be selected from the training text pictures with the fuzzy definition labels, then the candidate text pictures are fuzzified, then the definition of each fuzzified candidate text picture is calculated respectively, and the definition label of each fuzzified candidate text picture is determined according to the definition of each fuzzified candidate text picture.
It should be noted that, when the candidate text picture is subjected to the blurring processing, one candidate text picture may be blurred into different degrees of sharpness, that is, one candidate text picture may be blurred into one or more pictures with different degrees of sharpness.
By fuzzifying the clear pictures, the number of the training text pictures respectively included in the plurality of classification sets can be the same.
Step 503, obtaining a first training sample set and a second training sample set according to each training text picture and the definition label of each training text picture.
In the embodiment of the application, training text pictures included in the plurality of classification sets are arranged and combined to obtain a plurality of first training samples, and the plurality of first training samples can obtain a first training sample set.
It should be noted that the two training text pictures included in the first training sample may be the same training text picture, two different training text pictures with the same definition label, two different training text pictures with different definition labels, or a training text picture with different definition labels.
In the embodiment of the application, a plurality of second training samples can be obtained according to the training text pictures and the definition labels of the training text pictures, and a second training sample set is obtained through the plurality of second training samples.
In the embodiment of the application, the training text picture is primarily classified through a Laplace algorithm, and then a first training sample set and a second training sample set are formed on the basis of the primary classification. The training efficiency of the picture classification network is improved.
In this embodiment of the present application, when the method for detecting the sharpness of a picture is applied to a terminal in the implementation environment shown in fig. 1, the process of obtaining the target certificate picture in step 201 further includes the following steps:
the terminal can acquire the target certificate picture uploaded by the user through the operation interface of the terminal. And the terminal acquires a target certificate picture uploaded by the user and then detects the definition state of the target certificate picture based on the picture definition detection method disclosed in the step 201 to the step 204.
Correspondingly, the embodiment of the application also comprises the following contents: when the target certificate picture is fuzzy, the terminal can generate a picture retransmission instruction, and the picture retransmission instruction is used for instructing the user to upload the certificate picture again.
When the method for detecting the sharpness of the image is applied to the server in the implementation environment shown in fig. 1, the process of acquiring the image of the target certificate in step 201 further includes the following steps:
the user uploads the target certificate picture through the terminal, the terminal sends the target certificate picture to the server, and the server receives the target certificate picture and then detects the definition state of the target certificate picture based on the picture definition detection method disclosed in the steps 201 to 204.
Correspondingly, the embodiment of the application also comprises the following contents: when the target certificate picture is fuzzy, the server can generate a picture retransmission instruction and send the picture retransmission instruction to the terminal, wherein the picture retransmission instruction is used for indicating the user to upload the certificate picture again.
Referring to fig. 6, a block diagram of a picture sharpness detecting apparatus provided in an embodiment of the present application is shown, where the picture sharpness detecting apparatus may be configured in a terminal or a server in the implementation environment shown in fig. 1. As shown in fig. 6, the picture sharpness detecting apparatus may include an obtaining module 601, a classifying module 602, and a sharpness state determining module 603, where:
the acquisition module 601 is used for acquiring a target certificate picture, and intercepting at least one target text picture from the target certificate picture, wherein the target text picture contains certificate text information;
the classification module 602 is configured to perform sharpness classification processing on each target text picture to obtain a classification result, where the classification result is used to indicate whether the target text picture is sharp;
and a clear state determination module 603, configured to determine a clear state of the target certificate picture according to the classification result of each target text picture.
In one embodiment, the classification module 602 is further configured to obtain a preset picture classification network, where the picture classification network is obtained by training an initial picture classification network, the initial picture classification network is obtained by constructing a trained twin network, and the twin network is used to distinguish whether the definitions of two text pictures are the same; and inputting the target text picture into a picture classification network, and classifying the target text picture by the picture classification network.
In one embodiment, the classification module 602 is further configured to obtain a first training sample set and a second training sample set, where the first training sample set includes a plurality of first training samples, the first training sample set includes two training text pictures and a combined label used for indicating whether sharpness labels of the two training text pictures are the same, the sharpness label is used for indicating a sharpness state of the training text pictures, the second training sample set includes a plurality of second training samples, and the second training sample includes a training text picture and a sharpness label of the training text picture;
training the initial twin network by using the first training sample set to obtain a trained twin network, and constructing an initial picture classification network according to the trained twin network;
and training the initial picture classification network by using the second training sample set to obtain the picture classification network.
In an embodiment, the classification module 602 is further configured to use the trained network parameters of the twin network as the network parameters of the initial picture classification network to obtain the initial picture classification network.
In one embodiment, the classification module 602 is further configured to obtain a plurality of training text pictures, and calculate the definition of each training text picture through a laplacian algorithm;
determining a definition label of each training text picture according to the definition of each training text picture;
and obtaining a first training sample set and a second training sample set according to the training text pictures and the definition labels of the training text pictures.
In one embodiment, the clarity state determination module 603 is further configured to determine that the target document picture is clear when each of the target text pictures in the target document picture is clear.
In one embodiment, the obtaining module 601 is further configured to obtain a target certificate picture uploaded by a user through a terminal; correspondingly, the device also comprises: and the sending module is used for sending a picture retransmission instruction to the terminal when the target certificate picture is fuzzy, wherein the picture retransmission instruction is used for indicating to upload the certificate picture again.
For specific limitations of the picture sharpness detecting apparatus, reference may be made to the above limitations on the picture sharpness detecting method, which is not described herein again. All or part of the modules in the picture definition 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 of the present application, a computer device is provided, and the computer device may be a terminal or a server, and its internal structure diagram may be as shown in fig. 7. The computer device includes a processor, a memory, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The database is used for storing preset image classification networks. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The computer program is executed by a processor to implement a picture sharpness detection method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment of the present application, there is provided a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring a target certificate picture, and intercepting at least one target text picture from the target certificate picture, wherein the target text picture contains certificate text information; performing definition classification processing on each target text picture to obtain a classification result, wherein the classification result is used for indicating whether the target text picture is clear or not; and determining the clear state of the target certificate picture according to the classification result of each target text picture.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: acquiring a preset picture classification network, wherein the picture classification network is obtained after an initial picture classification network is trained, the initial picture classification network is obtained according to a trained twin network, and the twin network is used for distinguishing whether the definitions of two text pictures are the same or not; and inputting the target text picture into a picture classification network, and classifying the target text picture by the picture classification network.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: acquiring a first training sample set and a second training sample set, wherein the first training sample set comprises a plurality of first training samples, the first training samples comprise two training text pictures and a combined label for indicating whether definition labels of the two training text pictures are the same or not, the definition labels are used for indicating the definition states of the training text pictures, the second training sample set comprises a plurality of second training samples, and the second training samples comprise the training text pictures and the definition labels of the training text pictures; training the initial twin network by using the first training sample set to obtain a trained twin network, and constructing an initial picture classification network according to the trained twin network; and training the initial picture classification network by using the second training sample set to obtain the picture classification network.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: and taking the trained network parameters of the twin network as the network parameters of the initial picture classification network to obtain the initial picture classification network.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: acquiring a plurality of training text pictures, and calculating the definition of each training text picture through a Laplace algorithm; determining a definition label of each training text picture according to the definition of each training text picture; and obtaining a first training sample set and a second training sample set according to the training text pictures and the definition labels of the training text pictures.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: and when each target text picture in the target certificate picture is clear, determining that the target certificate picture is clear.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: acquiring a target certificate picture uploaded by a user through a terminal; correspondingly, the following steps are also implemented: and when the target certificate picture is fuzzy, sending a picture retransmission instruction to the terminal, wherein the picture retransmission instruction is used for indicating to upload the certificate picture again.
The implementation principle and technical effect of the computer device provided by the embodiment of the present application are similar to those of the method embodiment described above, and are not described herein again.
In an embodiment of the application, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of:
acquiring a target certificate picture, and intercepting at least one target text picture from the target certificate picture, wherein the target text picture contains certificate text information; performing definition classification processing on each target text picture to obtain a classification result, wherein the classification result is used for indicating whether the target text picture is clear or not; and determining the clear state of the target certificate picture according to the classification result of each target text picture.
In one embodiment of the application, the computer program, when executed by the processor, may further implement the steps of: acquiring a preset picture classification network, wherein the picture classification network is obtained after an initial picture classification network is trained, the initial picture classification network is obtained according to a trained twin network, and the twin network is used for distinguishing whether the definitions of two text pictures are the same or not; and inputting the target text picture into a picture classification network, and classifying the target text picture by the picture classification network.
In one embodiment of the application, the computer program, when executed by the processor, may further implement the steps of: acquiring a first training sample set and a second training sample set, wherein the first training sample set comprises a plurality of first training samples, the first training samples comprise two training text pictures and a combined label for indicating whether definition labels of the two training text pictures are the same or not, the definition labels are used for indicating the definition states of the training text pictures, the second training sample set comprises a plurality of second training samples, and the second training samples comprise the training text pictures and the definition labels of the training text pictures; training the initial twin network by using the first training sample set to obtain a trained twin network, and constructing an initial picture classification network according to the trained twin network; and training the initial picture classification network by using the second training sample set to obtain the picture classification network.
In one embodiment of the application, the computer program, when executed by the processor, may further implement the steps of: and taking the trained network parameters of the twin network as the network parameters of the initial picture classification network to obtain the initial picture classification network.
In one embodiment of the application, the computer program, when executed by the processor, may further implement the steps of: acquiring a plurality of training text pictures, and calculating the definition of each training text picture through a Laplace algorithm; determining a definition label of each training text picture according to the definition of each training text picture; and obtaining a first training sample set and a second training sample set according to the training text pictures and the definition labels of the training text pictures.
In one embodiment of the application, the computer program, when executed by the processor, may further implement the steps of: and when each target text picture in the target certificate picture is clear, determining that the target certificate picture is clear.
In one embodiment of the application, the computer program, when executed by the processor, may further implement the steps of: acquiring a target certificate picture uploaded by a user through a terminal; correspondingly, the following steps are also implemented: and when the target certificate picture is fuzzy, sending a picture retransmission instruction to the terminal, wherein the picture retransmission instruction is used for indicating to upload the certificate picture again.
The implementation principle and technical effect of the computer-readable storage medium provided in the embodiment of the present application are similar to those of the method embodiment described above, and are not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include 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).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the claims. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A picture definition detection method is characterized by comprising the following steps:
acquiring a target certificate picture, and intercepting at least one target text picture from the target certificate picture, wherein the target text picture contains certificate text information;
performing definition classification processing on each target text picture to obtain a classification result, wherein the classification result is used for indicating whether the target text picture is clear or not;
and determining the clear state of the target certificate picture according to the classification result of each target text picture.
2. The method according to claim 1, wherein said performing a sharpness classification process on each of the target text pictures comprises:
acquiring a preset picture classification network, wherein the picture classification network is obtained after an initial picture classification network is trained, the initial picture classification network is obtained according to a trained twin network, and the twin network is used for distinguishing whether the definitions of two text pictures are the same or not;
and inputting the target text picture into the picture classification network, and classifying the target text picture by the picture classification network.
3. The method of claim 2, wherein the training process of the picture classification network comprises:
acquiring a first training sample set and a second training sample set, wherein the first training sample set comprises a plurality of first training samples, the first training samples comprise two training text pictures and a combined label for indicating whether definition labels of the two training text pictures are the same or not, the definition labels are used for indicating the definition states of the training text pictures, the second training sample set comprises a plurality of second training samples, and the second training samples comprise the training text pictures and the definition labels of the training text pictures;
training an initial twin network by using the first training sample set to obtain the trained twin network, and constructing the initial picture classification network according to the trained twin network;
and training the initial picture classification network by using the second training sample set to obtain the picture classification network.
4. The method of claim 3, wherein the constructing the initial picture classification network from the trained twin network comprises:
and taking the network parameters of the trained twin network as the network parameters of the initial picture classification network to obtain the initial picture classification network.
5. The method of claim 3, wherein obtaining the first set of training samples and the second set of training samples comprises:
acquiring a plurality of training text pictures, and calculating the definition of each training text picture through a Laplace algorithm;
determining a definition label of each training text picture according to the definition of each training text picture;
and obtaining the first training sample set and the second training sample set according to the definition labels of the training text pictures and the definition labels of the training text pictures.
6. The method of claim 1, wherein determining the clarity status of the target document picture according to the classification result of each target text picture comprises:
and when each target text picture in the target certificate pictures is clear, determining that the target certificate pictures are clear.
7. The method of claim 1, wherein the capturing a target document picture comprises:
acquiring the target certificate picture uploaded by a user through a terminal;
correspondingly, the method further comprises:
and when the target certificate picture is fuzzy, sending a picture retransmission instruction to the terminal, wherein the picture retransmission instruction is used for indicating to upload the certificate picture again.
8. An apparatus for detecting sharpness of a picture, the apparatus comprising:
the acquisition module is used for acquiring a target certificate picture and intercepting at least one target text picture from the target certificate picture, wherein the target text picture comprises certificate text information;
the classification module is used for performing definition classification processing on each target text picture to obtain a classification result, and the classification result is used for indicating whether the target text picture is clear or not;
and the clear state determining module is used for determining the clear state of the target certificate picture according to the classification result of each target text picture.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any 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 method of any one of claims 1 to 7.
CN202010364110.1A 2020-04-30 2020-04-30 Picture definition detection method and device, computer equipment and storage medium Pending CN111553431A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010364110.1A CN111553431A (en) 2020-04-30 2020-04-30 Picture definition detection method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010364110.1A CN111553431A (en) 2020-04-30 2020-04-30 Picture definition detection method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111553431A true CN111553431A (en) 2020-08-18

Family

ID=72007815

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010364110.1A Pending CN111553431A (en) 2020-04-30 2020-04-30 Picture definition detection method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111553431A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112131121A (en) * 2020-09-27 2020-12-25 腾讯科技(深圳)有限公司 Fuzzy detection method and device for user interface, electronic equipment and storage medium
CN112967191A (en) * 2021-02-19 2021-06-15 泰康保险集团股份有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN113902740A (en) * 2021-12-06 2022-01-07 深圳佑驾创新科技有限公司 Construction method of image blurring degree evaluation model

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108898579A (en) * 2018-05-30 2018-11-27 腾讯科技(深圳)有限公司 A kind of image definition recognition methods, device and storage medium
WO2019100814A1 (en) * 2017-11-24 2019-05-31 阿里巴巴集团控股有限公司 Method and apparatus for assisting image of article complaying with requirements, and electronic device
CN109948625A (en) * 2019-03-07 2019-06-28 上海汽车集团股份有限公司 Definition of text images appraisal procedure and system, computer readable storage medium
CN110287971A (en) * 2019-05-22 2019-09-27 平安银行股份有限公司 Data verification method, device, computer equipment and storage medium
CN110533097A (en) * 2019-08-27 2019-12-03 腾讯科技(深圳)有限公司 A kind of image definition recognition methods, device, electronic equipment and storage medium
CN110807491A (en) * 2019-11-05 2020-02-18 上海眼控科技股份有限公司 License plate image definition model training method, definition detection method and device
CN110880023A (en) * 2019-12-03 2020-03-13 支付宝(杭州)信息技术有限公司 Method and device for detecting certificate picture
CN110929806A (en) * 2019-12-06 2020-03-27 腾讯科技(北京)有限公司 Picture processing method and device based on artificial intelligence and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019100814A1 (en) * 2017-11-24 2019-05-31 阿里巴巴集团控股有限公司 Method and apparatus for assisting image of article complaying with requirements, and electronic device
CN108898579A (en) * 2018-05-30 2018-11-27 腾讯科技(深圳)有限公司 A kind of image definition recognition methods, device and storage medium
CN109948625A (en) * 2019-03-07 2019-06-28 上海汽车集团股份有限公司 Definition of text images appraisal procedure and system, computer readable storage medium
CN110287971A (en) * 2019-05-22 2019-09-27 平安银行股份有限公司 Data verification method, device, computer equipment and storage medium
CN110533097A (en) * 2019-08-27 2019-12-03 腾讯科技(深圳)有限公司 A kind of image definition recognition methods, device, electronic equipment and storage medium
CN110807491A (en) * 2019-11-05 2020-02-18 上海眼控科技股份有限公司 License plate image definition model training method, definition detection method and device
CN110880023A (en) * 2019-12-03 2020-03-13 支付宝(杭州)信息技术有限公司 Method and device for detecting certificate picture
CN110929806A (en) * 2019-12-06 2020-03-27 腾讯科技(北京)有限公司 Picture processing method and device based on artificial intelligence and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
XIAOJING GU等: "On the Detection of Fake Certificates via Attribute Correlation", 《ENTROPY》, 8 June 2015 (2015-06-08) *
张伟超;肖中俊;严志国;: "基于Opencv和Tesseract的行驶证识别***设计", 齐鲁工业大学学报, no. 01, 15 February 2020 (2020-02-15) *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112131121A (en) * 2020-09-27 2020-12-25 腾讯科技(深圳)有限公司 Fuzzy detection method and device for user interface, electronic equipment and storage medium
CN112967191A (en) * 2021-02-19 2021-06-15 泰康保险集团股份有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN112967191B (en) * 2021-02-19 2023-12-05 泰康保险集团股份有限公司 Image processing method, device, electronic equipment and storage medium
CN113902740A (en) * 2021-12-06 2022-01-07 深圳佑驾创新科技有限公司 Construction method of image blurring degree evaluation model

Similar Documents

Publication Publication Date Title
WO2021027336A1 (en) Authentication method and apparatus based on seal and signature, and computer device
CN111680688B (en) Character recognition method and device, electronic equipment and storage medium
CN110390666B (en) Road damage detection method, device, computer equipment and storage medium
CN110569721A (en) Recognition model training method, image recognition method, device, equipment and medium
WO2021212659A1 (en) Video data processing method and apparatus, and computer device and storage medium
CN110705233B (en) Note generation method and device based on character recognition technology and computer equipment
CN113239874B (en) Behavior gesture detection method, device, equipment and medium based on video image
CN111553431A (en) Picture definition detection method and device, computer equipment and storage medium
CN111666990A (en) Vehicle damage characteristic detection method and device, computer equipment and storage medium
CN110889457B (en) Sample image classification training method and device, computer equipment and storage medium
CN111274957A (en) Webpage verification code identification method, device, terminal and computer storage medium
CN111368758A (en) Face ambiguity detection method and device, computer equipment and storage medium
CN112613553B (en) Picture sample set generation method and device, computer equipment and storage medium
CN112418009A (en) Image quality detection method, terminal device and storage medium
CN110728687B (en) File image segmentation method and device, computer equipment and storage medium
CN111144398A (en) Target detection method, target detection device, computer equipment and storage medium
CN112419270B (en) No-reference image quality evaluation method and device under meta-learning and computer equipment
CN113111880B (en) Certificate image correction method, device, electronic equipment and storage medium
CN111144372A (en) Vehicle detection method, device, computer equipment and storage medium
CN112668462A (en) Vehicle loss detection model training method, vehicle loss detection device, vehicle loss detection equipment and vehicle loss detection medium
CN112232336A (en) Certificate identification method, device, equipment and storage medium
CN114241463A (en) Signature verification method and device, computer equipment and storage medium
CN112464810A (en) Smoking behavior detection method and device based on attention map
CN110895849A (en) Method and device for cutting and positioning crown word number, computer equipment and storage medium
CN110472656B (en) Vehicle image classification method, device, computer equipment and storage medium

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