CN110222694B - Image processing method, image processing device, electronic equipment and computer readable medium - Google Patents

Image processing method, image processing device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN110222694B
CN110222694B CN201910504970.8A CN201910504970A CN110222694B CN 110222694 B CN110222694 B CN 110222694B CN 201910504970 A CN201910504970 A CN 201910504970A CN 110222694 B CN110222694 B CN 110222694B
Authority
CN
China
Prior art keywords
image
gray
images
processing
generate
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
CN201910504970.8A
Other languages
Chinese (zh)
Other versions
CN110222694A (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.)
Taikang Insurance Group Co Ltd
Original Assignee
Taikang Insurance Group 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 Taikang Insurance Group Co Ltd filed Critical Taikang Insurance Group Co Ltd
Priority to CN201910504970.8A priority Critical patent/CN110222694B/en
Publication of CN110222694A publication Critical patent/CN110222694A/en
Application granted granted Critical
Publication of CN110222694B publication Critical patent/CN110222694B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words

Abstract

The disclosure relates to an image processing method, an image processing device, an electronic device and a computer readable medium. The method comprises the following steps: carrying out graying processing on the image to generate a grayscale image; carrying out gray level clustering processing on the gray level images to generate a plurality of binary images; carrying out image superposition processing on the plurality of binary images to generate a target image; and performing character recognition processing based on the target image. The image processing method, the image processing device, the electronic equipment and the computer readable medium can improve the accuracy and the resolution of character recognition when the image is subjected to character recognition.

Description

Image processing method, image processing device, electronic equipment and computer readable medium
Technical Field
The present disclosure relates to the field of computer information processing, and in particular, to an image processing method and apparatus, an electronic device, and a computer-readable medium.
Background
With the coming of the information age, digital images as an important information carrier can meet the increasing modernization business. Optical character recognition, OCR, converts characters in an image into computer-editable text via optical and computer technologies. At present, with the development of computer performance and mobile phone photographing technology, the application scenarios of the OCR technology become more extensive.
For the insurance industry, the entry and the check of insurance documents are work with huge workload, the traditional manual entry and the check often have the characteristics of low efficiency and high error rate, and the OCR technology is utilized to identify the insurance documents, so that the work efficiency can be greatly improved. However, in the prior art process, the main difficulties in identifying the insurance document are: the shooting scene of the insurance document is complex, such as large background noise, uneven illumination, non-uniform shooting angle and the like, and the shooting environment causes that the insurance document image contains a large amount of 'noise' data. At present, no method is available for effectively processing a document image, so that text information in the document image is prominent, and scene noise is suppressed. In the current technology, most of the common image preprocessing technologies are edge detection, filtering and the like, which cannot completely solve the technical problems and have unsatisfactory character recognition effect.
Disclosure of Invention
In view of the above, the present disclosure provides an image processing method, an image processing apparatus, an electronic device, and a computer readable medium, which can improve the accuracy and resolution of character recognition when performing character recognition on an image.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to an aspect of the present disclosure, an image processing method is provided, which includes: carrying out graying processing on the image to generate a grayscale image; carrying out gray level clustering processing on the gray level images to generate a plurality of binary images; carrying out image superposition processing on the plurality of clustering images to generate a target image; and performing character recognition processing based on the target image.
In an exemplary embodiment of the present disclosure, performing a gray clustering process on the gray images, and generating a plurality of binary images includes: determining a gray scale distribution of the gray scale image based on a gray scale value of each pixel in the gray scale image; determining a clustering parameter based on the gray scale distribution; and performing gray level clustering processing on the gray level images based on the clustering parameters to generate the plurality of binary images.
In an exemplary embodiment of the present disclosure, determining the gray scale distribution of the gray scale image based on the gray scale value of each pixel in the gray scale image comprises: determining a kernel function; constructing the gray distribution formula through the kernel function; and determining the gray distribution of the gray image according to the gray value of each pixel and the gray distribution formula.
In an exemplary embodiment of the present disclosure, determining a clustering parameter based on the gray distribution includes: and determining an extreme value in the gray distribution to determine the clustering parameter.
In an exemplary embodiment of the present disclosure, performing a gray-scale clustering process on the gray-scale image based on the clustering parameter to generate the plurality of binary images includes: carrying out gray level clustering processing on the gray level images based on the clustering parameters to generate a plurality of clustering images; and carrying out binarization processing on the plurality of clustered images to generate a plurality of binary images.
In an exemplary embodiment of the present disclosure, the performing image superposition processing on the plurality of cluster images, and generating a target image includes: carrying out image superposition on the plurality of clustering images to generate a superposed image; determining key area images in the superposed images; and carrying out image fusion processing on the key area image and the superposed image to generate the target image.
In an exemplary embodiment of the present disclosure, determining the key area image in the overlay image includes: determining a connected region in the superimposed image; and determining the key area image according to the proportion of the pixel binarization results of the plurality of cluster images in the connected area.
In an exemplary embodiment of the present disclosure, the image fusion processing the key region image and the overlay image to generate the target image includes: determining a first weight value of the key area image; determining a second weight of the superimposed image; and performing image fusion processing on the key area image and the superposed image according to the first weight and the second weight to generate the target image.
According to an aspect of the present disclosure, there is provided an image processing apparatus including: the gray module is used for carrying out gray processing on the image to generate a gray image; the clustering module is used for carrying out gray level clustering processing on the gray level images to generate a plurality of binary images; the superposition module is used for carrying out image superposition processing on the plurality of clustering images to generate a target image; and the recognition module is used for carrying out character recognition processing based on the target image.
According to an aspect of the present disclosure, an electronic device is provided, the electronic device including: one or more processors; storage means for storing one or more programs; when executed by one or more processors, cause the one or more processors to implement a method as above.
According to an aspect of the disclosure, a computer-readable medium is proposed, on which a computer program is stored, which program, when being executed by a processor, carries out the method as above.
According to the image processing method, the image processing device, the electronic equipment and the computer readable medium, the image is preprocessed in a gray level clustering mode, and then the processed image is overlapped, so that a target image to be recognized is generated, and the accuracy rate and the resolution of character recognition can be improved when the image is subjected to character recognition.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings. The drawings described below are merely some embodiments of the present disclosure, and other drawings may be derived from those drawings by those of ordinary skill in the art without inventive effort.
Fig. 1 is a system scenario block diagram illustrating an image processing method and apparatus according to an exemplary embodiment.
FIG. 2 is a flow diagram illustrating an image processing method according to an exemplary embodiment.
Fig. 3 is a flowchart illustrating an image processing method according to another exemplary embodiment.
Fig. 4 is a flowchart illustrating an image processing method according to another exemplary embodiment.
Fig. 5 is a flowchart illustrating an image processing method according to another exemplary embodiment.
Fig. 6 is a block diagram illustrating an image processing apparatus according to an exemplary embodiment.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
FIG. 8 is a schematic diagram illustrating a computer-readable storage medium according to an example embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as 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 concept of example embodiments to those skilled in the art. The same reference numerals denote the same or similar parts in the drawings, and thus, a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the disclosure.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It will be understood that, although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one element from another. Thus, a first component discussed below may be termed a second component without departing from the teachings of the disclosed concept. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
It is to be understood by those skilled in the art that the drawings are merely schematic representations of exemplary embodiments, and that the blocks or processes shown in the drawings are not necessarily required to practice the present disclosure and are, therefore, not intended to limit the scope of the present disclosure.
In the conventional OCR technology, the improvement of the recognition degree of the characters is mainly achieved by binarization or edge detection. The conventional binarization technology is to set a gray threshold T for a gray picture, and then set the pixel points greater than T to be 0 or 255 (depending on whether to highlight low gray or high gray) and set the pixel points less than T to be 255 or 0 (different from the value set by the pixel points greater than T) according to the gray of the picture, so that the whole picture has only two pixels, namely black and white, so that different objects in the picture are highlighted to a certain extent, but the defects are obvious, that is, the pixel points of some noises are amplified by using the same T value globally, and therefore, the method has insufficient capability of describing local details. The other binarization method is to calculate the average value K of the pixels, then set the pixel value of the image with the pixel value larger than K as 255 and the pixel value smaller than or equal to K as 0.
Aiming at the problems of binarization noise and insensitivity to gentle change in edge detection in image preprocessing, the disclosure provides an image processing method, which is used for preprocessing a picture through cluster analysis and semi-automatically performing cluster analysis according to the gray value of the grayed picture so as to obtain the picture with obvious characters and other distinguishing degrees. The image processing method disclosed by the invention can improve the effect of image preprocessing to a great extent.
The details of the present disclosure are described below with reference to specific examples:
fig. 1 is a system scenario block diagram illustrating an image processing method and apparatus according to an exemplary embodiment.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a shopping application, a web browser application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
A user can perform graying processing on the image through the terminal devices 101, 102 and 103 to generate a grayscale image, and the terminal devices 101, 102 and 103 can perform grayscale clustering processing on the grayscale image to generate a plurality of binary images; the terminal devices 101, 102, 103 may, for example, perform image superimposition processing on the plurality of binary images to generate a target image; the terminal devices 101, 102, 103 may, for example, perform a word recognition process based on the target image.
The server 105 may be a server that provides various services, such as a background server that provides support for pictures taken by the user using the terminal devices 101, 102, 103. The server 105 may perform processing such as character recognition on the received picture data, and feed back the processing result to the terminal device.
A user can take a picture through the terminal devices 101, 102 and 103, the terminal devices 101, 102 and 103 can forward the picture to the server 105, and the server 105 can perform graying processing on the image to generate a grayscale image; the server 105 may, for example, perform a gray-scale clustering process on the gray-scale images to generate a plurality of binary images; the server 105 may, for example, perform image superimposition processing on the plurality of binary images to generate a target image; and the server 105 may perform word recognition processing based on the target image, for example.
The server 105 may be a single entity server, or may be composed of a plurality of servers, for example, it should be noted that the image processing method provided by the embodiment of the present disclosure may be executed by the server 105 and/or the terminal devices 101, 102, 103, and accordingly, the image processing apparatus may be disposed in the server 105 and/or the terminal devices 101, 102, 103. And the requesting end for providing the user with the picture input is generally located in the terminal equipment 101, 102, 103.
In one embodiment, the method disclosed by the disclosure can be applied to the insurance field, a customer needs to upload a policy after purchasing a related product, the policy is stored in a background database and needs to manually check, and certain distortion and fuzziness phenomena may exist in the process of acquiring, transmitting and storing image data, so that the characteristics of low efficiency and high error rate of manual checking information exist. The method has the advantages that the image is preprocessed, the resolution ratio of the image can be improved, OCR recognition is carried out after the image is processed by the method, the recognition accuracy can be effectively improved, the manual checking time is reduced, the checking efficiency is improved, the workload of manual checking is reduced, and a large amount of cost is saved.
According to the image processing method and the image processing device, the images are preprocessed in a gray level clustering mode, and then the processed images are overlapped, so that the target image to be recognized is generated, and the accuracy rate and the resolution of character recognition can be improved when the images are subjected to character recognition.
FIG. 2 is a flow diagram illustrating an image processing method according to an exemplary embodiment. The image processing method 20 includes at least steps S202 to S208.
As shown in fig. 2, in S202, the image is subjected to a gradation process to generate a gradation image. Considering the light and shade and the possible noise in the background, the original picture is first preprocessed. The preprocessing may include a graying process.
Compared with the original image in the RGB format, the gray image has no loss of the information of characters, can reduce the data size and improve the calculation efficiency, and the conversion formula of the picture graying can be as follows:
Figure BDA0002091527090000071
the RGB color scheme is a color standard in the industry, and various colors are obtained by changing three color channels of red (R), green (G), and blue (B) and superimposing the three color channels on each other, where RGB represents colors of the three channels of red, green, and blue, and the standard almost includes all colors that can be perceived by human vision, and is one of the most widely used color systems at present. R, G, B, respectively, represent values of the color channels that are not available in the RGB color space.
Where a grayscale image is an image with only one sample color per pixel. Such images are typically displayed in gray scale from darkest black to brightest white, although in theory this sampling could be of different shades of any color and even different colors at different brightnesses. The gray image is different from the black and white image, the black and white image only has two colors of black and white in the computer image field, and the gray image has a plurality of levels of color depth between black and white. A complete image is composed of three channels, red, green and blue. The scaled views of the three red, green and blue channels are all displayed in grayscale. The specific gravity of red, green and blue in the image is represented by different gray scale levels. Pure white in the channel, representing the color light at the highest brightness here, the brightness level is 255.
In S204, the grayscale images are subjected to grayscale clustering processing to generate a plurality of binary images.
In one embodiment, may include: determining a gray scale distribution of the gray scale image based on a gray scale value of each pixel in the gray scale image; determining a clustering parameter based on the gray scale distribution; and performing gray level clustering processing on the gray level images based on the clustering parameters to generate the plurality of binary images. The conventional OCR step is to binarize the gray scale, but has a disadvantage of sharpening a part of noise, and thus its resolution may be low. The method adopts a clustering-based method to carry out kernel density clustering analysis on the gray level image, and adopts different classification strategies for the gray level values in different intervals according to the characteristic that human eyes have too large or too small resolution ratio.
For the details of performing the gray clustering process on the gray images, please refer to the embodiment corresponding to fig. 3 for generating a plurality of binary images.
In S206, the plurality of binary images are subjected to image superimposition processing to generate a target image. The plurality of binary images may be image-superimposed, for example, to generate a superimposed image; determining key area images in the superposed images; and carrying out image fusion processing on the key area image and the superposed image to generate the target image.
The superposition is a mixed mode in image processing, and exists in a superposition mode group of a color mixed mode, a channel mixed mode and a layer mixed mode. The "superposition" mode, which acts between an image pixel and surrounding pixels to cause an increase or decrease in image contrast, is a mode in which the primary colors determine the mixing effect, and the shade of the primary colors determines the mixing mode of the mixed colors. After the 'superposition' mixed mode is used, color level overflow can not be generated generally, image detail loss can not be caused, and when the positions of the primary color and the mixed color are exchanged, the result colors are different.
The image fusion refers to that image data which are collected by a multi-source channel and related to the same target are subjected to image processing, computer technology and the like, beneficial information in respective channels is extracted to the maximum extent, and finally high-quality images are synthesized, so that the utilization rate of image information is improved, the computer interpretation precision and reliability are improved, the spatial resolution and the spectral resolution of original images are improved, and monitoring is facilitated.
For details of the image superposition processing performed on the plurality of cluster images, please refer to an embodiment corresponding to fig. 4.
In S208, a character recognition process is performed based on the target image. The word recognition process may include: optical Character Recognition (OCR) processing, and the like.
Wherein, OCR (Optical Character Recognition) refers to a process in which an electronic device checks characters printed on paper, determines the shape thereof by detecting dark and light patterns, and then translates the shape into computer characters by a Character Recognition method; the method is characterized in that characters in a paper document are converted into an image file with a black-white dot matrix in an optical mode aiming at print characters, and the characters in the image are converted into a text format through recognition software for further editing and processing by word processing software.
According to the image processing method disclosed by the invention, the grey values of the pictures are classified by adopting a clustering idea, and compared with a traditional binarization method, the image processing method has higher resolution in OCR character recognition.
According to the image processing method disclosed by the invention, through partially overlapping the gray values in the image, the integrity of the image of the picture can be kept, meanwhile, partial details are highlighted, and the accuracy of OCR can be improved.
It should be clearly understood that this disclosure describes how to make and use particular examples, but the principles of this disclosure are not limited to any details of these examples. Rather, these principles can be applied to many other embodiments based on the teachings of the present disclosure.
Fig. 3 is a flowchart illustrating an image processing method according to another exemplary embodiment. The flow shown in fig. 3 is a detailed description of S204 "performing gray-scale clustering processing on the gray-scale images to generate a plurality of binary images" in the flow shown in fig. 2.
As shown in fig. 3, in S302, a gray scale distribution of the gray scale image is determined based on a gray scale value of each pixel in the gray scale image. A kernel function may be determined, for example; constructing the gray distribution formula through the kernel function; and determining the gray distribution of the gray image according to the gray value of each pixel and the gray distribution formula.
In S304, a clustering parameter is determined based on the gradation distribution. The clustering parameter may be determined by determining an extremum in the gray scale distribution.
In S306, the grayscale images are subjected to grayscale clustering processing based on the clustering parameters to generate the plurality of binary images. The gray level images are subjected to gray level clustering processing based on the clustering parameters to generate a plurality of clustering images; and carrying out binarization processing on the plurality of clustered images to generate a plurality of binary images.
A probability distribution of the gray values can be obtained based on a kernel density estimation method and a cluster analysis is first performed on the distribution of the gray values of the image.
Wherein, the formula of the kernel density estimation is as follows:
Figure BDA0002091527090000101
where k is the kernel function, n is the number of gray values, here 256, and h is a smoothing parameter greater than 0. Typically, the kernel function is chosen to be a gaussian kernel function.
Figure BDA0002091527090000102
The overall distribution trend of the image gray scale can be seen through the gray scale distribution after the density estimation. And determining the proper classification number by analyzing the overall nuclear density distribution situation, thereby selecting proper gray value points for classification, and then selecting extreme value points for classification according to the trend.
In practical application, the sensitive interval of human beings to the gray scale is the middle area of the gray scale value, so the interval of the gray scale can be controlled to be 4-6 by changing the value of the parameter h. Then, the binarization operation is performed in each interval, and the binarization operation is performed in each interval, that is, the gray value in the interval is set to 1 and other areas are set to 0 for the whole image. And performing the above operation on each interval to obtain a binary image with the same classification number.
Figure BDA0002091527090000103
Wherein g (x) is the result after binarization, x represents the gray value of the original image, piRepresenting the ith gray value interval of the original image after the nuclear density estimation.
By performing the above operations on each interval, 4-6 different binarization results, i.e. 4-6 binarization images, can be obtained.
Fig. 4 is a flowchart illustrating an image processing method according to another exemplary embodiment. The flow shown in fig. 4 is a detailed description of S206 "generating a target image by performing image superimposition processing on the plurality of binary images" in the flow shown in fig. 2.
As shown in fig. 4, in S402, the plurality of binary images are superimposed to generate a superimposed image.
In S404, a key area image in the overlay image is determined. May, for example, determine connected regions in the superimposed image; and determining the key area image according to the proportion of the pixel binarization results of the plurality of cluster images in the connected area.
In S406, image fusion processing is performed on the key region image and the superimposed image to generate the target image.
The specific processing mode may be image fusion processing performed by a weighted fusion mode:
may, for example, determine a first weight of the key region image; determining a second weight of the superimposed image; and performing image fusion processing on the key area image and the superposed image according to the first weight and the second weight to generate the target image.
Through the statistical analysis in the previous period, the characteristics of the text and document boundary are often in a certain specific gray value interval, so that a feasible method is to only keep a binarization result, but part of information may be lost, and therefore the following steps can be adopted:
(1) and directly superposing the images, namely:
Figure BDA0002091527090000111
(2) determining a main contribution image of a connected region of the superposed image, namely dividing the connected region on the whole superposed image, counting the occupation ratio of the binarization results of each superposed image in each connected region, and finally keeping the binarization result with the largest occupation ratio. The purpose of this is not only to retain all features as large as possible, but also to suppress the effect of noise to some extent.
(3) And performing weighted fusion on the main contribution image result and the directly superposed image, so that not only can complete picture information be reserved, but also partial boundary characteristics can be highlighted.
Therefore, compared with the picture processed by the traditional flow, the processed picture has lower noise, and the character characteristics and the edge attributes in the picture are more obvious, so that a good basis is laid for subsequent correction and edge detection.
Fig. 5 is a flowchart illustrating an image processing method according to another exemplary embodiment. The flowchart shown in fig. 5 describes the overall process of image processing by the image processing method of the present disclosure by a specific embodiment.
As shown in fig. 5, in S502, a gradation process is performed.
In S504, a clustering parameter is determined.
In S506, the grayscale cluster analysis.
In S508, an image superimposition process, which may include the steps in S5082 and S5084, S5086.
In S5082, direct superimposition processing is performed.
In S5084, a connected region is detected.
In S5086, the image with the largest contribution is retained.
In S510, the preprocessing ends.
According to the image processing method, the picture is preprocessed through cluster analysis, semi-automatic cluster analysis is performed according to the gray value of the grayed picture, and therefore the picture with obvious characters and other distinguishing degrees is obtained. The image processing method disclosed by the invention can improve the effect of image preprocessing to a great extent.
Those skilled in the art will appreciate that all or part of the steps implementing the above embodiments are implemented as computer programs executed by a CPU. When executed by the CPU, performs the functions defined by the above-described methods provided by the present disclosure. The program may be stored in a computer readable storage medium, which may be a read-only memory, a magnetic or optical disk, or the like.
Furthermore, it should be noted that the above-mentioned figures are only schematic illustrations of the processes involved in the methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
The following are embodiments of the disclosed apparatus that may be used to perform embodiments of the disclosed methods. For details not disclosed in the embodiments of the apparatus of the present disclosure, refer to the embodiments of the method of the present disclosure.
Fig. 6 is a block diagram illustrating an image processing apparatus according to an exemplary embodiment. The image processing apparatus 60 includes: a grayscale module 602, a clustering module 604, an overlap module 606, and an identification module 608.
The grayscale module 602 is configured to perform graying processing on the image to generate a grayscale image; considering the light and shade and the possible noise in the background, the original picture is first preprocessed. The preprocessing may include a graying process.
The clustering module 604 is configured to perform gray level clustering processing on the gray level images to generate a plurality of binary images; can include the following steps: determining a gray scale distribution of the gray scale image based on a gray scale value of each pixel in the gray scale image; determining a clustering parameter based on the gray scale distribution; and performing gray level clustering processing on the gray level images based on the clustering parameters to generate the plurality of binary images.
The superposition module 606 is configured to perform image superposition processing on the plurality of clustered images to generate a target image; the plurality of clustered images can be overlapped, for example, to generate an overlapped image; determining key area images in the superposed images; and carrying out image fusion processing on the key area image and the superposed image to generate the target image.
The recognition module 608 is configured to perform a word recognition process based on the target image. The word recognition process may include: optical Character Recognition (OCR) processing, and the like.
According to the image processing device disclosed by the invention, the grey values of the pictures are classified by adopting a clustering idea, and compared with a traditional binarization method, the image processing device has higher resolution in OCR character recognition.
According to the image processing device disclosed by the disclosure, through partially overlapping the gray values in the image, partial details can be highlighted while the integrity of the image of the picture is kept, and the accuracy of OCR can be improved.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
An electronic device 200 according to this embodiment of the present disclosure is described below with reference to fig. 7. The electronic device 200 shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, the electronic device 200 is embodied in the form of a general purpose computing device. The components of the electronic device 200 may include, but are not limited to: at least one processing unit 210, at least one memory unit 220, a bus 230 connecting different system components (including the memory unit 220 and the processing unit 210), a display unit 240, and the like.
Wherein the storage unit stores program code executable by the processing unit 210 to cause the processing unit 210 to perform the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned electronic prescription flow processing method section of the present specification. For example, the processing unit 210 may perform the steps as shown in fig. 2, 3, 4, 5.
The memory unit 220 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)2201 and/or a cache memory unit 2202, and may further include a read only memory unit (ROM) 2203.
The storage unit 220 may also include a program/utility 2204 having a set (at least one) of program modules 2205, such program modules 2205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 230 may be one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 200 may also communicate with one or more external devices 300 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 200, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 200 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 250. Also, the electronic device 200 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 260. The network adapter 260 may communicate with other modules of the electronic device 200 via the bus 230. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, or a network device, etc.) to execute the above method according to the embodiments of the present disclosure.
Fig. 8 schematically illustrates a computer-readable storage medium in an exemplary embodiment of the disclosure.
Referring to fig. 8, a program product 400 for implementing the above method according to an embodiment of the present disclosure is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The computer readable medium carries one or more programs which, when executed by a device, cause the computer readable medium to perform the functions of: carrying out graying processing on the image to generate a grayscale image; carrying out gray level clustering processing on the gray level images to generate a plurality of binary images; carrying out image superposition processing on the plurality of binary images to generate a target image; and performing character recognition processing based on the target image.
Those skilled in the art will appreciate that the modules described above may be distributed in the apparatus according to the description of the embodiments, or may be modified accordingly in one or more apparatuses unique from the embodiments. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Exemplary embodiments of the present disclosure are specifically illustrated and described above. It is to be understood that the present disclosure is not limited to the precise arrangements, instrumentalities, or instrumentalities described herein; on the contrary, the disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
In addition, the structures, the proportions, the sizes, and the like shown in the drawings of the present specification are only used for matching with the contents disclosed in the specification, so as to be understood and read by those skilled in the art, and are not used for limiting the limit conditions which the present disclosure can implement, so that the present disclosure has no technical essence, and any modification of the structures, the change of the proportion relation, or the adjustment of the sizes, should still fall within the scope which the technical contents disclosed in the present disclosure can cover without affecting the technical effects which the present disclosure can produce and the purposes which can be achieved. In addition, the terms "above", "first", "second" and "a" as used in the present specification are for the sake of clarity only, and are not intended to limit the scope of the present disclosure, and changes or modifications of the relative relationship may be made without substantial changes in the technical content.

Claims (8)

1. An image processing method, comprising:
carrying out graying processing on the image to generate a grayscale image;
carrying out gray level clustering processing on the gray level images to generate a plurality of binary images;
performing image superposition on the plurality of binary images to generate a superposed image;
determining a connected region in the superimposed image; determining key area images corresponding to the connected areas according to the pixel binarization results of the superposed images in each connected area and the binarization result with the largest ratio; and
performing image fusion processing on the key area image and the superposed image to generate a target image; and
and performing character recognition processing based on the target image.
2. The method of claim 1, wherein performing a grayscale clustering process on the grayscale images to generate a plurality of binary images comprises:
determining a gray scale distribution of the gray scale image based on a gray scale value of each pixel in the gray scale image;
determining a clustering parameter based on the gray scale distribution; and
performing gray-scale clustering processing on the gray-scale images based on the clustering parameters to generate the plurality of binary images.
3. The method of claim 2, wherein determining the grayscale distribution of the grayscale image based on the grayscale value of each pixel in the grayscale image comprises:
determining a kernel function;
constructing the gray distribution formula through the kernel function; and
and determining the gray distribution of the gray image according to the gray value of each pixel and the gray distribution formula.
4. The method of claim 2, wherein determining a clustering parameter based on the gray scale distribution comprises:
and determining an extreme value in the gray distribution to determine the clustering parameter.
5. The method of claim 2, wherein performing gray-scale clustering processing on the gray-scale images based on the clustering parameters to generate the plurality of binary images comprises:
carrying out gray level clustering processing on the gray level images based on the clustering parameters to generate a plurality of clustering images; and
and carrying out binarization processing on the plurality of cluster images to generate a plurality of binary images.
6. An image processing apparatus characterized by comprising:
the gray module is used for carrying out gray processing on the image to generate a gray image;
the clustering module is used for carrying out gray level clustering processing on the gray level images to generate a plurality of binary images;
the superposition module is used for carrying out image superposition processing on the plurality of binary images to generate a superposed image; determining a connected region in the superimposed image; determining key area images corresponding to the connected areas according to the pixel binarization results of the superposed images in each connected area and the binarization result with the largest ratio; performing image fusion processing on the key area image and the superposed image to generate a target image; and
and the recognition module is used for carrying out character recognition processing based on the target image.
7. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
8. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201910504970.8A 2019-06-12 2019-06-12 Image processing method, image processing device, electronic equipment and computer readable medium Active CN110222694B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910504970.8A CN110222694B (en) 2019-06-12 2019-06-12 Image processing method, image processing device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910504970.8A CN110222694B (en) 2019-06-12 2019-06-12 Image processing method, image processing device, electronic equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN110222694A CN110222694A (en) 2019-09-10
CN110222694B true CN110222694B (en) 2021-06-18

Family

ID=67816538

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910504970.8A Active CN110222694B (en) 2019-06-12 2019-06-12 Image processing method, image processing device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN110222694B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112784825B (en) * 2019-11-01 2024-04-30 株式会社理光 Method for identifying characters in picture, method, device and equipment for retrieving keywords
CN111191651A (en) * 2019-12-06 2020-05-22 中国平安财产保险股份有限公司 Document image identification method and device, computer equipment and storage medium
CN113393477A (en) * 2020-03-13 2021-09-14 上海哔哩哔哩科技有限公司 Image processing method and system
CN112488311A (en) * 2020-11-30 2021-03-12 泰康保险集团股份有限公司 Image processing method, device, medium and electronic equipment
CN113902830B (en) * 2021-12-08 2022-03-04 腾讯科技(深圳)有限公司 Method for generating track road network
CN114219946B (en) * 2021-12-29 2022-11-15 北京百度网讯科技有限公司 Text image binarization method and device, electronic equipment and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844740A (en) * 2017-09-05 2018-03-27 中国地质调查局西安地质调查中心 A kind of offline handwriting, printing Chinese character recognition methods and system
CN109063706A (en) * 2018-06-04 2018-12-21 平安科技(深圳)有限公司 Verbal model training method, character recognition method, device, equipment and medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1271403B1 (en) * 2001-06-26 2005-03-09 Nokia Corporation Method and device for character location in images from digital camera
JP4259949B2 (en) * 2003-08-08 2009-04-30 株式会社リコー Image creating apparatus, image creating program, and recording medium
CN109685052A (en) * 2018-12-06 2019-04-26 泰康保险集团股份有限公司 Method for processing text images, device, electronic equipment and computer-readable medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844740A (en) * 2017-09-05 2018-03-27 中国地质调查局西安地质调查中心 A kind of offline handwriting, printing Chinese character recognition methods and system
CN109063706A (en) * 2018-06-04 2018-12-21 平安科技(深圳)有限公司 Verbal model training method, character recognition method, device, equipment and medium

Also Published As

Publication number Publication date
CN110222694A (en) 2019-09-10

Similar Documents

Publication Publication Date Title
CN110222694B (en) Image processing method, image processing device, electronic equipment and computer readable medium
AU2020200058B2 (en) Image quality assessment and improvement for performing optical character recognition
US9754164B2 (en) Systems and methods for classifying objects in digital images captured using mobile devices
CN108229485B (en) Method and apparatus for testing user interface
CN110189336B (en) Image generation method, system, server and storage medium
CN108064395B (en) System and method for embedding two-dimensional code in video image
CN107622504B (en) Method and device for processing pictures
CN111724396B (en) Image segmentation method and device, computer readable storage medium and electronic equipment
US10902590B2 (en) Recognizing pathological images captured by alternate image capturing devices
CN110263301B (en) Method and device for determining color of text
CN110889470B (en) Method and apparatus for processing image
US9665665B2 (en) Visualization credibility score
CN114140805A (en) Image processing method, image processing device, electronic equipment and storage medium
US9648208B2 (en) Method and apparatus and using an enlargement operation to reduce visually detected defects in an image
US10997365B2 (en) Dynamically generating a visually enhanced document
CN112801960A (en) Image processing method and device, storage medium and electronic equipment
CN111159976A (en) Text position labeling method and device
CN111126151A (en) Method, apparatus, device and medium for identifying field in bill image
US20190180445A1 (en) Content aware, spatially adaptive automated thresholding of images
US20230260091A1 (en) Enhancing light text in scanned documents while preserving document fidelity
US20240104949A1 (en) Electronic computing device, and image analysis method and computer program product thereof
JP2014103565A (en) Image processing device and image processing program
US10699381B2 (en) Text enhancement using a binary image generated with a grid-based grayscale-conversion filter
US20240104892A1 (en) Electronic image comparison and materiality determination
CN113780267A (en) Method, device and equipment for character recognition and computer readable medium

Legal Events

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