CN113516597B - Image correction method, device and server - Google Patents
Image correction method, device and server Download PDFInfo
- Publication number
- CN113516597B CN113516597B CN202110545221.7A CN202110545221A CN113516597B CN 113516597 B CN113516597 B CN 113516597B CN 202110545221 A CN202110545221 A CN 202110545221A CN 113516597 B CN113516597 B CN 113516597B
- Authority
- CN
- China
- Prior art keywords
- target
- image
- feature set
- certificate
- target image
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 87
- 238000003702 image correction Methods 0.000 title claims abstract description 58
- 238000012545 processing Methods 0.000 claims abstract description 107
- 230000009466 transformation Effects 0.000 claims abstract description 79
- 239000011159 matrix material Substances 0.000 claims abstract description 68
- 238000012937 correction Methods 0.000 claims abstract description 20
- 239000013598 vector Substances 0.000 claims description 20
- 238000012216 screening Methods 0.000 claims description 12
- 238000000354 decomposition reaction Methods 0.000 claims description 9
- 238000001914 filtration Methods 0.000 claims description 8
- 230000008859 change Effects 0.000 claims description 5
- 230000006641 stabilisation Effects 0.000 claims description 4
- 238000011105 stabilization Methods 0.000 claims description 4
- 230000000087 stabilizing effect Effects 0.000 claims description 4
- 230000008569 process Effects 0.000 abstract description 26
- 230000000694 effects Effects 0.000 abstract description 12
- 238000004891 communication Methods 0.000 description 18
- 238000012795 verification Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 11
- 238000012015 optical character recognition Methods 0.000 description 10
- 238000000513 principal component analysis Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000000605 extraction Methods 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 239000000203 mixture Substances 0.000 description 3
- 238000010845 search algorithm Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000006073 displacement reaction Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000000844 transformation Methods 0.000 description 2
- RWSOTUBLDIXVET-UHFFFAOYSA-N Dihydrogen sulfide Chemical compound S RWSOTUBLDIXVET-UHFFFAOYSA-N 0.000 description 1
- 108010001267 Protein Subunits Proteins 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000003745 diagnosis Methods 0.000 description 1
- 230000008030 elimination Effects 0.000 description 1
- 238000003379 elimination reaction Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000006386 memory function Effects 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/80—Geometric correction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
- Character Input (AREA)
Abstract
The present disclosure provides an image correction method, an image correction device, and a server, based on the image correction method, a first target feature set including a plurality of stable features having stability for linear transformation may be obtained by performing a preset feature process on the target image; processing the first target feature set by using a preset linear transformation matrix obtained based on the reference image to remove random noise generated in the acquisition process of the target image, so as to obtain a second target feature set with higher precision and meeting the requirement; and then the second target feature set can be used for carrying out corresponding correction processing on the target image. Therefore, the method can effectively aim at the target image which contains target certificates with more text characters and has linear distortion, is well suitable for various different types of linear distortion scenes, and can accurately eliminate linear distortion and random noise in the target image, so as to obtain the corrected target image with good effect and high precision.
Description
Technical Field
The specification belongs to the technical field of artificial intelligence, and particularly relates to an image correction method, an image correction device and a server.
Background
In some business processes, customers often need to provide and present documents, such as travel documents, to business process personnel that contain a large number of text characters.
Typically, a business clerk will first take an image containing the document and then perform OCR (optical character recognition) on the image to extract text information associated with the document.
However, the document image directly shot by the business office is relatively poor in quality, and interference factors such as linear distortion, random noise and the like often exist to influence the accuracy of the subsequent OCR recognition.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The specification provides an image correction method, an image correction device and an image correction server, which can effectively aim at a target image which contains target certificates with more text characters and has linear distortion, are well suitable for various different types of linear distortion scenes, accurately eliminate linear distortion and random noise in the target image, and obtain a corrected target image with good effect and high precision.
The image correction method provided in the embodiment of the present specification includes:
Acquiring a target image containing a target certificate; the target certificate is a certificate with the number of the contained text characters being larger than a preset character number threshold value;
Carrying out preset feature processing on the target image to obtain a first target feature set; wherein the first target feature set comprises a plurality of stable features;
Processing the first target feature set by using a preset linear transformation matrix to obtain a second target feature set meeting the requirements; the preset linear transformation matrix is obtained in advance based on a reference image; the reference image is an image containing a reference document;
and carrying out image correction processing on the target image according to the second target feature set so as to eliminate linear distortion in the target image.
In some embodiments, the target document comprises a travel document.
In some embodiments, where the target document comprises a travel document, the stabilizing feature comprises at least one of: certificate name, number plate number, vehicle type, owner, brand model number, and vehicle identification code.
In some embodiments, the preset linear transformation matrix is constructed as follows:
Acquiring a reference image containing a reference document; the reference certificate is the certificate with the same format as the target certificate, and the reference image is an image which contains the reference certificate and has no linear distortion;
Performing preset feature processing on the reference image to obtain a first reference feature set;
And constructing a preset linear transformation matrix according to the first reference feature set.
In some embodiments, constructing a preset linear transformation matrix from the first set of reference features includes:
SVD decomposition is carried out on the first reference feature set to obtain a corresponding feature vector set;
And screening out feature vectors with corresponding feature values larger than a preset feature threshold value from the feature vector set as principal component vectors to construct and obtain the preset linear transformation matrix.
In some embodiments, after constructing a preset linear transformation matrix from the first set of reference features, the method further comprises:
And performing linear transformation processing on the first reference feature set by using the linear transformation matrix to obtain a second reference feature set.
In some embodiments, performing image correction processing on the target image according to the second target feature set includes:
According to the second target feature set and the second reference feature set, obtaining a matching feature set through feature matching; wherein the matching feature set comprises a plurality of matching feature pairs;
and carrying out linear transformation processing on the target image according to the matching feature set.
In some embodiments, performing a preset feature process on the target image to obtain a first target feature set, including:
establishing a Gaussian pyramid related to the target image according to the target image;
determining and generating corresponding difference images according to the change data of pixel values between adjacent layer images in the Gaussian pyramid so as to construct a corresponding Gaussian difference pyramid;
And screening out the same characteristics among different differential images as stable characteristics according to the Gaussian differential pyramid so as to establish the first target characteristic set.
In some embodiments, after screening out the same features between different differential images as stable features according to the gaussian differential pyramid, the method further comprises:
Detecting whether the target image contains a sub-page certificate or not;
under the condition that the target image contains the sub-page certificate, determining the stable characteristic belonging to the sub-page certificate from the stable characteristics as an interference characteristic;
filtering interference features in the stability features.
In some embodiments, determining the stable feature belonging to the sub-page document from the stable features includes:
determining the relative distance between the features in the homepage certificate and the sub-page certificate according to the target layout rule matched with the target certificate;
And determining the stable characteristics belonging to the sub-page certificate from the stable characteristics according to the relative distance of the characteristics.
The embodiment of the present specification also provides an image correction apparatus, including:
The acquisition module is used for acquiring a target image containing a target certificate; the target certificate is a certificate with the number of the contained text characters being larger than a preset character number threshold value;
The first processing module is used for carrying out preset feature processing on the target image so as to obtain a first target feature set; wherein the first target feature set comprises a plurality of stable features;
The second processing module is used for processing the first target feature set by utilizing a preset linear transformation matrix to obtain a second target feature set meeting the requirements; the preset linear transformation matrix is obtained in advance based on a reference image; the reference image is an image containing a reference document;
And the correction module is used for carrying out image correction processing on the target image according to the second target feature set so as to eliminate linear distortion in the target image.
The embodiments of the present specification also provide a server, including a processor and a memory for storing instructions executable by the processor, where the processor implements: acquiring a target image containing a target certificate; the target certificate is a certificate with the number of the contained text characters being larger than a preset character number threshold value; carrying out preset feature processing on the target image to obtain a first target feature set; wherein the first target feature set comprises a plurality of stable features; processing the first target feature set by using a preset linear transformation matrix to obtain a second target feature set meeting the requirements; the preset linear transformation matrix is obtained in advance based on a reference image; the reference image is an image containing a reference document; and carrying out image correction processing on the target image according to the second target feature set so as to eliminate linear distortion in the target image.
The present description also provides a computer storage medium having stored thereon computer instructions that, when executed, implement: acquiring a target image containing a target certificate; the target certificate is a certificate with the number of the contained text characters being larger than a preset character number threshold value; carrying out preset feature processing on the target image to obtain a first target feature set; wherein the first target feature set comprises a plurality of stable features; processing the first target feature set by using a preset linear transformation matrix to obtain a second target feature set meeting the requirements; the preset linear transformation matrix is obtained in advance based on a reference image; the reference image is an image containing a reference document; and carrying out image correction processing on the target image according to the second target feature set so as to eliminate linear distortion in the target image.
According to the image correction method, the image correction device and the image correction server, a first target feature set containing a plurality of stable features with stability for linear transformation can be obtained by carrying out preset feature processing on the target image; processing the first target feature set by using a preset linear transformation matrix obtained based on the reference image to remove random noise generated in the acquisition process of the target image, so as to obtain a second target feature set with higher precision and meeting the requirement; and then the second target feature set can be used for carrying out corresponding correction processing on the target image. Therefore, the method can effectively aim at the target image which contains target certificates with more text characters and has linear distortion, is well suitable for various different types of linear distortion scenes, and can accurately eliminate linear distortion and random noise in the target image, so as to obtain the corrected target image with good effect and high precision.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure, the drawings that are required for the embodiments will be briefly described below, in which the drawings are only some of the embodiments described in the present disclosure, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of one embodiment of the structural composition of a system to which the image correction method provided in the embodiments of the present specification is applied;
FIG. 2 is a schematic diagram of one embodiment of an image correction method provided by embodiments of the present specification, in one example of a scenario;
FIG. 3 is a schematic diagram of one embodiment of an image correction method provided by embodiments of the present specification, in one example of a scenario;
FIG. 4 is a flow chart of an image correction method according to one embodiment of the present disclosure;
FIG. 5 is a schematic diagram of the structural composition of a server according to one embodiment of the present disclosure;
fig. 6 is a schematic structural composition diagram of an image correction apparatus provided in one embodiment of the present specification;
fig. 7 is a schematic diagram of an embodiment of an image correction method to which the embodiments of the present specification are applied in one scene example.
Detailed Description
In order to make the technical solutions in the present specification better understood by those skilled in the art, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
The embodiment of the specification provides an image correction method which can be applied to a system comprising a server and terminal equipment. Reference may be made in particular to fig. 1. The server and the terminal equipment can be connected in a wired or wireless mode to perform specific data interaction.
In this embodiment, the server may specifically include a background server applied to a network platform side and capable of implementing functions such as data transmission and data processing. Specifically, the server may be, for example, an electronic device having data operation, storage function and network interaction function. Or the server may be a software program running in the electronic device that provides support for data processing, storage, and network interactions. In the present embodiment, the number of servers included in the server is not particularly limited. The server may be one server, several servers, or a server cluster formed by several servers.
In this embodiment, the terminal device may specifically include a front-end electronic device applied to a user side, where a camera is connected inside or outside, and functions such as data acquisition and data transmission can be implemented. Specifically, the terminal device may be, for example, a smart phone, a monitor, a computer connected with a camera, and the like. Or the terminal device may be a software application capable of running in the electronic device described above. For example, it may be some monitoring APP running on a smart phone, etc.
In this embodiment, for the a service handling scenario requiring use of the running license, the terminal device may specifically be a mobile phone with a built-in camera used by a service handler, and the server may specifically be a server on the network platform side of the a service center. The current user prepares to apply for handling the A service, and the server needs to acquire some target text information which is more concerned on the running certificate of the user; and carrying out condition verification on the user according to the target text information so as to determine whether the user has the handling condition for handling the A service. And under the condition that the server passes the condition verification of the user, the service clerk can normally handle the service A for the user.
In specific implementation, the user can provide his own driving license according to the instruction of the service clerk. After receiving the running license of the user, the business clerk can use the mobile phone to shoot a picture containing the running license as a target image to be processed. And in particular, reference is made to fig. 2. And then the target image is sent to a server for processing through a mobile phone network or a WIFI network.
After receiving and acquiring the target image sent by the service clerk through the mobile phone, the server can detect that the target image contains the sub-page certificate.
The driving license is a license comprising two parts of a homepage license and a sub-page license, and more text characters are contained, belonging to a half-typing mode.
In this embodiment, the document in the half-typing mode may be specifically understood as that two text characters exist in the document, where one text character belongs to a more regular typing character printed in advance (for example, a text character "number plate number" on the document in an image, etc.), and the other text character belongs to a less regular non-typing character added later (for example, a text character corresponding to the text character "number plate number" is: "Shanghai DH9727", etc.).
In addition, the target certificate such as the driving license also comprises two parts of a homepage certificate and a sub-page certificate. Reference may be made to fig. 2. Wherein, the homepage certificate and the auxiliary page certificate respectively comprise a overprinting character and a non-overprinting character. And the homepage certificate and the auxiliary page certificate also contain part of overprinting characters which are the same and overlap. For example, the homepage document contains the overprinting character "number plate number" and the sub-page document also contains the same overprinting character "number plate number".
In the A business handling scene, only partial text information on the homepage certificate is required to be extracted and used, and text information on the subsidiary page certificate is not required to be used.
When a business clerk shoots a target image containing a running license of a user by using a mobile phone, the target image acquired by a server may contain a complete homepage certificate and a partial or complete sub-page certificate due to the influence of shooting distance, angle and other factors. See fig. 2. The target image obtained by the server contains a complete homepage certificate and a partial incomplete sub-page certificate.
In addition, due to the influence of factors such as shooting mode and placement position of the driving license, linear distortion of the driving license of the user is caused in the target image acquired by the server. Such linear distortions in turn have a large impact on the recognition accuracy of subsequent OCR recognition.
Therefore, in order to eliminate the interference influence of the sub-page credentials in the target image and improve the subsequent OCR recognition accuracy, after receiving the target image, the server may perform corresponding image correction processing on the target image: firstly, detecting and filtering interference features introduced by a sub-page certificate in a target image; and then eliminating linear distortion in the target image to obtain a corrected target image with higher precision and better quality.
When specifically performing image correction, the server may perform preset feature processing on the target image to obtain a first target feature set. The first target feature set may specifically include a plurality of stable features on a homepage document in the target image. The stabilizing feature may be, in particular, a overprint character on the homepage document in the target image that is stable to linear transformations. For example, text characters on a home page document: certificate name, number plate number, vehicle type, owner, brand model number, vehicle identification code, etc.
When the preset feature processing is specifically performed, the server can firstly establish a Gaussian pyramid related to the target image according to the target image; determining and generating corresponding difference images according to the change data of the pixel values between the adjacent layer images in the Gaussian pyramid so as to construct a corresponding Gaussian difference pyramid; and then screening out the same characteristics among different differential images according to the Gaussian differential pyramid to serve as stable characteristics.
After screening out the same features between different differential images as stable features, the server may further detect whether the target image includes a secondary page certificate. Specifically, the server can determine whether the target image contains the sub-page document by detecting whether the extracted stable features have overlapping features. Of course, the server may also determine whether the target image includes the secondary document by detecting whether a preset identification flag (e.g., a barcode on the secondary document) exists in the target image. The preset identification mark may be specific character or pattern, which is not present on the sub-page document and is easy to identify, and the like.
Under the condition that the target image contains the sub-page certificate, firstly, the server can determine a preset layout rule matched with the driving license from a plurality of preset layout rules as a target layout rule; and determining the relative distance between the features in the homepage certificate and the sub page certificate according to the target format rule. Then, the server can identify the stable characteristics belonging to the sub-page certificate in the target image as interference characteristics according to the relative distance of the characteristics.
Further, the server can filter the interference features in an array manner from the previously determined stability features, so that the interference influence of the sub-page credentials in the target image can be eliminated, and the filtered stability features only comprising the stability features on the homepage credentials in the target image are obtained. Based on the filtered stable features, a corresponding first set of target features may be combined.
After the first target feature set is obtained, the fact that more random noise exists in the target image in the shooting and obtaining process is considered, and data errors caused by the random noise are transmitted to the first target feature set through the preset feature processing, so that the determined first target feature set is low in precision and large in errors.
Therefore, the server can also acquire a preset linear transformation matrix matched with the driving license; and processing the first target feature set by using the preset linear transformation matrix to eliminate random noise errors and obtain a second target feature set with higher precision and smaller error. The preset linear transformation matrix may be specifically obtained in advance based on a reference image. The reference image may specifically be an image that contains the same reference document as the layout of the driver's license and that does not have linear distortion. The construction method of the preset linear transformation matrix will be described later.
After the second target feature set is obtained, the server may perform corresponding image correction processing on the target image according to the second target feature set, so as to eliminate linear distortion in the target image.
Specifically, the server may obtain a matching feature set through feature matching according to the second target feature set and the second reference feature set; and then carrying out linear transformation processing on the target image according to the matching feature set so as to realize image correction processing. The matching feature set may specifically include a plurality of matching feature pairs. The second reference feature set may specifically be a feature set obtained by performing a preset feature process and a random noise filtering process on the basis of a reference image including a reference text in advance. The second reference feature set may specifically include a plurality of stable features obtained based on a reference image.
In the implementation, the server may first find and acquire a second reference feature set matched with the driving license from a plurality of preset second reference feature sets.
Then, the server may call a preset search algorithm (for example, a fast nearest neighbor search algorithm), search the second reference feature set, so as to find, from the second reference feature set, two features with highest similarity to each stable feature (which may be denoted as a target feature: ri) included in the second target feature set, and respectively denote as reference features: fi_t1, fi_t2. Wherein, the similarity of fi_t1 and ri is higher than that of fi_t2 and ri. And combining the target feature ri with the two corresponding reference features fi_t1, fi_t2 to obtain an initial matching feature pair, which may be expressed as: (fi_t1-ri-fi_t2). In this way, the server can quickly process the second reference feature set and the second target feature set by calling a preset search algorithm to obtain a plurality of initial matching feature pairs.
Considering that the plurality of initial matching feature pairs may further have some invalid pseudo matching feature pairs with relatively large errors, the server may process the plurality of initial matching feature pairs respectively, so as to obtain corresponding valid matching feature pairs with relatively small errors based on the initial matching feature pairs to construct a corresponding matching feature set.
Take as an example the handling of any one of a plurality of initial matching feature pairs, the current initial matching feature pair (fi_t1-ri-fi_t2). The server may calculate the similarity distance between the target feature ri in the current initial matching feature pair and the two reference features (fi_t1 and fi_t2), respectively, and record as: di_1, di_2. Where di_1 represents the similarity distance between ri and fi_t1, and di_2 represents the similarity distance between ri and fi_t2. The server may calculate the ratio of the similarity distances between the two similarity distances as di_1/di_2; and compares the ratio of the similarity distances with a preset second threshold (e.g., ratio_threshold). The value of the preset second threshold may specifically be a value greater than or equal to 0.6 and less than or equal to 0.7.
Under the condition that the ratio of the similarity distances is smaller than a preset second threshold value through comparison, the fact that the difference of the similarity distances between two reference features and the target features in the current initial matching feature pair is large in a statistical sense and does not accord with the situation of pseudo matching can be judged. Further, it may be determined whether the value of the smaller one of the two similarity distances di_1 is sufficiently small, for example, smaller than a preset distance threshold.
In the case where di_1 is determined to be smaller than the preset distance threshold, it may be determined that: based on the current initial matching feature pair, a corresponding effective matching feature pair can be further extracted.
Specifically, the reference feature fi_t1 corresponding to di_1 may be extracted from the current initial feature matching pair, and combined with the target feature ri to obtain a corresponding valid matching feature pair, which is denoted as (fi_t1-ri).
Thus, the processing of the current initial matching feature pair is completed, and a corresponding effective matching feature pair is obtained; the next initial matching feature pair is then acquired and processed.
In contrast, when the ratio of the similarity distances is greater than or equal to the preset second threshold value through comparison, it can be determined that the difference of the similarity distances between the two reference features and the target feature in the current initial matching feature pair is smaller in a statistical sense, and the situation of conforming to the pseudo matching can be determined: based on the current initial matching feature pair, a corresponding effective matching feature pair cannot be further extracted.
Thus, the current initial matching feature pair may be culled from the plurality of initial matching feature pairs; the next initial matching feature pair is then acquired and processed.
According to the mode, a plurality of corresponding effective matching feature pairs can be obtained by processing a plurality of initial matching feature pairs; and combining a plurality of effective matching feature pairs to obtain a corresponding matching feature set.
After the matching feature set is obtained, the server can effectively utilize relatively more various and rich stable features according to the matching feature set, and does not rely on the single feature of the edge corner point of the outline, so as to perform corresponding image correction processing on the target image, thereby eliminating linear distortion in the target image.
Specifically, the server may obtain, by data fitting, a homography matrix mapped from the target image to the reference image according to the matching feature set, which may be denoted as H. The inverse matrix H' of the homography matrix can be regarded as a distortion model of the target image having linear distortion with respect to the standard reference image having no linear distortion.
In addition, in the fitting process, the server can screen out error interference data by utilizing a RANSAC algorithm so as to ensure the fitting robustness and improve the accuracy of the obtained homography matrix.
Then, the server can utilize the homography matrix to perform linear transformation processing on the target image so as to eliminate linear distortion which is originally present in the target image and is represented as deflection, and complete image correction processing on the target image, so that a corrected target image with the linear distortion eliminated is obtained.
And in particular, reference is made to fig. 3. Compared with the original target image, the corrected target image obviously eliminates the linear distortion which appears as deflection of the driving license; meanwhile, the sub page certificate contained in the original target image is filtered; and errors introduced by random noise are effectively eliminated.
Further, the server may slice the corrected target image according to the target plate rule, to obtain a plurality of slice images. And performing targeted OCR (optical character recognition) on the plurality of slice images to extract target text information which is concerned and related to the user and used for condition verification from the homepage certificate of the driving license.
And the server can perform condition verification on the user according to the target text information. In the case that the condition verification is passed, first indication information indicating that the verification is passed may be generated and transmitted to the business clerk mobile phone. The service clerk can normally transact the A service for the user according to the first indication information.
Conversely, in the case where the conditional verification is not passed, second indication information indicating that the verification is not passed may be generated and transmitted to the business clerk. The service clerk can pause the service A for the user according to the second indication information and perform corresponding explanation on the user.
Referring to fig. 4, an embodiment of the present disclosure provides an image correction method, where the method is specifically applied to a server side. In particular implementations, the method may include the following:
s401: acquiring a target image containing a target certificate; the target certificate is a certificate with the number of the contained text characters being larger than a preset character number threshold value;
s402: carrying out preset feature processing on the target image to obtain a first target feature set; wherein the first target feature set comprises a plurality of stable features;
S403: processing the first target feature set by using a preset linear transformation matrix to obtain a second target feature set meeting the requirements; the preset linear transformation matrix is obtained in advance based on a reference image; the reference image is an image containing a reference document;
s404: and carrying out image correction processing on the target image according to the second target feature set so as to eliminate linear distortion in the target image.
Through the embodiment, the first target feature set containing a plurality of stable features can be obtained by performing preset feature processing on the acquired target image; processing the first target feature set by using a preset linear transformation matrix based on PCA to eliminate random noise errors and obtain a relatively accurate and reliable second target feature set; and then, the second target feature set can be utilized to perform targeted image correction processing on the target image so as to eliminate linear distortion. Therefore, the method can effectively aim at the target image which contains target certificates with more text characters and has linear distortion, is well suitable for various different types of linear distortion scenes, and can accurately eliminate linear distortion and random noise in the target image, so that the corrected target image with good effect and high precision is obtained.
In some embodiments, the target image may be specifically understood as image data containing a target document. When the target image is specifically acquired, a picture of the target certificate can be taken as the target image through equipment with a built-in or externally connected camera. A screenshot containing the target document may also be taken from the video data as a target image or the like. Of course, the above-listed target image acquisition is only a schematic illustration. In the implementation, according to a specific application scenario, other suitable acquisition modes may also be adopted to acquire the target image.
In some embodiments, the target image may specifically be image data that includes a target document and has linear distortion to be corrected. The above linear distortion can be understood as an image error introduced by the image acquisition method. The linear distortion can cause interference to the image recognition of the subsequent target image and the extraction of the text information, and influence the extraction precision of the text information.
In some embodiments, the linear distortions introduced by different image acquisition modes tend to vary significantly. Specifically, the above linear distortion may include: when fixed acquisition equipment such as a scanner and a high-speed camera is used for acquiring a target image, linear distortion expressed as 2D displacement, 2D rotation and the like is introduced due to the difference of the placement positions of target texts; the linear distortion may further include: when a handheld acquisition device such as a mobile phone, a camera and the like is used for acquiring a target image, linear distortion representing 3D perspective deflection and the like are introduced due to the angle difference of a shooting surface of the handheld acquisition device relative to a front view surface.
In some linear distortion scenes, situations such as incomplete document contours in images or missing edge corner points of document contours can sometimes occur. The prior method often needs to extract and rely on edge corner points of certificate contours in images to construct corresponding distortion models so as to correct the images. For the above linear distortion scenario, the existing method is obviously inapplicable. In addition, based on the existing method, different distortion models are often required to be respectively constructed for different linear distortions to carry out specific correction. That is, based on the existing method, a unified distortion model cannot be constructed and used to correct for various different linear distortions. The image correction method provided by the embodiment of the specification can better solve the problems by effectively utilizing relatively various and rich stable characteristics instead of singly relying on edge corner points of certificate contours, and realizes correction processing of various different types of linear distortion. The specific correction processing will be described later.
In some embodiments, the target document may specifically refer to a document that contains a large number of text characters (e.g., the number of characters of the text characters is greater than a preset threshold of characters), and is based on a half-beat mode. Specifically, the target document may include at least one of: travel pattern, property pattern, student pattern, etc. Of course, it should be noted that the above-listed target text is only a schematic illustration.
Through the embodiment, the image correction method provided by the specification can be applied to process a plurality of target images containing different target certificates, so as to perform unified correction processing on linear distortion in the plurality of different target images.
In some embodiments, the above-described stabilization feature (or anchor feature) may refer to a feature on a target document in a target image that has better stability to linear transformations. Specifically, for a target document based on a half-swipe mode, the stable feature may be a more regular, fixed swipe character on the target document in the target image.
In some embodiments, where the target document comprises a travel document, the stabilizing feature comprises at least one of: certificate name, number plate number, vehicle type, owner, brand model number, vehicle identification code, etc. Of course, the above-listed stabilization features are only one illustrative example. In specific implementation, other types of features can be introduced as the above-mentioned stable features according to specific application scenarios and processing requirements.
Through the embodiment, aiming at the target image containing the driving license, the edge corner points of the single certificate contour relied on by the existing method can be obtained and replaced by the relatively more various and rich stable characteristics, so that the image correction processing can be better carried out on the target image.
In some embodiments, the foregoing performing a preset feature processing on the target image to obtain a first target feature set may include the following when implemented:
s1: establishing a Gaussian pyramid related to the target image according to the target image;
S2: determining and generating corresponding difference images according to the change data of pixel values between adjacent layer images in the Gaussian pyramid so as to construct a corresponding Gaussian difference pyramid;
s3: and screening out the same characteristics among different differential images as stable characteristics according to the Gaussian differential pyramid so as to establish the first target characteristic set.
Through the embodiment, a plurality of stable features with good stability for linear transformation can be accurately screened out according to the target image, so that a first target feature set meeting the requirements is constructed.
In some embodiments, in implementation, features common to a preset number (for example, 2 or 3, etc.) of differential images may be screened out as the stable features according to a gaussian differential pyramid; and combining the plurality of stable features to obtain a corresponding first target feature set.
In some embodiments, it is contemplated that a target document, such as a travel document, will often contain both the home page document and the secondary page document. Therefore, the acquired target image may contain some or all of the secondary page certificates in addition to the complete home page certificate. In many cases, however, only the text information on the home page document needs to be extracted; and the same and overlapped characteristics (marked as interference characteristics) on the secondary page certificate are often existed on the secondary page certificate, and the extraction of text information on the primary page certificate is interfered. It is noted that in order to filter the interference of the sub-page document, a corrected target image with relatively higher accuracy and relatively smaller error is obtained, and the sub-page document in the target image can be detected, so that the interference introduced by the sub-page document can be filtered in time.
In some embodiments, after the same features between different differential images are screened out according to the gaussian differential pyramid and used as stable features, the method may further include the following when implemented:
S1: detecting whether the target image contains a sub-page certificate or not;
S2: under the condition that the target image contains the sub-page certificate, determining the stable characteristic belonging to the sub-page certificate from the stable characteristics as an interference characteristic;
S3: filtering interference features in the stability features.
Through the embodiment, the interference characteristics belonging to the sub-page credentials in the stable characteristics can be timely determined and filtered under the condition that the sub-page credentials are detected to be contained in the target image, so that the error influence of the sub-page credentials in the target image on subsequent processing can be effectively eliminated.
In some embodiments, the determining the stable feature belonging to the sub-page document from the stable features may include: determining the relative distance between the features in the homepage certificate and the sub-page certificate according to the target layout rule matched with the target certificate; and determining the stable characteristics belonging to the sub-page certificate from the stable characteristics according to the relative distance of the characteristics.
Through the embodiment, the relative distance between the features determined by the homepage certificate and the sub-page certificate based on the format rule can be effectively utilized, and the interference features belonging to the sub-page certificate can be accurately identified and determined so as to perform corresponding elimination.
In some embodiments, a corresponding plurality of different preset layout rules may be configured for a plurality of different types of reference documents in advance. In specific implementation, a preset layout rule matched with the target certificate can be found from a plurality of preset layout rules to serve as the target layout rule.
In some embodiments, in addition to filtering interference features from stable features obtained based on preset feature processing according to a target layout rule, a target image may be processed according to the target layout rule by using a relative distance between features in a homepage document and a sub-page document, and an image area of the homepage document and an image area of the sub-page document are first distinguished and determined in the target image; and then the image area of the secondary page certificate is removed from the target image, so that the image area only containing the homepage certificate is obtained and used as the removed target image. Correspondingly, the target image after being removed can be used for replacing the original target image to participate in specific image correction processing, so that a corrected target image with relatively higher precision can be obtained.
In some embodiments, given that there is often a lot of random noise in the target image during acquisition, such random noise also affects the recognition accuracy of subsequent OCR recognition. Therefore, after the first target feature set is obtained, the first target feature set can be processed by using a preset linear transformation matrix, so that random noise errors are removed, and a relatively more accurate second target feature set is obtained.
In some embodiments, the above-mentioned preset linear transformation matrix may be specifically understood as a processing matrix for removing random noise based on PCA.
The PCA (PRINCIPLE COMPONENT ANALYSIS, principal component analysis) may specifically refer to a feature extraction method applied to the fields of comprehensive evaluation, speech recognition, fault diagnosis, and the like.
In some embodiments, the preset linear transformation matrix may be specifically obtained based on the reference image in advance. The reference image is understood to mean, in particular, an image which contains the same reference document as the target document format and which has no linear distortions and serves as a reference standard.
In some embodiments, before implementation, the preset linear transformation matrix may be constructed in the following manner:
S1: acquiring a reference image containing a reference document; the reference certificate is the certificate with the same format as the target certificate, and the reference image is an image which contains the reference certificate and has no linear distortion;
S2: performing preset feature processing on the reference image to obtain a first reference feature set;
S3: and constructing a preset linear transformation matrix according to the first reference feature set.
Through the embodiment, the linear transformation matrix based on PCA can be constructed in advance, the effect is relatively good, and random noise can be effectively eliminated.
In this embodiment, the process of performing the preset feature processing on the reference image may specifically refer to the previous embodiment of performing the preset feature processing on the target image. In this regard, the description is not repeated.
In some embodiments, the constructing a preset linear transformation matrix according to the first reference feature set may include: SVD decomposition is carried out on the first reference feature set to obtain a corresponding feature vector set; and screening out feature vectors with corresponding feature values larger than a preset feature threshold value from the feature vector set as principal component vectors to construct and obtain the preset linear transformation matrix.
Through the embodiment, the thought of principal component analysis of PCA can be effectively utilized, and a preset linear transformation matrix capable of retaining principal components and purposefully filtering random noise components is constructed.
In some embodiments, for example, for the first reference feature set (where the elements are 128-dimensional vectors), SVD decomposition may be performed first, and then the first few (for example, the first 48) feature vectors with larger feature values are selected as main components, so as to construct a corresponding preset linear transformation matrix, which may be denoted as a projector. And then, the projector can be used for carrying out corresponding feature transformation on the stable features contained in the first target feature set so as to keep the main components in the first target feature set and reduce the random noise components, thereby eliminating the random noise and obtaining a second target feature set with relatively higher precision.
The SVD decomposition may specifically be singular value decomposition (Singular Value Decomposition).
In some embodiments, after constructing a preset linear transformation matrix according to the first reference feature set, the method may further include the following when implemented: and performing linear transformation processing on the first reference feature set by using the linear transformation matrix to obtain a second reference feature set.
By the above embodiment, the random noise in the first reference feature set can be eliminated by processing the first reference feature set using the preset linear transformation matrix, so that the second reference feature set with relatively higher precision can be obtained.
The second reference feature set may be specifically understood as a feature set including a plurality of stable features extracted from the reference image, and used for performing image correction processing on the target image.
In some embodiments, the image correction processing on the target image according to the second target feature set may include the following when implemented: according to the second target feature set and the second reference feature set, obtaining a matching feature set through feature matching; wherein the matching feature set comprises a plurality of matching feature pairs; and carrying out linear transformation processing on the target image according to the matching feature set.
By the embodiment, the linear distortion in the target image can be removed by effectively utilizing the second target feature set and the second reference feature set, so that the image correction of the target image is realized, and the corrected target image with better effect and higher quality is obtained.
In some embodiments, after obtaining the corrected target image, the method further comprises: slicing the corrected target image according to a target layout rule matched with the target certificate to obtain a plurality of slice images; wherein each slice image carries a corresponding content tag; selecting a slice image containing the text information of interest from a plurality of slice images as a target slice image according to the content tag and the service requirement; and then, an OCR recognition model matched with the target slice image is called to carry out targeted OCR recognition processing on the target slice image so as to finely extract corresponding text information from the target slice image and take the corresponding text information as target text information.
In some embodiments, after the target text information is extracted, specific target data processing may be performed according to the target text information. For example, condition verification may be performed based on the target text information; business data statistics can also be performed by utilizing the target text information; the target text information can also be electronically archived, the corresponding database updated, and so forth.
From the above, according to the image correction method provided in the embodiment of the present disclosure, a first target feature set including a plurality of stable features having stability for linear transformation may be obtained by performing a preset feature process on the target image; processing the first target feature set by using a preset linear transformation matrix obtained based on the reference image to remove random noise generated in the acquisition process of the target image, so as to obtain a second target feature set with higher precision and meeting the requirement; and then the second target feature set can be used for carrying out corresponding correction processing on the target image. Therefore, the method can effectively aim at the target image which contains target certificates with more text characters and has linear distortion, is well suitable for various different types of linear distortion scenes, and can accurately eliminate linear distortion and random noise in the target image, so as to obtain the corrected target image with good effect and high precision.
The embodiment of the specification also provides a server, which comprises a processor and a memory for storing instructions executable by the processor, wherein the processor can execute the following steps according to the instructions when being implemented: acquiring a target image containing a target certificate; the target certificate is a certificate with the number of the contained text characters being larger than a preset character number threshold value; carrying out preset feature processing on the target image to obtain a first target feature set; wherein the first target feature set comprises a plurality of stable features; processing the first target feature set by using a preset linear transformation matrix to obtain a second target feature set meeting the requirements; the preset linear transformation matrix is obtained in advance based on a reference image; the reference image is an image containing a reference document; and carrying out image correction processing on the target image according to the second target feature set so as to eliminate linear distortion in the target image.
In order to more accurately complete the above instructions, referring to fig. 5, another specific server is provided in this embodiment of the present disclosure, where the server includes a network communication port 501, a processor 502, and a memory 503, and the above structures are connected by an internal cable, so that each structure may perform specific data interaction.
The network communication port 501 may be specifically configured to acquire a target image including a target certificate; the target certificate is a certificate with the number of the contained text characters being larger than a preset character number threshold value.
The processor 502 may be specifically configured to perform preset feature processing on the target image to obtain a first target feature set; wherein the first target feature set comprises a plurality of stable features; processing the first target feature set by using a preset linear transformation matrix to obtain a second target feature set meeting the requirements; the preset linear transformation matrix is obtained in advance based on a reference image; the reference image is an image containing a reference document; and carrying out image correction processing on the target image according to the second target feature set so as to eliminate linear distortion in the target image.
The memory 503 may be used to store a corresponding program of instructions.
In this embodiment, the network communication port 501 may be a virtual port that binds with different communication protocols, so that different data may be sent or received. For example, the network communication port may be a port responsible for performing web data communication, a port responsible for performing FTP data communication, or a port responsible for performing mail data communication. The network communication port may also be an entity's communication interface or a communication chip. For example, it may be a wireless mobile network communication chip, such as GSM, CDMA, etc.; it may also be a Wifi chip; it may also be a bluetooth chip.
In this embodiment, the processor 502 may be implemented in any suitable manner. For example, a processor may take the form of, for example, a microprocessor or processor, and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application SPECIFIC INTEGRATED Circuits (ASICs), programmable logic controllers, and embedded microcontrollers, among others. The description is not intended to be limiting.
In this embodiment, the memory 503 may include a plurality of layers, and in a digital system, the memory may be any memory as long as it can hold binary data; in an integrated circuit, a circuit with a memory function without a physical form is also called a memory, such as a RAM, a FIFO, etc.; in the system, the storage device in physical form is also called a memory, such as a memory bank, a TF card, and the like.
The embodiments of the present specification also provide a computer storage medium based on the above image correction method, the computer storage medium storing computer program instructions that when executed implement: acquiring a target image containing a target certificate; the target certificate is a certificate with the number of the contained text characters being larger than a preset character number threshold value; carrying out preset feature processing on the target image to obtain a first target feature set; wherein the first target feature set comprises a plurality of stable features; processing the first target feature set by using a preset linear transformation matrix to obtain a second target feature set meeting the requirements; the preset linear transformation matrix is obtained in advance based on a reference image; the reference image is an image containing a reference document; and carrying out image correction processing on the target image according to the second target feature set so as to eliminate linear distortion in the target image.
In the present embodiment, the storage medium includes, but is not limited to, a random access Memory (Random Access Memory, RAM), a Read-Only Memory (ROM), a Cache (Cache), a hard disk (HARD DISK DRIVE, HDD), or a Memory Card (Memory Card). The memory may be used to store computer program instructions. The network communication unit may be an interface for performing network connection communication, which is set in accordance with a standard prescribed by a communication protocol.
In this embodiment, the functions and effects of the program instructions stored in the computer storage medium may be explained in comparison with other embodiments, and are not described herein.
Referring to fig. 6, on a software level, the embodiment of the present disclosure further provides an image correction device, which may specifically include the following structural modules:
The acquiring module 601 may be specifically configured to acquire a target image including a target certificate; the target certificate is a certificate with the number of the contained text characters being larger than a preset character number threshold value;
The first processing module 602 may be specifically configured to perform preset feature processing on the target image to obtain a first target feature set; wherein the first target feature set comprises a plurality of stable features;
The second processing module 603 may specifically be configured to process the first target feature set by using a preset linear transformation matrix to obtain a second target feature set meeting the requirement; the preset linear transformation matrix is obtained in advance based on a reference image; the reference image is an image containing a reference document;
the correction module 604 may be specifically configured to perform an image correction process on the target image according to the second target feature set, so as to eliminate linear distortion in the target image.
It should be noted that, the units, devices, or modules described in the above embodiments may be implemented by a computer chip or entity, or may be implemented by a product having a certain function. For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, when the present description is implemented, the functions of each module may be implemented in the same piece or pieces of software and/or hardware, or a module that implements the same function may be implemented by a plurality of sub-modules or a combination of sub-units, or the like. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
From the above, based on the image correction device provided in the embodiments of the present disclosure, a first target feature set including a plurality of stable features with stability for linear transformation may be obtained by performing a preset feature process on the target image; processing the first target feature set by using a preset linear transformation matrix obtained based on the reference image to remove random noise generated in the acquisition process of the target image, so as to obtain a second target feature set with higher precision and meeting the requirement; and then the second target feature set can be used for carrying out corresponding correction processing on the target image. Therefore, the method can effectively aim at the target image which contains target certificates with more text characters and has linear distortion, is well suitable for various different types of linear distortion scenes, and can accurately eliminate linear distortion and random noise in the target image, so as to obtain the corrected target image with good effect and high precision.
In one specific example of a scenario, the image correction method provided by the embodiments of the present specification may be applied to construct an algorithm program for correcting a driver's license image (e.g., a target image of a target document included).
The algorithm program specifically comprises the following parts:
1) An initializing section: for and processing an input reference travel license (home page) image r_img (for example, a reference image of a home page document including a reference document);
2) An input section: for inputting and processing an original travel document image i_img to be processed (for example, a target image to be processed);
3) An output section: for outputting a processed corrected image o_img (for example, a corrected target image).
Specifically, when the above algorithm program is used to perform specific correction processing on the driving license image, as shown in fig. 7, specifically, the method may include: the initialization phase and the processing phase are 2 phases in total. The initialization stage comprises steps 0.1-0.5, and the algorithm program is executed once only when being started; the processing phase comprises steps 1-8, which process the algorithm program for each correction needs to be executed.
(1) Initialization phase
Step 0.1: based on the fixed layout position of the travel license (homepage) (e.g., target layout rule matching the travel license), the foreign language characters (number plate number, vehicle type, owner, address, use property, brand model, vehicle identification code, engine number, registration date, certification date, etc.) are masked to obtain a reference picture r_img' retaining only the template characters.
Step 0.2: through the image library API interface, a SIFT keypoint feature set f_t (e.g., a first reference feature set) of r_img' is extracted.
Step 0.3: SVD decomposition is carried out on F_T through the math library API interface, and all eigenvectors generated by the decomposition form a set V.
Step 0.4: in the feature vector set V, feature vectors corresponding to pca_size with larger feature values (verification finds that for a driving license homepage, the main component number pca_size can be set to about 48 to obtain good effect) are selected to form a linear transformation matrix projector (for example, a preset linear transformation matrix).
Step 0.5: feature transformation can be performed on the SIFT key point vector in f_t through a linear transformation matrix projector, so as to obtain a transformed reference map key point set denoted as f_t_pca (for example, a second reference feature set).
(2) Stage of treatment
Step 1: and extracting a SIFT key point feature set F_I (for example, a first target feature set) of the picture I_img to be processed (through preset feature processing) through an image library API interface.
Step 2: feature transformation can be performed on the SIFT key point vector in f_i by using a linear transformation matrix projector, and the transformed key point set is f_i_pca (for example, a second target feature set).
Step 3: and eliminating the possible sub-page interference key features (such as interference features) based on the relative distance between the overlapped template characters of number plate and number in the main page and the sub-page according to the prior information of the driving license format (such as target format rule).
Step 4: for each vector ft_i_pca in the reference map key set f_t_pca, 2 nearest neighbors f_i_pca_t1 and f_i_pca_t2 are found out in the to-be-processed map key set f_i_pca through KNN.
Step 5: the similarity distance di_1 between the key point vectors ft_i_pca and f_i_pca_t1, and the Euclidean distance di_2 between ft_i_pca and f_i_pca_t2 are calculated (initial matching feature pairs are obtained).
Step 6: the validity of the matching pair is judged according to the formula di_1/di_2< ratio_threshold (verification shows that the ratio_threshold can achieve good effect within the range of 0.6-0.7). Valid matching pairs are added to a matching pair set f_m (e.g., matching feature set).
Step 7: fitting a homography matrix H of the image to be processed mapped to the reference image according to F_M through an image library homography matrix fitting interface.
Step 8: a linear transformation H is applied to the to-be-processed ticket image i_img (to eliminate linear distortion) to obtain a target correction picture o_img (e.g., a corrected target image).
Through the scene example, the image correction method provided by the specification is verified, so that automatic correction processing on various linear distortions such as rotation, displacement, scaling and three-dimensional angle deflection in a driving license picture can be realized, various plane distortions and three-dimensional perspective distortions can be automatically compatible, and a unified general correction processing mode is provided. Unlike the previous correction method based on contour edge corner points, the algorithm program is still effective even in the case of losing contour information or having sub-page part interference due to serious distortion of the license image. In addition, the algorithm can also effectively process the driving license images acquired by various acquisition modes including mobile phone shooting, scanning pieces and the like. And the algorithm program has simple design thought, convenient use and better universality and robustness.
In the scene example, the algorithm program can specifically adopt opencv as a bottom image library, and a well-packaged calling mode is provided. In the concrete implementation and use process: the interface can be constructed through the initialization of the algorithm program, and the reference license image file storage path is input. And sets the super ratio threshold. It was found by verification that the ratio_threshold can be set to 0.6-0.7 for the driving license scene, and good effects can be obtained. The correction processing interface can be called, and the correction processing interface can be transmitted into the storage path of the identity card image file to be processed, so that the output image can be returned to obtain the correction result.
Although the present description provides method operational steps as described in the examples or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented by an apparatus or client product in practice, the methods illustrated in the embodiments or figures may be performed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even in a distributed data processing environment). The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, it is not excluded that additional identical or equivalent elements may be present in a process, method, article, or apparatus that comprises a described element. The terms first, second, etc. are used to denote a name, but not any particular order.
Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller can be regarded as a hardware component, and means for implementing various functions included therein can also be regarded as a structure within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
From the above description of embodiments, it will be apparent to those skilled in the art that the present description may be implemented in software plus a necessary general hardware platform. Based on such understanding, the technical solutions of the present specification may be embodied essentially in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and include several instructions to cause a computer device (which may be a personal computer, a mobile terminal, a server, or a network device, etc.) to perform the methods described in the various embodiments or portions of the embodiments of the present specification.
Various embodiments in this specification are described in a progressive manner, and identical or similar parts are all provided for each embodiment, each embodiment focusing on differences from other embodiments. The specification is operational with numerous general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
Although the present specification has been described by way of example, it will be appreciated by those skilled in the art that there are many variations and modifications to the specification without departing from the spirit of the specification, and it is intended that the appended claims encompass such variations and modifications as do not depart from the spirit of the specification.
Claims (11)
1. An image correction method, comprising:
Acquiring a target image containing a target certificate; the target certificate is a certificate with the number of the contained text characters being larger than a preset character number threshold value;
Carrying out preset feature processing on the target image to obtain a first target feature set; wherein the first target feature set comprises a plurality of stable features;
Processing the first target feature set by using a preset linear transformation matrix to obtain a feature set with random noise errors eliminated, wherein the feature set is used as a second target feature set meeting requirements; the preset linear transformation matrix is obtained in advance based on a reference image; the reference image is an image containing a reference document; the reference certificate is the certificate with the same format as the target certificate, and the reference image is an image which contains the reference certificate and has no linear distortion;
performing image correction processing on the target image according to the second target feature set so as to eliminate linear distortion in the target image;
the method for obtaining the first target feature set includes the steps of: establishing a Gaussian pyramid related to the target image according to the target image; determining and generating corresponding difference images according to the change data of pixel values between adjacent layer images in the Gaussian pyramid so as to construct a corresponding Gaussian difference pyramid; screening out the same features among different differential images as stable features according to the Gaussian differential pyramid so as to establish the first target feature set;
and screening out the same characteristics among different differential images according to the Gaussian differential pyramid, and further comprising: detecting whether the target image contains a sub-page certificate or not; under the condition that the target image contains the sub-page certificate, determining the stable characteristic belonging to the sub-page certificate from the stable characteristics as an interference characteristic; filtering interference features in the stability features.
2. The method of claim 1, wherein the target document comprises at least one of: travel pattern, property pattern, student pattern.
3. The method of claim 2, wherein, in the event that the target document comprises a travel document, the stabilizing feature comprises at least one of: certificate name, number plate number, vehicle type, owner, brand model number, and vehicle identification code.
4. The method according to claim 2, wherein the predetermined linear transformation matrix is constructed as follows:
Acquiring a reference image containing a reference document; the reference certificate is the certificate with the same format as the target certificate, and the reference image is an image which contains the reference certificate and has no linear distortion;
Performing preset feature processing on the reference image to obtain a first reference feature set;
And constructing a preset linear transformation matrix according to the first reference feature set.
5. The method of claim 4, wherein constructing a predetermined linear transformation matrix from the first set of reference features comprises:
SVD decomposition is carried out on the first reference feature set to obtain a corresponding feature vector set;
And screening out feature vectors with corresponding feature values larger than a preset feature threshold value from the feature vector set as principal component vectors to construct and obtain the preset linear transformation matrix.
6. The method of claim 4, wherein after constructing a predetermined linear transformation matrix from the first set of reference features, the method further comprises:
And performing linear transformation processing on the first reference feature set by using the linear transformation matrix to obtain a second reference feature set.
7. The method of claim 6, wherein performing image correction processing on the target image according to the second target feature set comprises:
According to the second target feature set and the second reference feature set, obtaining a matching feature set through feature matching; wherein the matching feature set comprises a plurality of matching feature pairs;
and carrying out linear transformation processing on the target image according to the matching feature set.
8. The method of claim 1, wherein determining the stabilization features belonging to the sub-page document from the stabilization features comprises:
determining the relative distance between the features in the homepage certificate and the sub-page certificate according to the target layout rule matched with the target certificate;
And determining the stable characteristics belonging to the sub-page certificate from the stable characteristics according to the relative distance of the characteristics.
9. An image correction apparatus, comprising:
The acquisition module is used for acquiring a target image containing a target certificate; the target certificate is a certificate with the number of the contained text characters being larger than a preset character number threshold value;
The first processing module is used for carrying out preset feature processing on the target image so as to obtain a first target feature set; wherein the first target feature set comprises a plurality of stable features;
The second processing module is used for processing the first target feature set by utilizing a preset linear transformation matrix to obtain a feature set with random noise errors eliminated, and the feature set is used as a second target feature set meeting the requirements; the preset linear transformation matrix is obtained in advance based on a reference image; the reference image is an image containing a reference document; the reference certificate is the certificate with the same format as the target certificate, and the reference image is an image which contains the reference certificate and has no linear distortion;
The correction module is used for carrying out image correction processing on the target image according to the second target feature set so as to eliminate linear distortion in the target image;
The first processing module is specifically configured to establish a gaussian pyramid related to the target image according to the target image; determining and generating corresponding difference images according to the change data of pixel values between adjacent layer images in the Gaussian pyramid so as to construct a corresponding Gaussian difference pyramid; screening out the same features among different differential images as stable features according to the Gaussian differential pyramid so as to establish the first target feature set;
and screening out the same characteristics among different differential images according to the Gaussian differential pyramid, and further comprising: detecting whether the target image contains a sub-page certificate or not; under the condition that the target image contains the sub-page certificate, determining the stable characteristic belonging to the sub-page certificate from the stable characteristics as an interference characteristic; filtering interference features in the stability features.
10. A server comprising a processor and a memory for storing processor-executable instructions, which when executed by the processor implement the steps of the method of any one of claims 1 to 8.
11. A computer storage medium having stored thereon computer instructions which, when executed, implement the steps of the method of any of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110545221.7A CN113516597B (en) | 2021-05-19 | 2021-05-19 | Image correction method, device and server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110545221.7A CN113516597B (en) | 2021-05-19 | 2021-05-19 | Image correction method, device and server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113516597A CN113516597A (en) | 2021-10-19 |
CN113516597B true CN113516597B (en) | 2024-05-28 |
Family
ID=78064683
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110545221.7A Active CN113516597B (en) | 2021-05-19 | 2021-05-19 | Image correction method, device and server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113516597B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114677635B (en) * | 2022-05-30 | 2022-09-27 | 成都新希望金融信息有限公司 | Certificate detection method and system based on video stream, electronic equipment and storage medium |
CN115116577B (en) * | 2022-07-26 | 2022-11-29 | 青岛美迪康数字工程有限公司 | Quality control data transmission method and device based on two-dimensional code |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101334837A (en) * | 2008-07-31 | 2008-12-31 | 重庆大学 | A multi-method fusion license plate image location method |
CN104252614A (en) * | 2013-06-27 | 2014-12-31 | 南京理工大学常熟研究院有限公司 | SIFT algorithm-based two-generation identity card face comparison method |
CN109145929A (en) * | 2017-10-09 | 2019-01-04 | 苏州高科中维软件科技有限公司 | One kind being based on SIFT scale space characteristics information extraction method |
CN110431563A (en) * | 2017-04-06 | 2019-11-08 | 华为技术有限公司 | The method and apparatus of image rectification |
CN111860489A (en) * | 2019-12-09 | 2020-10-30 | 北京嘀嘀无限科技发展有限公司 | Certificate image correction method, device, equipment and storage medium |
CN112507914A (en) * | 2020-12-15 | 2021-03-16 | 江苏国光信息产业股份有限公司 | OCR (optical character recognition) method and recognition system based on bankbook and bill characters |
WO2021072876A1 (en) * | 2019-10-15 | 2021-04-22 | 平安科技(深圳)有限公司 | Identification image classification method and apparatus, computer device, and readable storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11587327B2 (en) * | 2015-10-01 | 2023-02-21 | Intellivision Technologies Corp | Methods and systems for accurately recognizing vehicle license plates |
-
2021
- 2021-05-19 CN CN202110545221.7A patent/CN113516597B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101334837A (en) * | 2008-07-31 | 2008-12-31 | 重庆大学 | A multi-method fusion license plate image location method |
CN104252614A (en) * | 2013-06-27 | 2014-12-31 | 南京理工大学常熟研究院有限公司 | SIFT algorithm-based two-generation identity card face comparison method |
CN110431563A (en) * | 2017-04-06 | 2019-11-08 | 华为技术有限公司 | The method and apparatus of image rectification |
CN109145929A (en) * | 2017-10-09 | 2019-01-04 | 苏州高科中维软件科技有限公司 | One kind being based on SIFT scale space characteristics information extraction method |
WO2021072876A1 (en) * | 2019-10-15 | 2021-04-22 | 平安科技(深圳)有限公司 | Identification image classification method and apparatus, computer device, and readable storage medium |
CN111860489A (en) * | 2019-12-09 | 2020-10-30 | 北京嘀嘀无限科技发展有限公司 | Certificate image correction method, device, equipment and storage medium |
CN112507914A (en) * | 2020-12-15 | 2021-03-16 | 江苏国光信息产业股份有限公司 | OCR (optical character recognition) method and recognition system based on bankbook and bill characters |
Also Published As
Publication number | Publication date |
---|---|
CN113516597A (en) | 2021-10-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020098250A1 (en) | Character recognition method, server, and computer readable storage medium | |
CN108291876B (en) | System and method for detecting authenticity of product | |
EP3680808A1 (en) | Augmented reality scene processing method and apparatus, and computer storage medium | |
Boulkenafet et al. | Scale space texture analysis for face anti-spoofing | |
CN105009170A (en) | Object identification device, method, and storage medium | |
US11574492B2 (en) | Efficient location and identification of documents in images | |
CN113516597B (en) | Image correction method, device and server | |
CN104992400B (en) | Multi-spectrum image registration method and device | |
CN111047496A (en) | Threshold determination method, watermark detection device and electronic equipment | |
CN118279398B (en) | Infrared image target positioning method, device, equipment, medium and program product | |
CN110008943B (en) | Image processing method and device, computing equipment and storage medium | |
CN111222452A (en) | Face matching method and device, electronic equipment and readable storage medium | |
CN113191189A (en) | Face living body detection method, terminal device and computer readable storage medium | |
CN110660091A (en) | Image registration processing method and device and photographing correction operation system | |
CN111062927A (en) | Method, system and equipment for detecting image quality of unmanned aerial vehicle | |
CN113393506B (en) | Image registration method and related device and equipment | |
JP5004082B2 (en) | Document image search method, document image registration method, program and apparatus thereof | |
CN114120309A (en) | Instrument reading identification method and device and computer equipment | |
JP6778314B1 (en) | Image processing system, image processing method, and image processing program | |
CN111127529B (en) | Image registration method and device, storage medium and electronic device | |
CN113516598A (en) | Image correction method and device and server | |
US12125218B2 (en) | Object tracking apparatus and method | |
WO2017179728A1 (en) | Image recognition device, image recognition method, and image recognition program | |
KR20230040848A (en) | Method and apparatus for detecting identity card | |
CN111597980B (en) | Target object clustering method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |