CN112287932B - Method, device, equipment and storage medium for determining image quality - Google Patents

Method, device, equipment and storage medium for determining image quality Download PDF

Info

Publication number
CN112287932B
CN112287932B CN201910668079.8A CN201910668079A CN112287932B CN 112287932 B CN112287932 B CN 112287932B CN 201910668079 A CN201910668079 A CN 201910668079A CN 112287932 B CN112287932 B CN 112287932B
Authority
CN
China
Prior art keywords
character
image
determining
recognized
content
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
CN201910668079.8A
Other languages
Chinese (zh)
Other versions
CN112287932A (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.)
Shanghai Goldway Intelligent Transportation System Co Ltd
Original Assignee
Shanghai Goldway Intelligent Transportation System 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 Goldway Intelligent Transportation System Co Ltd filed Critical Shanghai Goldway Intelligent Transportation System Co Ltd
Priority to CN201910668079.8A priority Critical patent/CN112287932B/en
Publication of CN112287932A publication Critical patent/CN112287932A/en
Application granted granted Critical
Publication of CN112287932B publication Critical patent/CN112287932B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • 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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • 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/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • 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)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Biophysics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Multimedia (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses a method, a device, equipment and a storage medium for determining image quality, and belongs to the technical field of image processing. The method comprises the following steps: acquiring a first image, wherein the first image comprises characters to be recognized; inputting the first image into a target network model, and determining the characteristics and character content of the character to be identified, wherein the target network model is used for determining the characteristics and character content of the character in any image based on the any image; synthesizing the character content with a background image template to obtain a second image; inputting the second image into the target network model, and determining the characteristics of the character content; and determining the image quality of the first image based on the characteristics of the character to be identified and the characteristics of the character content. Therefore, the problem that the image quality scoring value cannot accurately reflect the image quality due to semantic interference can be avoided, and the accuracy of the subsequent character recognition result is improved.

Description

Method, device, equipment and storage medium for determining image quality
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for determining image quality.
Background
In some scenarios, there may be a need to identify characters in an image. For example, at the time of case handling, an image including a suspected vehicle captured by monitoring may be identified as license plate information of the vehicle. In general, the recognition result is affected by the image quality, and for this purpose, the image quality may be determined to filter out images with poor quality, and character recognition may be performed based on images with good quality.
Currently, in the process of determining image quality, for an image, an area containing characters in the image is detected, the area is segmented from the image, the segmented area is input into a pre-trained recognition model, the confidence coefficient and content of each character are determined through the recognition model, the average confidence coefficient can be calculated according to the confidence coefficient of all the characters, the average confidence coefficient is further determined to be an image quality scoring value, and the image quality scoring value can reflect the image quality.
However, the above method is susceptible to interference of semantic association between the adjacent characters when determining the confidence level of each character. Assuming that the imaging of a character is not clear, the confidence corresponding to the character may be determined to be higher when the character is a content according to the semantics of the adjacent character, and a higher image quality grading value is obtained, and the image quality of the image may be determined to be better according to the image quality grading value. In this way, the determined image quality score value cannot accurately reflect the quality of the image, thereby affecting the subsequent character recognition result.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for determining image quality, which can solve the problem that the image quality grading value determined in the related technology cannot accurately reflect the image quality and affects the character recognition result. The technical scheme is as follows:
In one aspect, a method of determining image quality is provided, the method comprising:
acquiring a first image, wherein the first image comprises characters to be recognized;
Inputting the first image into a target network model, and determining the characteristics and character content of the character to be identified, wherein the target network model is used for determining the characteristics and character content of the character in any image based on the any image;
synthesizing the character content with a background image template to obtain a second image;
Inputting the second image into the target network model, and determining the characteristics of the character content;
And determining the image quality of the first image based on the characteristics of the character to be identified and the characteristics of the character content.
In one possible implementation manner of the present application, the synthesizing the character content with the background image template to obtain a second image includes:
Selecting a background image template from the at least one background image template;
Setting the font of the character content as a reference font, and setting the color of the character content as a target color, wherein the target color is different from the background color of the selected background image template;
and synthesizing the set character content with the selected background image template to obtain the second image.
In one possible implementation manner of the present application, the determining the image quality of the first image based on the feature of the character to be recognized and the feature of the character content includes:
Determining the similarity between the characteristics of the character to be identified and the characteristics of the character content;
And determining the image quality of the first image according to the similarity between the characteristics of the character to be recognized and the characteristics of the character content, wherein the similarity is inversely related to the image quality.
In one possible implementation manner of the present application, the determining the image quality of the first image based on the feature of the character to be recognized and the feature of the character content includes:
Determining Euclidean distance between the characteristics of the character to be identified and the characteristics of the character content;
And determining the image quality of the first image according to Euclidean distance between the characteristic of the character to be recognized and the characteristic of the character content, wherein the Euclidean distance is inversely related to the image quality.
In one possible implementation manner of the present application, before the inputting the first image into the target network model, the method further includes:
acquiring a plurality of image samples and character content of at least one character in each image sample;
And inputting the plurality of image samples and character content of at least one character in each image sample into a network model to be trained for training, so as to obtain the target network model.
In another aspect, there is provided an apparatus for determining image quality, the apparatus comprising:
the acquisition module is used for acquiring a first image, wherein the first image comprises characters to be identified;
The first determining module is used for inputting the first image into a target network model, determining the characteristics and the character content of the character to be identified, and determining the characteristics and the character content of the character in any image based on any image;
the synthesis module is used for synthesizing the character content with the background image template to obtain a second image;
The second determining module is used for inputting the second image into the target network model and determining the characteristics of the character content;
and a third determining module, configured to determine an image quality of the first image based on the feature of the character to be recognized and the feature of the character content.
In one possible implementation of the present application, the synthesis module is configured to:
Selecting a background image template from the at least one background image template;
Setting the font of the character content as a reference font, and setting the color of the character content as a target color, wherein the target color is different from the background color of the selected background image template;
and synthesizing the set character content with the selected background image template to obtain the second image.
In one possible implementation manner of the present application, the third determining module is configured to:
Determining the similarity between the characteristics of the character to be identified and the characteristics of the character content;
And determining the image quality of the first image according to the similarity between the characteristics of the character to be recognized and the characteristics of the character content, wherein the similarity is inversely related to the image quality.
In one possible implementation manner of the present application, the third determining module is configured to:
Determining Euclidean distance between the characteristics of the character to be identified and the characteristics of the character content;
And determining the image quality of the first image according to Euclidean distance between the characteristic of the character to be recognized and the characteristic of the character content, wherein the Euclidean distance is inversely related to the image quality.
In one possible implementation manner of the present application, the first determining module is further configured to:
acquiring a plurality of image samples and character content of at least one character in each image sample;
And inputting the plurality of image samples and character content of at least one character in each image sample into a network model to be trained for training, so as to obtain the target network model.
In another aspect, there is provided an apparatus comprising:
A processor;
a memory for storing processor-executable instructions;
Wherein the processor is configured to implement the steps of any of the methods of the above aspects.
In another aspect, a computer readable storage medium is provided, having stored thereon instructions which, when executed by a processor, implement the steps of any of the methods of the above aspects.
In another aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the steps of any of the methods of the above aspect.
The technical scheme provided by the embodiment of the application has the beneficial effects that:
In the process of determining the image quality, an image including a character to be recognized is acquired as a first image, the first image is input into a target network model, the target network model can determine the characteristics and character content of the character to be recognized, the character content is synthesized with a background image template, a second image can be obtained, the second image is input into the target network model, the characteristics of the character content can be determined, and as the character content is obtained based on the character to be recognized, the character content and the character to be recognized should be the same in the case of clear and recognizable image, and the character content and the character to be recognized may be different in the case of blurred image. Therefore, the image quality of the first image can be determined by determining the characteristics of the character to be recognized and the characteristics of the character content. Therefore, the problem that the image quality scoring value cannot accurately reflect the image quality due to semantic interference can be avoided, and the accuracy of the subsequent character recognition result is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart illustrating a method of determining image quality, according to an exemplary embodiment;
FIG. 2 is a schematic diagram illustrating one method of acquiring a first image according to an exemplary embodiment;
FIG. 3 is a schematic diagram of a first image shown according to an exemplary embodiment;
FIG. 4 is a schematic diagram of a second image shown according to an exemplary embodiment;
FIG. 5 is a flowchart illustrating a method of determining image quality according to another exemplary embodiment;
fig. 6 is a schematic structural view showing an apparatus for determining image quality according to an exemplary embodiment;
Fig. 7 is a schematic diagram of an apparatus according to an exemplary embodiment.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
Before describing a method for determining image quality provided by the embodiment of the present application in detail, an application scenario and an implementation environment related to the embodiment of the present application are described.
First, an application scenario according to an embodiment of the present application is briefly described.
In some scenes where characters in an image need to be identified, the identification result may be affected by the quality of the image when the characters are identified, so determining the quality of the image is greatly helpful in identifying the characters in the image. Currently, for an image, a region containing characters in the image is generally detected, the region is segmented from the image, and the number of characters contained in the region is detected, so that the number of characters can be determined as an image quality score value of the image of the region. However, when the image is blurred, the image quality score value of the image may still be high due to the relatively large number of characters in the image, and a conclusion may be drawn that the image quality of the image is good, but in practice, the image quality of the image is poor. Therefore, the determined image quality score value may not accurately reflect the quality of the image, affecting the subsequent character recognition result. To this end, an embodiment of the present application proposes a method for determining image quality, which can solve the above-mentioned problems, and its specific implementation is described in the following embodiments.
Next, an implementation environment related to the embodiment of the present application will be briefly described.
The method for determining image quality provided by the embodiment of the application can be executed by equipment. The device may be configured with a camera to capture a plurality of images by the camera, or the device may have a gallery stored therein to facilitate capturing a plurality of images from the gallery, or the device may have a video gallery stored therein to facilitate capturing a plurality of images from the video. Further, the apparatus may further include an image composition module that may be used to compose character content with the background image template. As an example, the device may be a terminal or a server, which is not limited in this embodiment of the present application.
Fig. 1 is a flowchart illustrating a method for determining image quality according to an exemplary embodiment, and the method is applied to the above implementation environment for illustration, and may include the following implementation steps:
Step 101: a first image is acquired, the first image comprising characters to be recognized.
Wherein the character to be recognized may include, but is not limited to, one or more of chinese characters, letters, numbers.
In determining the image quality, it is necessary to acquire an image including characters to be recognized in order to determine the image quality from the characters to be recognized in the image. For ease of understanding and description, the acquired image including the character to be recognized may be referred to as a first image.
As an example, for any image, a detection algorithm may determine whether a region containing a character exists in the image, if so, intercept the image of the region from the image, and determine that the image of the region is the first image. The image may be an image obtained from a gallery, or may be an image obtained by shooting with a camera, or may be a single frame image in a video.
That is, for any image, determining whether at least one region containing a character exists in the image through a detection algorithm, if so, cutting the image of the at least one region from the image, and determining the image of any region in the image of the at least one region as a first image; if not, acquiring another image, and continuing the operation.
Illustratively, an image shot by a camera is acquired, and if an area containing characters is detected in the image, the image of the area can be intercepted from the image, and the image of the area is determined as a first image; assuming that a plurality of areas containing characters are detected in the image, the images of the plurality of areas may be taken from the image, and any one of the images of the plurality of areas may be determined as a first image. For example, as shown in fig. 2, there are two areas containing characters in the image, the images of the two areas can be cut from the image, the first area image contains the characters of "PIG calendar risk", the second area image contains the characters of "PIG" and any one of the two area images can be determined as the first image.
Step 102: the first image is input into a target network model, characteristics and character content of characters to be recognized are determined, and the target network model is used for determining the characteristics and the character content of the characters in any image based on the image.
The target network model is obtained through deep learning training. That is, before the first image is input into the target network model to determine the characteristics and the character content of the character to be recognized, the network model to be trained needs to be trained to obtain the target network model. Illustratively, the network model to be trained may be a convolutional neural network, further, the network model to be trained may be VGG Net (VGG neural network), resNet (residual neural network), and the like, which is not limited in the embodiment of the present application.
In some embodiments, the network model to be trained is trained, character content of at least one character in a plurality of image samples and each image sample can be obtained, and the character content of at least one character in the plurality of image samples and each image sample is input into the network model to be trained for training, so that a target network model is obtained.
As an example, a plurality of image samples and character content of at least one character in each image sample are acquired, a plurality of images each containing a character may be acquired, a region image containing a character is respectively cut from each image, the plurality of region images containing a character are determined as a plurality of image samples, character content of at least one character in each image sample in the plurality of image samples may be obtained by manual recognition, and character content of at least one character in each image sample is acquired.
As an example, after acquiring a plurality of image samples and character content of at least one character in each image sample, character content of at least one character corresponding to each image sample and each image sample may be formed into a pair, and correspondingly input into a network model to be trained, so that training of the model to be trained may be achieved, and a target network model may be obtained.
It should be noted that, the plurality of image samples are typically image samples with better image quality, so that the character content of the characters in the plurality of image samples can be identified manually.
In some embodiments, the target network model may include an input layer, a convolution layer, a pooling layer, and an output layer, and after the device inputs the first image into the target network model, the target network model processes the first image sequentially through the input layer, the convolution layer, the pooling layer, and the output layer, and outputs the character content and the feature of the character to be recognized.
In some embodiments, when the number of characters to be recognized is one, after the first image is input into the target network model, the target network model may determine characteristics of the characters to be recognized, determine character content of the characters to be recognized based on the characteristics of the characters to be recognized, and output the characteristics of the characters to be recognized and the character content of the characters to be recognized.
For example, assuming that the first image contains a character "a" to be recognized, and the first image is very clear, after the first image is input into the target network model, the target network model may determine the feature f p1 of the character to be recognized, and may determine that the character content of the character to be recognized is "a" according to the feature f p1.
In other embodiments, when the number of characters to be recognized is plural, after inputting the first image into the target network model, the target network model may determine a feature of each character to be recognized in the plural characters to be recognized, sort the features of the plural characters to be recognized according to an order of determining the features of each character to be recognized, splice the sorted features together, and output the merged features as the features of the characters to be recognized. The character content of each character to be recognized can be determined based on the characteristics of the plurality of characters to be recognized, the character content of the plurality of characters to be recognized is ordered according to the order of determining the characteristics of each character to be recognized, and the ordered character content is output as the character content of the character to be recognized.
Illustratively, referring to fig. 3, assuming that the first image is an image of a license plate, the number of characters to be recognized is 7. After the first image is input into the target network model, the target network model can sequentially extract the characteristics of each character to be identified from left to right to obtain the characteristics of 7 characters to be identified, the characteristics of the 7 ordered characters to be identified are assumed to be F p1、fp2、fp3、fp4、fp5、fp6、fp7, and the characteristics of the 7 characters to be identified are spliced together to obtain F p=(fp1,fp2,fp3,fp4,fp5,fp6,fp7) to be used as the characteristics of the characters to be identified to be output. The character content of the first character to be recognized can be determined to be 'new' based on f p1, the character content of the second character to be recognized can be determined to be 'N' based on f p2 7, and the like, the content of each character to be recognized in the 7 characters to be recognized can be determined, and the character content of the 7 characters to be recognized is sequentially arranged to obtain 'new N7A 795', and the 'new N7A 795' is output as the character content of the character to be recognized.
It should be noted that, the feature f p of the character to be recognized is generally a vector with a dimension N, where N may be set by a user according to actual needs, or may be set by default by a device, which is not limited in the embodiment of the present application.
It should be noted that, the foregoing is merely an example in which the target network model includes an input layer, a convolution layer, a pooling layer, and an output layer, and in other embodiments, the target network model may further include other network layers, for example, may further include an implicit layer, etc., which is not limited in this embodiment of the present application.
Step 103: and synthesizing the character content with the background image template to obtain a second image.
The second image is an image with high image quality, and can be used for comparing with the first image to determine the image quality of the first image.
In some embodiments, synthesizing the character content with the background image template to obtain the second image may include the following two implementations:
The first implementation mode: selecting one background image template from at least one background image template, setting the font of the character content as a reference font, setting the color of the character content as a target color which is different from the background color of the selected background image template, and combining the set character content with the selected background image template to obtain a second image.
When selecting one background image template from at least one background image template, the background image template can be selected by a user according to actual needs, or can be selected by default by the device, which is not limited in the embodiment of the application.
The reference fonts can be set by a user according to actual needs, or can be set by default of the device, which is not limited in the embodiment of the present application.
Wherein the target color may be set by the user according to the background color of the selected background image template and the target color is different from the background color of the selected background image template, further, it may be determined that the target color has a great contrast with the background color of the selected background image template, so that the character content is more easily recognized.
For example, assuming that a plurality of background image templates exist in a gallery, a background image template with a blue background color is arbitrarily selected, a font of character content may be set as a regular script, a color of the character content may be set as white, and a second image of a blue-background white character may be obtained in an image synthesis module of the character content and blue background image template input device of the set white regular script.
The second implementation mode: setting a blank image as a background image template, setting the font of the character content as a reference font, setting the color of the character content as a target color which is different from the background color of the selected background image template, and combining the set character content with the selected background image template to obtain a second image.
That is, a blank image may be acquired, the color of the image may be arbitrarily set, the set image may be used as a background image template, the font and the color of the character content may be arbitrarily set, so long as the color of the character content is ensured to be different from the background color of the background image template, and the set character content and the set background image template may be synthesized to obtain the second image.
When the font of the character to be recognized of the first image is a relatively complex font, the reference font should be set as close as possible to the complex font.
Step 104: and inputting the second image into the target network model, and determining the characteristics of the character content.
The second image is input into a target network model which determines characteristics of the character content and outputs the characteristics of the character content.
In some embodiments, when the number of character contents is one, after the second image is input into the target network model, the target network model may determine the characteristics of the character contents and output the characteristics of the character contents.
Illustratively, assuming that the second image contains a character content and the second image is very clear, after inputting the second image into the target network model, the target network model may determine the characteristic f t1 of the character content and output the characteristic f t of the character content.
In other embodiments, when the number of character contents is plural, after the second image is input into the target network model, the target network model may determine a feature of each character content in the plurality of character contents, sort the features of the plurality of character contents according to an order in which the features of each character content are determined, and splice the sorted features together to output as the features of the character contents.
Illustratively, referring to fig. 4, assume that the second image is an image of a license plate, and the number of character contents is 7. After the second image is input into the target network model, the target network model can sequentially extract the characteristics of each character content from left to right to obtain the characteristics of 7 character contents, and the characteristics of the 7 character contents after sorting are assumed to be F t1、ft2、ft3、ft4、ft5、ft6、ft7, and the characteristics of the 7 character contents are spliced together to obtain F t=(ft1,ft2,ft3,ft4,ft5,ft6,ft7 to be output as the characteristics of the character contents.
Step 105: the image quality of the first image is determined based on the characteristics of the character to be identified and the characteristics of the character content.
Since the character content is obtained from the character to be recognized and the character to be recognized exists in the first image, the image quality of the first image can be determined from the characteristics of the character to be recognized and the characteristics of the character content. For example, referring to fig. 5, features of the character to be recognized may be compared with features of the character content to obtain image quality of the first image.
As an example, determining the image quality of the first image based on the characteristics of the character to be recognized and the characteristics of the character content may include two implementations:
the first implementation mode: and determining the similarity between the characteristics of the character to be identified and the characteristics of the character content, and determining the image quality of the first image according to the similarity between the characteristics of the character to be identified and the characteristics of the character content, wherein the similarity is inversely related to the image quality.
In some embodiments, the similarity between the feature of the character to be recognized and the feature of the character content is determined, the cosine similarity between the feature of the character to be recognized and the feature of the character content may be determined, and the image quality of the first image is determined according to the cosine similarity between the feature of the character to be recognized and the feature of the character content.
As an example, cosine similarity between the feature of the character to be recognized and the feature of the character content may be determined by the following formula (1).
In the above formula (1), sim cos is cosine similarity, F p represents a feature of a character to be recognized, F t represents a feature of a character content, represents a vector dot product, represents multiplication of scalars, and represents a modulus value of a calculation vector.
It should be noted that the cosine similarity obtained in the above manner is inversely related to the image quality of the first image. That is, the larger the value of the cosine similarity, the worse the image quality of the first image is explained; conversely, the smaller the cosine similarity value, the better the image quality of the first image.
The second implementation mode: determining Euclidean distance between the characteristic of the character to be recognized and the characteristic of the character content, and determining the image quality of the first image according to the Euclidean distance between the characteristic of the character to be recognized and the characteristic of the character content, wherein the Euclidean distance is inversely related to the image quality.
As an example, the euclidean distance between the feature of the character to be recognized and the feature of the character content may be determined by the following formula (2).
In the above formula (2), d is the euclidean distance, F p represents the feature of the character to be recognized, and F t represents the feature of the character content.
In other embodiments, a manhattan distance or mahalanobis distance between the feature of the character to be recognized and the feature of the character content may also be determined, and the image quality of the first image may be determined based on the manhattan distance or mahalanobis distance between the feature of the character to be recognized and the feature of the character content.
The euclidean distance obtained in the above manner is inversely related to the image quality of the first image. That is, the larger the value of the euclidean distance, the worse the image quality of the first image is explained; conversely, the smaller the value of the euclidean distance, the better the image quality of the first image.
It should be noted that, in the embodiment of the present application, when determining the characteristics of the character to be recognized and determining the characteristics of the character content, the characteristics are determined based on the actual imaging situation of the character to be recognized in the first image and the actual imaging situation of the character content in the second image, and are related to the interference factors. Therefore, the scheme of the application can be suitable for determining the image quality of the image under different interferences.
In the embodiment of the application, in the process of determining the image quality, an image comprising the character to be identified is acquired as a first image, the first image is input into a target network model, the target network model can determine the characteristics and character content of the character to be identified, the character content is synthesized with a background image template, a second image can be obtained, the second image is input into the target network model, the characteristics of the character content can be determined, and as the character content is obtained based on the character to be identified, the character content and the character to be identified are the same under the condition that the image is clearly identifiable, and the character content and the character to be identified are possibly different under the condition that the image is blurred. Therefore, the image quality of the first image can be determined by determining the characteristics of the character to be recognized and the characteristics of the character content. Therefore, the problem that the image quality scoring value cannot accurately reflect the image quality due to semantic interference can be avoided, and the accuracy of the subsequent character recognition result is improved.
Fig. 6 is a schematic diagram showing a structure of an apparatus for determining image quality, which may be implemented by software, hardware, or a combination of both, according to an exemplary embodiment. Referring to fig. 6, the apparatus may include: an acquisition module 601, a first determination module 602, a synthesis module 603, a second determination module 604, and a third determination module 605.
An acquiring module 601, configured to acquire a first image, where the first image includes a character to be recognized;
a first determining module 602, configured to input a first image into a target network model, and determine characteristics and character content of a character to be identified, where the target network model is configured to determine characteristics and character content of a character in any image based on the any image;
a synthesizing module 603, configured to synthesize the character content with a background image template to obtain a second image;
a second determining module 604, configured to input a second image into the target network model, and determine a feature of the character content;
A third determining module 605 is configured to determine an image quality of the first image based on the feature of the character to be recognized and the feature of the character content.
In one possible implementation of the present application, the synthesizing module 603 is configured to:
Selecting a background image template from the at least one background image template;
Setting the font of the character content as a reference font, and setting the color of the character content as a target color, which is different from the background color of the selected background image template;
and synthesizing the set character content with the selected background image template to obtain a second image.
In one possible implementation of the present application, the third determining module 605 is configured to:
determining the similarity between the characteristics of the character to be identified and the characteristics of the character content;
and determining the image quality of the first image according to the similarity between the characteristics of the character to be identified and the characteristics of the character content, wherein the similarity is inversely related to the image quality.
In one possible implementation of the present application, the third determining module 605 is configured to:
determining Euclidean distance between the characteristics of the character to be identified and the characteristics of the character content;
and determining the image quality of the first image according to Euclidean distance between the characteristic of the character to be recognized and the characteristic of the character content, wherein the Euclidean distance is inversely related to the image quality.
In one possible implementation of the present application, the first determining module 602 is further configured to:
acquiring a plurality of image samples and character content of at least one character in each image sample;
inputting the plurality of image samples and character content of at least one character in each image sample into a network model to be trained for training, and obtaining a target network model.
In the embodiment of the application, in the process of determining the image quality, an image comprising the character to be identified is acquired as a first image, the first image is input into a target network model, the target network model can determine the characteristics and character content of the character to be identified, the character content is synthesized with a background image template, a second image can be obtained, the second image is input into the target network model, the characteristics of the character content can be determined, and as the character content is obtained based on the character to be identified, the character content and the character to be identified are the same under the condition that the image is clearly identifiable, and the character content and the character to be identified are possibly different under the condition that the image is blurred. Therefore, the image quality of the first image can be determined by determining the characteristics of the character to be recognized and the characteristics of the character content. Therefore, the problem that the image quality scoring value cannot accurately reflect the image quality due to semantic interference can be avoided, and the accuracy of the subsequent character recognition result is improved.
It should be noted that: the apparatus for determining image quality provided in the above embodiment is only exemplified by the division of the above functional modules when determining image quality, and in practical application, the above functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above. In addition, the apparatus for determining image quality provided in the above embodiment belongs to the same concept as the method embodiment for determining image quality, and the specific implementation process is detailed in the method embodiment, which is not repeated here.
Fig. 7 is a schematic structural diagram of an apparatus 700 according to an embodiment of the present application, where the apparatus 700 may be a terminal or a server. The apparatus 700 may be configured or configured differently to provide a relatively large variance, and may include one or more processors (central processing units, CPU) 701 and one or more memories 702, where the memories 702 store at least one instruction that is loaded and executed by the processors 701 to implement the methods for determining image quality provided by the above-described method embodiments.
Of course, the device 700 may also have a wired or wireless network interface, a keyboard, an input/output interface, and other components for implementing the functions of the device, which are not described herein.
The embodiment of the application also provides a non-transitory computer readable storage medium, which when executed by a processor of a mobile terminal, enables the mobile terminal to perform the method for determining image quality provided by the embodiment shown in fig. 1.
Embodiments of the present application also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of determining image quality provided by the above embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments of the application is not intended to limit the application to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the application are intended to be included within the scope of the application.

Claims (12)

1. A method of determining image quality, the method comprising:
acquiring a first image, wherein the first image comprises characters to be recognized;
When the number of the characters to be recognized is one, inputting the first image into a target network model, and determining the characteristics of the characters to be recognized; determining character content of the character to be recognized based on the characteristics of the character to be recognized;
When the number of the characters to be recognized is multiple, inputting the first image into the target network model, determining the characteristics of each character to be recognized in the multiple characters to be recognized, sorting the characteristics of the multiple characters to be recognized according to the sequence of determining the characteristics of each character to be recognized, and splicing the sorted characteristics together to be used as the characteristics of the characters to be recognized; determining character content of each character to be identified based on the characteristics of the plurality of characters to be identified, sorting the character content of the plurality of characters to be identified according to the sequence of determining the characteristics of each character to be identified, and taking the sorted character content as the character content of the character to be identified;
synthesizing the character content with a background image template to obtain a second image;
Inputting the second image into the target network model when the number of the character contents is one, and determining the characteristics of the character contents;
When the number of the character contents is multiple, inputting the second image into the target network model, determining the characteristics of each character content in the multiple character contents, sorting the characteristics of the multiple character contents according to the order of determining the characteristics of each character content, and splicing the sorted characteristics together to serve as the characteristics of the character contents;
And determining the image quality of the first image based on the characteristics of the character to be identified and the characteristics of the character content.
2. The method of claim 1, wherein the synthesizing the character content with a background image template to obtain a second image comprises:
Selecting a background image template from the at least one background image template;
Setting the font of the character content as a reference font, and setting the color of the character content as a target color, wherein the target color is different from the background color of the selected background image template;
and synthesizing the set character content with the selected background image template to obtain the second image.
3. The method of claim 1, wherein the determining the image quality of the first image based on the characteristics of the character to be recognized and the characteristics of the character content comprises:
Determining the similarity between the characteristics of the character to be identified and the characteristics of the character content;
And determining the image quality of the first image according to the similarity between the characteristics of the character to be recognized and the characteristics of the character content, wherein the similarity is inversely related to the image quality.
4. The method of claim 1, wherein the determining the image quality of the first image based on the characteristics of the character to be recognized and the characteristics of the character content comprises:
Determining Euclidean distance between the characteristics of the character to be identified and the characteristics of the character content;
And determining the image quality of the first image according to Euclidean distance between the characteristic of the character to be recognized and the characteristic of the character content, wherein the Euclidean distance is inversely related to the image quality.
5. The method of claim 1, wherein prior to inputting the first image into a target network model, further comprising:
acquiring a plurality of image samples and character content of at least one character in each image sample;
And inputting the plurality of image samples and character content of at least one character in each image sample into a network model to be trained for training, so as to obtain the target network model.
6. An apparatus for determining image quality, the apparatus comprising:
the acquisition module is used for acquiring a first image, wherein the first image comprises characters to be identified;
The first determining module is used for inputting the first image into a target network model when the number of the characters to be recognized is one, and determining the characteristics of the characters to be recognized; determining character content of the character to be recognized based on the characteristics of the character to be recognized; when the number of the characters to be recognized is multiple, inputting the first image into the target network model, determining the characteristics of each character to be recognized in the multiple characters to be recognized, sorting the characteristics of the multiple characters to be recognized according to the sequence of determining the characteristics of each character to be recognized, and splicing the sorted characteristics together to be used as the characteristics of the characters to be recognized; determining character content of each character to be identified based on the characteristics of the plurality of characters to be identified, sorting the character content of the plurality of characters to be identified according to the sequence of determining the characteristics of each character to be identified, and taking the sorted character content as the character content of the character to be identified;
the synthesis module is used for synthesizing the character content with the background image template to obtain a second image;
A second determining module, configured to input the second image into the target network model when the number of the character contents is one, and determine a feature of the character contents; when the number of the character contents is multiple, inputting the second image into the target network model, determining the characteristics of each character content in the multiple character contents, sorting the characteristics of the multiple character contents according to the order of determining the characteristics of each character content, and splicing the sorted characteristics together to serve as the characteristics of the character contents;
and a third determining module, configured to determine an image quality of the first image based on the feature of the character to be recognized and the feature of the character content.
7. The apparatus of claim 6, wherein the synthesis module is to:
Selecting a background image template from the at least one background image template;
Setting the font of the character content as a reference font, and setting the color of the character content as a target color, wherein the target color is different from the background color of the selected background image template;
and synthesizing the set character content with the selected background image template to obtain the second image.
8. The apparatus of claim 6, wherein the third determination module is to:
Determining the similarity between the characteristics of the character to be identified and the characteristics of the character content;
And determining the image quality of the first image according to the similarity between the characteristics of the character to be recognized and the characteristics of the character content, wherein the similarity is inversely related to the image quality.
9. The apparatus of claim 6, wherein the third determination module is to:
Determining Euclidean distance between the characteristics of the character to be identified and the characteristics of the character content;
And determining the image quality of the first image according to Euclidean distance between the characteristic of the character to be recognized and the characteristic of the character content, wherein the Euclidean distance is inversely related to the image quality.
10. The apparatus of claim 6, wherein the first determination module is further to:
acquiring a plurality of image samples and character content of at least one character in each image sample;
And inputting the plurality of image samples and character content of at least one character in each image sample into a network model to be trained for training, so as to obtain the target network model.
11. An apparatus, the apparatus comprising:
A processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the steps of any of the methods of claims 1-5.
12. A computer readable storage medium having instructions stored thereon, which when executed by a processor, implement the steps of the method of any of claims 1-5.
CN201910668079.8A 2019-07-23 2019-07-23 Method, device, equipment and storage medium for determining image quality Active CN112287932B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910668079.8A CN112287932B (en) 2019-07-23 2019-07-23 Method, device, equipment and storage medium for determining image quality

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910668079.8A CN112287932B (en) 2019-07-23 2019-07-23 Method, device, equipment and storage medium for determining image quality

Publications (2)

Publication Number Publication Date
CN112287932A CN112287932A (en) 2021-01-29
CN112287932B true CN112287932B (en) 2024-05-10

Family

ID=74419563

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910668079.8A Active CN112287932B (en) 2019-07-23 2019-07-23 Method, device, equipment and storage medium for determining image quality

Country Status (1)

Country Link
CN (1) CN112287932B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113537192B (en) * 2021-06-30 2024-03-26 北京百度网讯科技有限公司 Image detection method, device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018099194A1 (en) * 2016-11-30 2018-06-07 杭州海康威视数字技术股份有限公司 Character identification method and device
CN108875722A (en) * 2017-12-27 2018-11-23 北京旷视科技有限公司 Character recognition and identification model training method, device and system and storage medium
CN109685100A (en) * 2018-11-12 2019-04-26 平安科技(深圳)有限公司 Character identifying method, server and computer readable storage medium
CN110009027A (en) * 2019-03-28 2019-07-12 腾讯科技(深圳)有限公司 Comparison method, device, storage medium and the electronic device of image

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018099194A1 (en) * 2016-11-30 2018-06-07 杭州海康威视数字技术股份有限公司 Character identification method and device
CN108875722A (en) * 2017-12-27 2018-11-23 北京旷视科技有限公司 Character recognition and identification model training method, device and system and storage medium
CN109685100A (en) * 2018-11-12 2019-04-26 平安科技(深圳)有限公司 Character identifying method, server and computer readable storage medium
CN110009027A (en) * 2019-03-28 2019-07-12 腾讯科技(深圳)有限公司 Comparison method, device, storage medium and the electronic device of image

Also Published As

Publication number Publication date
CN112287932A (en) 2021-01-29

Similar Documents

Publication Publication Date Title
US10936911B2 (en) Logo detection
WO2020098250A1 (en) Character recognition method, server, and computer readable storage medium
CN105144239B (en) Image processing apparatus, image processing method
EP3772036A1 (en) Detection of near-duplicate image
US11244157B2 (en) Image detection method, apparatus, device and storage medium
KR101896357B1 (en) Method, device and program for detecting an object
CN111862035B (en) Training method of light spot detection model, light spot detection method, device and medium
CN107368827A (en) Character identifying method and device, user equipment, server
CN111079816A (en) Image auditing method and device and server
CN111259891B (en) Method, device, equipment and medium for identifying identity card in natural scene
CN110490190A (en) A kind of structured image character recognition method and system
He et al. Aggregating local context for accurate scene text detection
CN114972817A (en) Image similarity matching method, device and storage medium
CN112287932B (en) Method, device, equipment and storage medium for determining image quality
CN113780116A (en) Invoice classification method and device, computer equipment and storage medium
CN112633341A (en) Interface testing method and device, computer equipment and storage medium
CN112749696A (en) Text detection method and device
CN111435445A (en) Training method and device of character recognition model and character recognition method and device
CN113158745B (en) Multi-feature operator-based messy code document picture identification method and system
CN112488062B (en) Image identification method, device, equipment and medium
CN112446428B (en) Image data processing method and device
CN115004245A (en) Target detection method, target detection device, electronic equipment and computer storage medium
CN113592807A (en) Training method, image quality determination method and device, and electronic equipment
CN112084874A (en) Object detection method and device and terminal equipment
CN117576109B (en) Defect detection method, device, 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
GR01 Patent grant
GR01 Patent grant