CN109712092B - File scanning image restoration method and device and electronic equipment - Google Patents

File scanning image restoration method and device and electronic equipment Download PDF

Info

Publication number
CN109712092B
CN109712092B CN201811559084.7A CN201811559084A CN109712092B CN 109712092 B CN109712092 B CN 109712092B CN 201811559084 A CN201811559084 A CN 201811559084A CN 109712092 B CN109712092 B CN 109712092B
Authority
CN
China
Prior art keywords
image
images
machine learning
learning model
generated
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
CN201811559084.7A
Other languages
Chinese (zh)
Other versions
CN109712092A (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 Xinlian Information Development Co Ltd
Original Assignee
Shanghai Xinlian Information Development 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 Xinlian Information Development Co Ltd filed Critical Shanghai Xinlian Information Development Co Ltd
Priority to CN201811559084.7A priority Critical patent/CN109712092B/en
Publication of CN109712092A publication Critical patent/CN109712092A/en
Application granted granted Critical
Publication of CN109712092B publication Critical patent/CN109712092B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a method and a device for restoring a scanned file image and electronic equipment, wherein the method comprises the following steps: acquiring a file scanning image; judging whether the file scanning image is a fuzzy image or not based on the gray value of the file scanning image; and if so, repairing the file scanning image according to the gray value of the file scanning image based on the trained machine learning model to obtain a clear file image. The technical problem of low restoration precision of the file scanning image in the prior art is solved, and the technical effect of improving the restoration precision of the gray level of the file scanning image is achieved.

Description

File scanning image restoration method and device and electronic equipment
Technical Field
The invention relates to the field of image processing, in particular to a method and a device for restoring a scanned file image and electronic equipment.
Background
During the digital processing of the files, the scanned images of the files are often ghosted, partially damaged, out of focus and blurred due to human factors, scanning input equipment or the original files.
In the prior art, a method for repairing a blurred image is mainly based on filtering the image, and repairing the blurred image by constructing a kernel of the blurred image, or repairing the blurred image based on a supervised learning method of a countermeasure network. The existing blurred image restoration method can not simultaneously maintain the high-precision restoration effect on blurred images under the conditions of inconsistent line width, blurred images, few image texture features and the like in the images of the file scanned images, so that the existing blurred image restoration method has low restoration precision on the file scanned images.
Disclosure of Invention
The invention aims to provide a method and a device for restoring a file scanning image and electronic equipment, which aim to improve the restoring precision of blurred image restoration.
In a first aspect, an embodiment of the present invention provides an archive scanning image restoration method, including: acquiring a file scanning image; judging whether the archive scanning image is a fuzzy image or not based on the gray value of the archive scanning image; and if so, repairing the file scanning image according to the gray value of the file scanning image based on the trained machine learning model to obtain a clear file image.
Optionally, before the determining whether the archival scan image is a blurred image based on the gray scale of the archival scan image, the method further comprises:
and preprocessing the archive scanning image.
Optionally, the preprocessing the archive scan image specifically includes: and converting the archival scan image into a grayscale image.
Optionally, the determining whether the archival scan image is a blurred image based on the gray scale of the archival scan image includes:
extracting the characteristics of the archive scanning image based on the gray level image to obtain a characteristic image;
and judging whether the archival scan image is a blurred image or not based on the characteristic image.
Optionally, the determining whether the archival scan image is a blurred image based on the feature image includes:
obtaining the gray value of each pixel point of the characteristic image;
obtaining the variance of the gray value of the file scanning image based on the gray value of each pixel point;
and if the variance of the gray values is less than or equal to a set threshold value, judging that the file scanning image is a fuzzy image.
Optionally, the method for training a machine learning model for repairing an image includes:
inputting a plurality of original blurred images and a plurality of original sharp images into a machine learning model, wherein the machine learning model respectively outputs a plurality of first generated sharp images and a plurality of first generated blurred images aiming at the plurality of original blurred images and the plurality of original sharp images;
inputting the plurality of first generated sharp images and the plurality of first generated blurred images into the machine learning model, wherein the machine learning model respectively outputs a plurality of second generated blurred images and a plurality of second generated sharp images aiming at the plurality of first generated sharp images and the plurality of first generated blurred images;
obtaining a first loss value based on the plurality of first generated sharp images and the plurality of original sharp images;
obtaining a second loss value based on the plurality of first generated blurred images and the plurality of original blurred images;
obtaining a third loss value based on the plurality of second generated sharp images, the plurality of original sharp images, the plurality of second generated blurred images and the plurality of original blurred images;
and if the first loss value, the second loss value and the third loss value meet set conditions, stopping training the machine learning model to obtain a trained machine learning model, wherein the trained machine learning model is used for restoring the blurred image into a clear image.
Optionally, the training method of the trained machine learning model further includes:
if the first loss value, the second loss value and the third loss value do not meet the set conditions, adjusting the training weight of the machine learning model so that the weights of the first encoder and the second encoder of the machine learning model are the same, and the weights of the first generator and the second generator of the machine learning model are the same, and training the machine learning model after the training weight is adjusted.
In a second aspect, an embodiment of the present invention provides an archive scanning image restoration apparatus, including:
the acquisition module is used for acquiring a file scanning image;
the processing module is used for judging whether the file scanning image is a fuzzy image or not based on the gray value of the file scanning image; and if so, repairing the file scanning image according to the gray value of the file scanning image based on the trained machine learning model to obtain a clear file image.
In a third aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps of any one of the methods described above.
In a fourth aspect, an embodiment of the present invention provides an electronic device, which is characterized by comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the processor implements the steps of any one of the methods described above.
Compared with the prior art, the invention has the following beneficial effects:
the embodiment of the invention provides a method and a device for restoring an archive scanning image and electronic equipment, wherein the method comprises the following steps: acquiring a file scanning image; judging whether the file scanning image is a fuzzy image or not based on the gray value of the file scanning image; and if so, repairing the file scanning image according to the gray value of the file scanning image based on the trained machine learning model to obtain a clear file image. Judging whether the archive scanned image is a blurred image or not based on the gray scale of the archive scanned image, wherein the judgment on whether the archive scanned image possibly has the characteristics of line width inconsistency, image blurring and image texture is the blurred image or not is accurate; the gray scale of the image can represent the characteristics of the image, and the file scanning image is repaired according to the gray scale value of the file scanning image, so that the repairing effect of the gray scale of the file scanning image can be improved; the machine learning model repairs the archive scanned image based on the gray scale of the archive scanned image, and the repair precision of the gray scale of the archive scanned image is improved. The technical problem of low restoration precision of the file scanning image in the prior art is solved, and the technical effect of improving the restoration precision of the gray level of the file scanning image is achieved.
Additional features and advantages of embodiments of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 shows a flowchart of an archive scanning image restoration method according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating another archive scan image restoration method according to an embodiment of the present invention.
Fig. 3 is a block diagram of an archive scanning image restoration device 200 according to an embodiment of the present invention.
Fig. 4 is a schematic block diagram illustrating an electronic device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiment of the invention provides a method and a device for restoring a file scanning image and electronic equipment, and aims to solve the technical problem of low restoration precision of the file scanning image in the prior art.
Examples
An archive scanning image restoration method provided by an embodiment of the present invention includes steps S100 to S400 shown in fig. 1, and S100 to S400 are described below with reference to fig. 1.
S100: an archival scan image is obtained.
S200: and judging whether the file scanning image is a fuzzy image or not based on the gray value of the file scanning image.
S300: and if the file scanning image is a fuzzy image, repairing the file scanning image according to the gray value of the file scanning image based on the trained machine learning model to obtain a clear file image.
In the embodiment of the invention, the archive scanning image refers to an image obtained by scanning a paper archive. In the process of scanning the archive to obtain the archive scanning image, the archive scanning image is blurred due to conditions of ghost images, partial damage of contents, defocus blur and the like of the archive scanning image caused by reasons of inclination of paper placement during manual operation, low scanning precision of scanning input equipment, degradation of an archive original and the like, and the quality of the archive scanning image is reduced. However, it is expensive and difficult to implement the method for improving the quality of the scanned image of the archive by improving the precision of human operation, improving the scanning precision of the scan input device, or preventing the original document itself from being degraded. Therefore, the fuzzy file scanning image can be repaired by adopting the image repairing method based on the electronic equipment, and a clear file image is obtained. In the prior art, a blurred image is repaired mainly through a depth learning method based on supervision, the method mainly depends on the fact that the blurred image has obvious characteristics with a single type, for example, pixel points to pixel points (pix2pix) based on the depth learning method are repairing algorithms under a supervision learning scene, the algorithms depend on a large number of contents to be paired one by one, however, for a plurality of archive scan images, the characteristics of all archive scan images are not clear, and therefore the image repairing mode from the pixel points to the pixel points (pix2pix) in the depth learning method cannot repair the archive scan images with unclear characteristics with low precision.
In the embodiment of the invention, before the file scanning image is repaired, whether the file scanning image is a fuzzy image is judged. Specifically, it is determined whether the archival scan image is a blurred image through S200.
As an alternative, in real time, the archival scan image is pre-processed before performing S200. Specifically, the preprocessing may specifically be converting the archival scan image into a grayscale image, filtering the archival scan image, and the like.
As an alternative embodiment, S200 comprises S200-1 and S200-2 shown in FIG. 2, and S200-1, the characteristic image is obtained by extracting the characteristic of the archival scan image based on the gray scale image. S200-2: and judging whether the archive scanning image is a fuzzy image or not based on the characteristic image.
Wherein, for S200-1, specifically: the method includes the steps that characteristics of an archive scanning image are obtained in a gray level image through a Laplacian operator (Laplacian), and specifically, the characteristic image of the archive scanning image is obtained through filtering processing of the gray level image through the Laplacian operator. Thus, the features obtained based on the grayscale image further include grayscale features of the archival scan image. The gray level image is filtered through the Laplace operator, the detection speed is high, the accuracy is high, the controllability is good, and the accuracy of the characteristic image of the file scanning image is improved. It should be noted that the feature extraction of the archival scan image in S200-1 is not limited to the feature of the archival scan image obtained from the gray scale image by Laplacian (Laplacian), but may also be obtained by Roberts (Roberts) or Canny.
As an optional implementation, S200-2 is specifically: and obtaining the gray value of each pixel point of the characteristic image, obtaining the variance of the gray value of the file scanning image based on the gray value of each pixel point, and judging the file scanning image to be a fuzzy image if the variance of the gray value is less than or equal to a set threshold. The variance for obtaining the gray level of the archive scanning image based on the gray level value of each pixel point is specifically as follows: computing featuresAnd the variance of the gray value of the pixel points in the image is used as the variance of the gray value of the file scanning image. For example, the feature image includes a plurality of pixels, for example, a threshold is set to be 1000, the feature image of the scanned file image includes 4 pixels, the gray levels of the 4 pixels are 150, 130, 0 and 255 respectively, and the mean k ═ [ (150+130+0+255)/4 ═ 4]K-134, wherein [ (150+130+0+ 255)/4%]The variance of the gray value of the pixel point in the characteristic image is expressed by rounding up (150+130+0+255)/4
Figure BDA0001911750930000071
And if S is more than 1000, judging the file scanning image as a clear image. And if the variance S of the gray values of the pixel points in the characteristic image of the file scanning image is 100 and 100 is less than 1000, determining the file scanning image as a blurred image. And if the variance S of the gray values of the pixel points in the characteristic image of the file scanning image is 1000, and 1000 is equal to 1000, determining the file scanning image as a blurred image.
By adopting the scheme, the method does not depend on the characteristics of lines, color pixel values, image textures and the like in the file scanning image, judges whether the file scanning image is a fuzzy image or not based on the gray value of the pixel points of the image, and has high reliability and strong applicability.
If the scanned file image is a blurred image, the scanned file image needs to be restored to obtain a clear file image. In the embodiment of the present invention, the blurred archival scan image is restored through S300.
And S300, inputting the fuzzy file scanning image and the gray value of the file scanning image into the trained machine learning model, repairing the file scanning image by the machine learning model, and outputting a clear file image. In embodiments of the present invention, the machine learning model needs to be trained before the blurred archival scan image is input into the trained machine learning model.
As an optional implementation, the method for training the machine learning model for repairing the image specifically includes: inputting a plurality of original blurred images and a plurality of original clear images into a machine learning model, wherein the machine learning model respectively outputs a plurality of first generated clear images and a plurality of first generated blurred images aiming at the plurality of original blurred images and the plurality of original clear images; inputting a plurality of first generated sharp images and a plurality of first generated blurred images into the machine learning model, wherein the machine learning model respectively outputs a plurality of second generated blurred images and a plurality of second generated sharp images aiming at the plurality of first generated sharp images and the plurality of first generated blurred images; obtaining a first loss value based on the plurality of first generated clear images and the plurality of original clear images; obtaining a second loss value based on the plurality of first generated blurred images and the plurality of original blurred images; obtaining a third loss value based on the plurality of second generated sharp images, the plurality of original sharp images, the plurality of second generated blurred images and the plurality of original blurred images; and if the first loss value, the second loss value and the third loss value meet the set conditions, stopping training the machine learning model to obtain a trained machine learning model, wherein the trained machine learning model is used for restoring the blurred image into a clear image.
As an alternative, the machine learning model is a cyclic generation adaptive Network (cyclic gan) model.
As an alternative embodiment, the first loss value is calculated in a specific manner as shown in formula (1):
LGY(GY,DY,X,Y)=Ey~Y[logDY(y)+Ex~X[log(1-DY(GY(x)))] (1)
wherein L isGY(GY,DYX, Y) denotes a first loss value, DY(y) the result of discrimination of a certain original clear image y by a discriminator D in the circularly generated countermeasure network model, Ey~Y[logDY(Y) the discrimination result D for each original clear image Y in the clear image set YYMean of the logarithms of (y). GY(x) A generator G in a model representing a cyclic generation countermeasure network converts a certain original blurred image x into a first generated sharp image, D, corresponding to the original blurred image xY(GY(x) Watch (C)The discriminator D generates a clear image G for the first imageY(x) The result of the discrimination (1).
As an alternative embodiment, the second loss value is calculated in a specific manner as shown in formula (2):
LGX(GY,DY,X,Y)=Ex~X[logDX(x)+Ey~Y[log(1-DX(GX(y)))] (2)
wherein L isGX(GY,DYX, Y) represents a second loss value, DX(x) Shows the result of discrimination of a certain original blurred image x by a discriminator D, GX(y) first blurred image converted from a generator to a clear original image y, DX(GX(y)) represents the discriminator D for the first blurred image GX(y) the result of the discrimination.
As an alternative embodiment, the third loss value is calculated in a specific manner as shown in formula (3):
Lcyc(GY,GX,X,Y)=Ey~Y[||(GY(GX(y)))-y||1]+Ex~X[||(GX(GY(x)))-x||1 (3)
wherein L iscyc(GY,GXX, Y) represents a third loss value, GY(GX(y)) represents a second sharp image obtained by converting a certain first blurred image. GX(GY(x) Is) represents a second blurred image into which a certain first sharp image is converted. By obtaining a second sharp image GY(GX(y)) modulo | of the difference between the original sharp image y (G)Y(GX(y)))-y||1Obtaining the mean value E of the clear image set based on the corresponding mode of each clear image in the clear image set Y obtained by the modey~Y[||(GY(GX(y)))-y||1]Likewise, GY(x) Based on converting a certain original blurred image x into a first sharp image, (G)X(GY(x) ) is to first clear image GY(x) The converted second blurred image.
By adopting the scheme, the third loss value used for judging the conversion precision of the circularly generated confrontation network model to the original blurred image and the original sharp image is obtained based on the difference between the second blurred image and the original blurred image and the difference between the second sharp image and the original sharp image, and the third loss value can completely describe the performance of the circularly generated confrontation network model.
As an optional implementation manner, if the first loss value, the second loss value, and the third loss value satisfy the setting condition, the training of the machine learning model is stopped, and the trained machine learning model is obtained, specifically: when the first loss value, the second loss value and the third loss value converge to be stable, the machine learning model is represented to be trained to be stable, namely the machine learning model converts the original blurred image into the first clear image and converts the original clear image into the first blurred image, the precision meets the requirement, therefore, the machine learning model is stopped being trained, and the machine learning model after being trained can restore the blurred image into the clear image.
As an alternative embodiment, if the first loss value, the second loss value, and the third loss value do not satisfy the setting condition, the training weights of the machine learning model are adjusted so that the weights of the first encoder and the second encoder of the machine learning model are the same, and the weights of the first generator and the second generator of the machine learning model are the same, and the machine learning model after the training weights are adjusted is trained until the first loss value, the second loss value, and the third loss value satisfy the setting condition.
The embodiment of the invention provides a method for restoring an archive scanning image, which comprises the following steps: acquiring a file scanning image; judging whether the file scanning image is a fuzzy image or not based on the gray value of the file scanning image; and if so, repairing the file scanning image according to the gray value of the file scanning image based on the trained machine learning model to obtain a clear file image. Judging whether the archive scanned image is a blurred image or not based on the gray scale of the archive scanned image, wherein the judgment on whether the archive scanned image possibly has the characteristics of line width inconsistency, image blurring and image texture is the blurred image or not is accurate; the gray scale of the image can represent the characteristics of the image, and the file scanning image is repaired according to the gray scale of the file scanning image, so that the repairing effect of the gray scale of the file scanning image can be improved; the machine learning model repairs the archive scanned image based on the gray scale of the archive scanned image, and the repair precision of the gray scale of the archive scanned image is improved. The technical problem of low restoration precision of the file scanning image in the prior art is solved, and the technical effect of improving the restoration precision of the gray level of the file scanning image is achieved.
The embodiment of the present application further provides an executing body for executing the above steps, and the executing body may be the file scanning image repairing apparatus 200 in fig. 3. Referring to fig. 3, the apparatus includes:
an obtaining module 210, configured to obtain an archive scan image;
a processing module 220, configured to determine whether the archive scan image is a blurred image based on the gray-level value of the archive scan image; and if so, repairing the file scanning image according to the gray value of the file scanning image based on the trained machine learning model to obtain a clear file image.
As an optional implementation, the processing module 220 is further configured to: and preprocessing the archive scanning image.
As an optional implementation manner, the processing module 220 is further specifically configured to: and converting the archival scan image into a grayscale image.
As an optional implementation manner, the processing module 220 is further specifically configured to: extracting the characteristics of the archive scanning image based on the gray level image to obtain a characteristic image; and judging whether the archival scan image is a blurred image or not based on the characteristic image.
As an optional implementation manner, the processing module 220 is further specifically configured to: obtaining the gray value of each pixel point of the characteristic image; obtaining the variance of the gray value of the file scanning image based on the gray value of each pixel point; and if the variance of the gray values is less than or equal to a set threshold value, judging that the file scanning image is a fuzzy image.
As an optional implementation manner, the processing module 220 is further specifically configured to: training a machine learning model for repairing an image, specifically: inputting a plurality of original blurred images and a plurality of original sharp images into a machine learning model, wherein the machine learning model respectively outputs a plurality of first generated sharp images and a plurality of first generated blurred images aiming at the plurality of original blurred images and the plurality of original sharp images; inputting the plurality of first generated sharp images and the plurality of first generated blurred images into the machine learning model, wherein the machine learning model respectively outputs a plurality of second generated blurred images and a plurality of second generated sharp images aiming at the plurality of first generated sharp images and the plurality of first generated blurred images; obtaining a first loss value based on the plurality of first generated sharp images and the plurality of original sharp images; obtaining a second loss value based on the plurality of first generated blurred images and the plurality of original blurred images; obtaining a third loss value based on the plurality of second generated sharp images, the plurality of original sharp images, the plurality of second generated blurred images and the plurality of original blurred images; and if the first loss value, the second loss value and the third loss value meet set conditions, stopping training the machine learning model to obtain a trained machine learning model, wherein the trained machine learning model is used for restoring the blurred image into a clear image.
As an optional implementation manner, the processing module 220 is further specifically configured to: if the first loss value, the second loss value and the third loss value do not meet the set conditions, adjusting the training weight of the machine learning model so that the weights of the first encoder and the second encoder of the machine learning model are the same, and the weights of the first generator and the second generator of the machine learning model are the same, and training the machine learning model after the training weight is adjusted.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
An embodiment of the present invention further provides an electronic device, as shown in fig. 4, including a memory 504, a processor 502, and a computer program stored on the memory 504 and executable on the processor 502, where the processor 502 implements the steps of any one of the above-described archive scan image restoration methods when executing the program.
Where in fig. 4 a bus architecture (represented by bus 500) is shown, bus 500 may include any number of interconnected buses and bridges, and bus 500 links together various circuits including one or more processors, represented by processor 502, and memory, represented by memory 504. The bus 500 may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface 505 provides an interface between the bus 500 and the receiver 501 and transmitter 503. The receiver 501 and the transmitter 503 may be the same element, i.e. a transceiver, providing a means for communicating with various other apparatus over a transmission medium. The processor 502 is responsible for managing the bus 500 and general processing, and the memory 504 may be used for storing data used by the processor 502 in performing operations.
Embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of any one of the above-mentioned archive scan image restoration methods.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in an apparatus according to an embodiment of the invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (9)

1. An archive scanning image restoration method is characterized by comprising the following steps:
inputting a plurality of original blurred images and a plurality of original sharp images into a machine learning model, wherein the machine learning model respectively outputs a plurality of first generated sharp images and a plurality of first generated blurred images aiming at the plurality of original blurred images and the plurality of original sharp images;
inputting the plurality of first generated sharp images and the plurality of first generated blurred images into the machine learning model, wherein the machine learning model respectively outputs a plurality of second generated blurred images and a plurality of second generated sharp images aiming at the plurality of first generated sharp images and the plurality of first generated blurred images;
obtaining a first loss value based on the plurality of first generated sharp images and the plurality of original sharp images;
obtaining a second loss value based on the plurality of first generated blurred images and the plurality of original blurred images;
obtaining a third loss value based on the plurality of second generated sharp images, the plurality of original sharp images, the plurality of second generated blurred images and the plurality of original blurred images;
if the first loss value, the second loss value and the third loss value meet set conditions, stopping training the machine learning model to obtain a trained machine learning model, wherein the trained machine learning model is used for restoring the blurred image into a clear image;
acquiring a file scanning image;
judging whether the archive scanning image is a fuzzy image or not based on the gray value of the archive scanning image;
and if so, repairing the file scanning image according to the gray value of the file scanning image based on the trained machine learning model to obtain a clear file image.
2. The method of claim 1, wherein prior to said determining whether the archival scan image is a blurred image based on grayscale values of the archival scan image, the method further comprises:
and preprocessing the archive scanning image.
3. The method of claim 2, wherein the preprocessing the archival scan image is specifically: and converting the archival scan image into a grayscale image.
4. The method of claim 3, wherein determining whether the archival scan image is a blurred image based on a grayscale of the archival scan image comprises:
extracting the characteristics of the archive scanning image based on the gray level image to obtain a characteristic image;
and judging whether the archival scan image is a blurred image or not based on the characteristic image.
5. The method of claim 4, wherein said determining whether the archival scan image is a blurred image based on the feature image comprises:
obtaining the gray value of each pixel point of the characteristic image;
obtaining the variance of the gray value of the file scanning image based on the gray value of each pixel point;
and if the variance of the gray values is less than or equal to a set threshold value, judging that the file scanning image is a fuzzy image.
6. The method of claim 1, wherein the training method of the trained machine learning model further comprises:
if the first loss value, the second loss value and the third loss value do not meet the set conditions, adjusting the training weight of the machine learning model so that the weights of the first encoder and the second encoder of the machine learning model are the same, and the weights of the first generator and the second generator of the machine learning model are the same, and training the machine learning model after the training weight is adjusted.
7. An archive scanning image restoration device, comprising:
the processing module is used for inputting a plurality of original blurred images and a plurality of original sharp images into a machine learning model, and the machine learning model respectively outputs a plurality of first generated sharp images and a plurality of first generated blurred images aiming at the plurality of original blurred images and the plurality of original sharp images;
inputting the plurality of first generated sharp images and the plurality of first generated blurred images into the machine learning model, wherein the machine learning model respectively outputs a plurality of second generated blurred images and a plurality of second generated sharp images aiming at the plurality of first generated sharp images and the plurality of first generated blurred images;
obtaining a first loss value based on the plurality of first generated sharp images and the plurality of original sharp images;
obtaining a second loss value based on the plurality of first generated blurred images and the plurality of original blurred images;
obtaining a third loss value based on the plurality of second generated sharp images, the plurality of original sharp images, the plurality of second generated blurred images and the plurality of original blurred images;
if the first loss value, the second loss value and the third loss value meet set conditions, stopping training the machine learning model to obtain a trained machine learning model, wherein the trained machine learning model is used for restoring the blurred image into a clear image;
the acquisition module is used for acquiring a file scanning image;
the processing module is used for judging whether the archive scanning image is a fuzzy image or not based on the gray value of the archive scanning image; and if so, repairing the file scanning image according to the gray value of the file scanning image based on the trained machine learning model to obtain a clear file image.
8. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of any one of claims 1 to 6 when executing the program.
CN201811559084.7A 2018-12-18 2018-12-18 File scanning image restoration method and device and electronic equipment Active CN109712092B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811559084.7A CN109712092B (en) 2018-12-18 2018-12-18 File scanning image restoration method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811559084.7A CN109712092B (en) 2018-12-18 2018-12-18 File scanning image restoration method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN109712092A CN109712092A (en) 2019-05-03
CN109712092B true CN109712092B (en) 2021-01-05

Family

ID=66255979

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811559084.7A Active CN109712092B (en) 2018-12-18 2018-12-18 File scanning image restoration method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109712092B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110570375B (en) * 2019-09-06 2022-12-09 腾讯科技(深圳)有限公司 Image processing method, device, electronic device and storage medium
CN112416864A (en) * 2020-11-18 2021-02-26 广东电网有限责任公司佛山供电局 Automatic quality inspection method for digital files
CN113222843B (en) * 2021-05-10 2023-11-10 北京有竹居网络技术有限公司 Image restoration method and related equipment thereof
CN113792169B (en) * 2021-09-16 2022-05-10 烟台市蓬莱区档案馆 Digital archive management method and system based on big data application

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013009651A1 (en) * 2011-07-12 2013-01-17 Dolby Laboratories Licensing Corporation Method of adapting a source image content to a target display
CN106952239A (en) * 2017-03-28 2017-07-14 厦门幻世网络科技有限公司 image generating method and device
CN107103590A (en) * 2017-03-22 2017-08-29 华南理工大学 A kind of image for resisting generation network based on depth convolution reflects minimizing technology
CN107133934A (en) * 2017-05-18 2017-09-05 北京小米移动软件有限公司 Image completion method and device
KR20180062819A (en) * 2016-12-01 2018-06-11 한화에어로스페이스 주식회사 Apparatus and method for processing image

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101609452B (en) * 2009-07-10 2011-05-11 南方医科大学 Fuzzy SVM feedback measuring method used for target recognition of medical images
TWI417813B (en) * 2010-12-16 2013-12-01 Ind Tech Res Inst Cascadable camera tampering detection transceiver module
US9002138B2 (en) * 2011-12-19 2015-04-07 Ziva Corporation Computational imaging using variable optical transfer function
CN103632342A (en) * 2013-11-12 2014-03-12 华南理工大学 Fuzzy enhancement method for X-ray image in integrated circuit packaging
CN107945140A (en) * 2017-12-20 2018-04-20 中国科学院深圳先进技术研究院 A kind of image repair method, device and equipment
CN108269245A (en) * 2018-01-26 2018-07-10 深圳市唯特视科技有限公司 A kind of eyes image restorative procedure based on novel generation confrontation network
CN108550118B (en) * 2018-03-22 2022-02-22 深圳大学 Motion blur image blur processing method, device, equipment and storage medium
CN108520504B (en) * 2018-04-16 2020-05-19 湘潭大学 End-to-end blurred image blind restoration method based on generation countermeasure network
CN108711141B (en) * 2018-05-17 2022-02-15 重庆大学 Motion blurred image blind restoration method using improved generation type countermeasure network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013009651A1 (en) * 2011-07-12 2013-01-17 Dolby Laboratories Licensing Corporation Method of adapting a source image content to a target display
KR20180062819A (en) * 2016-12-01 2018-06-11 한화에어로스페이스 주식회사 Apparatus and method for processing image
CN107103590A (en) * 2017-03-22 2017-08-29 华南理工大学 A kind of image for resisting generation network based on depth convolution reflects minimizing technology
CN106952239A (en) * 2017-03-28 2017-07-14 厦门幻世网络科技有限公司 image generating method and device
CN107133934A (en) * 2017-05-18 2017-09-05 北京小米移动软件有限公司 Image completion method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Learning to deblur;Schuler C J等;《IEEE Transactions on Pattern Analysis and Machine Intelligence》;20151231;第38卷(第7期);第1439-1451页 *
双框架卷积神经网络用于运动模糊图像盲复原;吴梦婷等;《计算机辅助设计与图形学学报》;20181215;第30卷(第12期);第2327-2334页 *

Also Published As

Publication number Publication date
CN109712092A (en) 2019-05-03

Similar Documents

Publication Publication Date Title
CN109712092B (en) File scanning image restoration method and device and electronic equipment
CN110570358A (en) vehicle loss image enhancement method and device based on GAN network
CN108805829B (en) Image data processing method, device, equipment and computer readable storage medium
EP2288135A2 (en) Deblurring and Supervised Adaptive Thresholding for Print-and-Scan Document Image Evaluation
US20210319537A1 (en) Image processing method, image processing apparatus, image processing system, and memory medium
US8059899B2 (en) Image processing apparatus, image processing method, and computer product
CN101114340A (en) VLSI realizing system and method of histogram equalization image processing
CN111310746B (en) Text line detection method, model training method, device, server and medium
CN109829510A (en) A kind of method, apparatus and equipment of product quality classification
CN112419420B (en) Camera calibration method and device, electronic equipment and storage medium
CN113362238A (en) Test image processing method and device, electronic equipment and storage medium
CN116823677B (en) Image enhancement method and device, storage medium and electronic equipment
CN112116567A (en) No-reference image quality evaluation method and device and storage medium
CN112686851B (en) Image detection method, device and storage medium
JP2021086284A (en) Image processing device, image processing method, and program
CN116228553A (en) Image enhancement method capable of simultaneously enhancing definition of high-illumination and low-illumination areas
CN111968140B (en) Contour detection method based on classical receptive field vision-strengthening micro-motion mechanism
CN109741363B (en) Motion judgment method and device based on block difference value and electronic equipment
CN114531911A (en) Machine learning model, generation device, and computer program
CN111013152A (en) Game model action generation method and device and electronic terminal
CN110335286B (en) Method for obtaining gray threshold, computer device and computer readable medium
CN117710365B (en) Processing method and device for defective pipeline image and electronic equipment
KR102577361B1 (en) Method and apparatus for image dehazing via complementary adversarial learning
CN109166085B (en) Image restoration method and device
CN115880300B (en) Image blurring detection method, device, electronic 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
CB02 Change of applicant information

Address after: 200040, room 710, 302 Changping Road, Shanghai, Jingan District

Applicant after: Shanghai Xinlian Information Development Co., Ltd

Address before: 200040, room 710, 302 Changping Road, Shanghai, Jingan District

Applicant before: SHANGHAI ZHONGXIN INFORMATION DEVELOPMENT Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant