CN112819004B - Image preprocessing method and system for OCR recognition of medical bills - Google Patents

Image preprocessing method and system for OCR recognition of medical bills Download PDF

Info

Publication number
CN112819004B
CN112819004B CN202110147361.9A CN202110147361A CN112819004B CN 112819004 B CN112819004 B CN 112819004B CN 202110147361 A CN202110147361 A CN 202110147361A CN 112819004 B CN112819004 B CN 112819004B
Authority
CN
China
Prior art keywords
image
medical bill
medical
enhanced
bill image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110147361.9A
Other languages
Chinese (zh)
Other versions
CN112819004A (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.)
Hangzhou Hailiang Information Technology Co ltd
Original Assignee
Hangzhou Hailiang Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hailiang Information Technology Co ltd filed Critical Hangzhou Hailiang Information Technology Co ltd
Priority to CN202110147361.9A priority Critical patent/CN112819004B/en
Publication of CN112819004A publication Critical patent/CN112819004A/en
Application granted granted Critical
Publication of CN112819004B publication Critical patent/CN112819004B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Collating Specific Patterns (AREA)
  • Character Input (AREA)

Abstract

The invention discloses an image preprocessing method and system for OCR recognition of medical bills. And establishing a template aiming at the layout information of the medical bill of the hospital, and establishing a corresponding relation between the template and the layout information of the medical bill to be identified by a quick image character invariant feature matching method. Preprocessing such as decomposition and correction is carried out on the medical bill layout to be recognized according to the template information, so that the recognition rate of the OCR of the medical bill can be effectively improved. The method is applied to the field of OCR (optical character recognition) systems of the medical bills, improves the OCR recognition precision of the medical bills, reduces the labor cost, and has important significance on the medical insurance fund management.

Description

Image preprocessing method and system for OCR recognition of medical bills
Technical Field
The invention belongs to the technical field of OCR (optical character recognition) of medical bills, and particularly relates to an image preprocessing method and system for OCR of medical bills.
Background
Along with the improvement of living standard of people, the number of the personnel who attend medical services in different places is increased. The HIS systems of hospitals are different from one another, so that the medical bills are various in printing styles; the printing equipment of hospitals in various places has different styles such as a stylus printer, a laser printer and the like, so that the printing quality of medical bills is different; special red stamps are covered on medical bills printed by hospitals in various places and are covered on characters; the general medical bills for reimbursement are handed over by the insured individuals, and the bills may have creases or stains. These problems present significant challenges to the accuracy of OCR recognition of medical tickets.
Disclosure of Invention
The invention aims to reduce the influence of the problems on OCR recognition of the medical bills, and is realized by providing a preprocessing method for OCR recognition of the medical bills with hospital as a guide. The invention firstly designs a method for removing the red seal of the medical bill edition, enhancing the characters and denoising the background according to the characteristics of the medical bill for pretreatment. Secondly, a template is established according to the layout information of the medical bill of each hospital, a rapid image character invariant feature matching method is designed to establish the corresponding relation between the template and the layout information of the medical bill to be recognized, preprocessing such as decomposition and correction is carried out on the layout of the medical bill to be recognized according to the template information, and the recognition rate of the OCR of the medical bill can be effectively improved.
The invention achieves the aim through the following technical scheme:
the invention provides an image preprocessing method for OCR recognition of medical bills, which comprises the following steps:
s1, removing a red seal, character enhancement processing and background denoising processing from the initial medical bill image based on the initial medical bill image to obtain an enhanced medical bill image;
s2, positioning and extracting image character invariant features of the enhanced medical bill image based on the enhanced medical bill image to obtain a feature value model of the enhanced medical bill image;
and S3, for the medical bill of the hospital without the template, constructing a medical bill identification template of the hospital through a characteristic value model, constructing a characteristic value matching model through the medical bill identification template, matching the medical bill identification template with the medical bill identification template of the hospital through the characteristic value matching model based on the characteristic value of the enhanced medical bill image, and performing layout decomposition and correction on the enhanced medical bill image according to matching parameters to obtain a normalized medical bill image which is used as an input image for OCR (optical character recognition) of the medical bill.
Preferably, S1 includes the steps of:
s1.1, separating RGB three channels based on an initial medical bill image, and constructing an R channel histogram through R channel pixel values and an indication function of the RGB three channels;
s1.2, constructing a cumulative histogram based on the R channel histogram, subtracting the value of the first two bits from the value of the second two bits of the cumulative histogram to construct a difference value array, adding 2 to the subscript corresponding to the minimum value in the difference value array as a threshold value, and performing binarization operation on the initial medical bill image by using the threshold value to obtain an enhanced medical bill image with the red seal removed, the character enhanced and the background denoised.
Preferably, S2 includes the steps of:
s2.1, obtaining a gradient image of the enhanced medical bill image based on the enhanced medical bill image, and constructing a thermal image of the enhanced medical bill image through the gradient image and a linear rectification function;
and S2.2, carrying out non-maximum value suppression operation on the thermal image, and using the coordinate with the thermal image value not being 0 as the position of the image character invariant feature for positioning the image character invariant feature.
Preferably, S2 further includes the steps of:
s201, obtaining a direction angle of a characteristic coordinate based on the coordinate of the image character invariant characteristic and a neighborhood pixel value of a corresponding enhanced medical bill image;
s202, based on the direction angle, performing interlaced sampling on the direction angle sub-region pixel accumulation matrix by calculating the direction angle sub-region pixel accumulation matrix for enhancing the medical bill image to obtain a sub-array, and performing pairwise comparison on elements of the sub-array to obtain a binary data string;
s203, based on the binary data string, constructing an image character invariant feature value by discarding the last bit of the binary data string, wherein the similarity between the two feature values is measured by adopting a Hamming distance.
Preferably, S3 includes the steps of:
s3.1, dividing the hospital medical bill template image and the enhanced medical bill image into 16 multiplied by 16 small areas with equal proportion;
s3.2, matching the character invariant features of each equal-proportion small area of the medical bill template image with the character invariant features of the equal-proportion small areas of the enhanced medical bill image at the corresponding position and four adjacent equal-proportion small areas of the enhanced medical bill image to obtain a first optimal matching pair;
s3.3, character invariant features in each equal proportion small area in the enhanced medical bill image are matched with character invariant features in the equal proportion small area of the medical bill template image at the corresponding position and in four adjacent equal proportion small areas of the equal proportion small area to obtain a second optimal matching pair;
and S3.4, when the first optimal matching pair is the same as the second optimal matching pair, taking the first optimal matching pair as a legal candidate matching pair.
Preferably, S3 further comprises performing layout decomposition and correction on the enhanced medical ticket image according to key information of the medical ticket identification template, wherein the key information includes hospital name, patient invoice, category, item name, size, unit, quantity and amount;
the layout decomposition and correction method comprises the following steps:
s301, selecting a picture frame for key information based on the medical bill identification template, estimating the kernel size of morphological operation according to pixel points of characters in the frame, opening the image in the frame, calculating a minimum rectangular outer bounding box, and taking a vertex set of the minimum rectangular outer bounding box as the key information position of the hospital medical bill identification template;
s302, calculating a homography matrix based on the characteristic value matching model, and mapping key information of the hospital medical bill identification template to the enhanced medical bill image according to the homography matrix for correcting the enhanced medical bill image and decomposing the layout.
An image pre-processing system for OCR recognition of medical tickets, comprising:
the system comprises an enhanced medical bill image generation module, an image character invariant characteristic value generation module, a normalized medical bill image generation module, a data storage module and an image acquisition module;
the data storage module is connected with the image acquisition module and the enhanced medical bill image generation module;
the enhanced medical bill image generation module is connected with the normalized medical bill image generation module through the image character invariant characteristic value generation module; the image acquisition module is used for acquiring an initial medical bill image; the enhanced medical bill image generation module is used for generating an enhanced medical bill image; the image character invariant characteristic value generation module is used for generating a characteristic value of the enhanced medical bill image according to the enhanced medical bill image; the normalized medical bill image generation module is used for generating a normalized medical bill image and providing the input image for OCR recognition of the medical bill.
Preferably, the standardized medical bill image generation module comprises a medical bill identification template generation unit, an image character invariant feature positioning and extraction unit and a feature value matching identification unit; the medical bill identification template generating unit is used for generating a hospital medical bill identification template; the image character invariant feature positioning and extracting unit is used for positioning and extracting the features of the enhanced medical bill image; the characteristic value matching and identifying unit is used for carrying out characteristic matching according to the enhanced medical bill to be identified and the hospital medical bill identifying template and obtaining a normalized medical bill image based on the matching parameters.
Preferably, the normalized medical bill image generation module further comprises an enhanced medical bill image layout decomposition unit and an enhanced medical bill image layout correction unit, and the enhanced medical bill image layout decomposition unit and the enhanced medical bill image layout correction unit are used for enhancing the layout decomposition and correction of the medical bill image and improving the OCR recognition accuracy.
The positive progress effects of the invention are as follows: the method is applied to the field of OCR (optical character recognition) systems of the medical bills, improves the OCR recognition precision of the medical bills, reduces the labor cost, and has important significance on the medical insurance fund management.
Drawings
FIG. 1 is a technical flow diagram provided by an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any inventive step, are within the scope of the present application.
As shown in FIG. 1, the invention provides an image preprocessing method for OCR recognition of medical bills, which comprises the following steps:
s1, removing a red seal, character enhancement processing and background denoising processing from the initial medical bill image based on the initial medical bill image to obtain an enhanced medical bill image;
s2, positioning and extracting image character invariant features of the enhanced medical bill image based on the enhanced medical bill image to obtain a feature value model of the enhanced medical bill image;
and S3, for the medical bill of the hospital without the template, constructing a medical bill identification template of the hospital through a characteristic value model, constructing a characteristic value matching model through the medical bill identification template, matching the medical bill identification template with the medical bill identification template of the hospital through the characteristic value matching model based on the characteristic value of the enhanced medical bill image, and performing layout decomposition and correction on the enhanced medical bill image according to matching parameters to obtain a normalized medical bill image which is used as an input image for OCR (optical character recognition) of the medical bill.
Step S1 includes the following steps:
s1.1, separating RGB three channels based on an initial medical bill image, and constructing an R channel histogram through R channel pixel values and an indication function of the RGB three channels;
s1.2, constructing a cumulative histogram based on the R channel histogram, subtracting the value of the first two bits from the value of the second two bits of the cumulative histogram to construct a difference value array, adding 2 to the subscript corresponding to the minimum value in the difference value array as a threshold value, and performing binarization operation on the initial medical bill image by using the threshold value to obtain an enhanced medical bill image with the red seal removed, the character enhanced and the background denoised.
Step S2 includes the following steps:
s2.1, obtaining a gradient image of the enhanced medical bill image based on the enhanced medical bill image, and constructing a thermal image of the enhanced medical bill image through the gradient image and a linear rectification function;
and S2.2, carrying out non-maximum value suppression operation on the thermal image, and using the coordinate with the thermal image value not being 0 as the position of the image character invariant feature for positioning the image character invariant feature.
Step S2 further includes the steps of:
s201, obtaining a direction angle of a characteristic coordinate based on the coordinate of the image character invariant characteristic and a neighborhood pixel value of a corresponding enhanced medical bill image;
s202, based on the direction angle, performing interlaced sampling on the direction angle sub-region pixel accumulation matrix by calculating the direction angle sub-region pixel accumulation matrix for enhancing the medical bill image to obtain a sub-array, and performing pairwise comparison on elements of the sub-array to obtain a binary data string;
s203, based on the binary data string, constructing an image character invariant feature value by discarding the last bit of the binary data string, wherein the similarity between the two feature values is measured by adopting a Hamming distance.
Step S3 includes the following steps:
s3.1, dividing the hospital medical bill template image and the enhanced medical bill image into 16 multiplied by 16 small areas with equal proportion;
s3.2, matching the character invariant features of each equal-proportion small area of the medical bill template image with the character invariant features of the equal-proportion small areas of the enhanced medical bill image at the corresponding position and four adjacent equal-proportion small areas of the enhanced medical bill image to obtain a first optimal matching pair;
s3.3, character invariant features in each equal proportion small area in the enhanced medical bill image are matched with character invariant features in the equal proportion small area of the medical bill template image at the corresponding position and in four adjacent equal proportion small areas of the equal proportion small area to obtain a second optimal matching pair;
and S3.4, when the first optimal matching pair is the same as the second optimal matching pair, taking the first optimal matching pair as a legal candidate matching pair.
Step S3 further comprises, decomposing and correcting the layout of the enhanced medical bill image according to the key information of the medical bill identification template, wherein the key information includes hospital name, patient expense list, category, project name, specification, unit, quantity and amount;
the layout decomposition and correction method comprises the following steps:
s301, selecting a picture frame for key information based on the medical bill identification template, estimating the kernel size of morphological operation according to pixel points of characters in the frame, opening the image in the frame, calculating a minimum rectangular outer bounding box, and taking a vertex set of the minimum rectangular outer bounding box as the key information position of the hospital medical bill identification template;
s302, calculating a homography matrix based on the characteristic value matching model, and mapping key information of the hospital medical bill identification template to the enhanced medical bill image according to the homography matrix for correcting the enhanced medical bill image and decomposing the layout.
An image pre-processing system for OCR recognition of medical tickets, comprising:
the system comprises an enhanced medical bill image generation module, an image character invariant characteristic value generation module, a normalized medical bill image generation module, a data storage module and an image acquisition module; the data storage module is connected with the image acquisition module and the enhanced medical bill image generation module; the enhanced medical bill image generation module is connected with the normalized medical bill image generation module through the image character invariant characteristic value generation module; the image acquisition module is used for acquiring an initial medical bill image; the enhanced medical bill image generation module is used for generating an enhanced medical bill image; the image character invariant characteristic value generation module is used for generating a characteristic value of the enhanced medical bill image according to the enhanced medical bill image; the normalized medical bill image generation module is used for generating a normalized medical bill image and providing the input image for OCR recognition of the medical bill.
The standardized medical bill image generation module comprises a medical bill identification template generation unit, an image character invariant feature positioning and extraction unit and a feature value matching identification unit; the medical bill identification template generating unit is used for generating a hospital medical bill identification template; the image character invariant feature positioning and extracting unit is used for positioning and extracting the features of the enhanced medical bill image; the characteristic value matching and identifying unit is used for carrying out characteristic matching according to the enhanced medical bill to be identified and the hospital medical bill identifying template and obtaining a normalized medical bill image based on the matching parameters.
The standardized medical bill image generation module further comprises an enhanced medical bill image layout decomposition unit and an enhanced medical bill image layout correction unit, and the enhanced medical bill image layout decomposition unit and the enhanced medical bill image layout correction unit are used for enhancing the layout decomposition and correction of the medical bill image and improving the OCR recognition accuracy.
The invention will be further described with reference to specific examples, but the scope of the invention is not limited thereto:
example (b): as shown in FIG. 1, the pretreatment method for OCR recognition of medical bills disclosed by the invention comprises the following steps:
step 1: a medical bill red seal removing, character enhancing and background denoising method;
step 1.1: the invention firstly separates RGB three channels of medical note images, and counts the histogram of R channel:
H(x)=∑iI(Pr,i=k) (1)
where H (k) denotes the k-th element value of the histogram, Pr,iFor the ith pixel value of the R channel of the image, I (-) is an indication function when Pr,iK is 1, otherwise 0. And calculates its cumulative histogram:
A(k)=A(k-1)+H(k) (2)
search for threshold t on cumulative histogram:
t=argmintA(t+2)-A(t-2) (3)
and (3) carrying out binarization operation on the medical bill image according to the threshold value of the formula (3):
Figure GDA0003143875010000101
wherein P isiIs the ith pixel value of the binary image I. Through the binarization operation of the formula (4), foreground characters of the medical bill image are sharpened, and red stamps and background noise are filtered.
Step 2: designing a medical bill-oriented rapid image character invariant feature positioning, extracting and template rapid matching method;
step 2.1: the fast image character invariant feature localization of the invention first calculates a gradient image D according to an image I:
Dx,y=|Ix+1,y-Ix-1,y|+|Ix,y+1-Ix,y-1| (5)
the thermal image is calculated according to the following formula:
Figure GDA0003143875010000111
where R (·) is the ReLU linear rectification function, W { (-7, -7), (-7, 0), (-7, 7), (0, -7), (0, 7), (7, -7), (7, 0), (7, 7) }. To Mx,yPerforming 7 × 7 non-maximum suppression operation, when M isx,yIf the value is not 0, the coordinates (x, y) are the positions of the image character invariant features.
Step 2.2: for each invariant feature's coordinate (i, j), its orientation angle is calculated:
Figure GDA0003143875010000112
when k is 0, 1, 2, …, 62,
Figure GDA0003143875010000113
when k is 63, 64, 65, …, 125,
Figure GDA0003143875010000121
performing interlaced sampling on the V to form a sub-array S, performing pairwise comparison on elements in the S, and forming a binary data by using a comparison result:
B=∑0≤k≤4642kI(Si≥Sj) (10)
in order to improve the operation efficiency of the computer, the last bit of B is abandoned, and only the first 464 bits are reserved as the characteristic value of the invariant feature of the image character. The similarity between two features is measured using the hamming distance.
Step 2.3: in order to accelerate the speed of template matching, the invention divides the picture into 16 x 16 small areas according to equal proportion and carries out local search according to the small areas. Let the medical bill template be T, Ti,jThe (i, j) th small area, and the medical bill to be identified is G. When making a match, Gi,jThe feature point in (1) only needs to search for Ti,j、Ti-1,j、Ti+1,j、Ti,j-1And Ti,j+1And waiting for the feature points in the 5 small regions without matching other feature points of the global image. The method not only greatly reduces the number of the feature points to be searched, improves the operation speed, but also reduces the number of the mismatching feature points.
In order to improve the stability of the search, the matching result is confirmed by adopting the principle of bidirectional consistency.In particular, assume fmIs Gi,jA certain feature point in (1), if searching for Ti,j、Ti-1,j、Ti+1,j、Ti,j-1And Ti,j+1Obtaining the best matching characteristic point f after waiting for 5 small areasn(ii) a Following the feature point fnDe-search Gi,j、Gi-1,j、Gi+1,j、Gi,j-1And Gi,j+1Wait for 5 small areas if the feature point fnThe obtained best matching feature point is fmIf so, the two-way matching is considered to be consistent, and the matched characteristic point pair is taken as a legal candidate matching pair; otherwise, discarding. .
And step 3: preprocessing the medical bill image to be identified such as layout decomposition and correction according to the key information of the template;
step 3.1: when the template is created first, the user takes a frame of the key information of the hospital on the template image, such as the name of the hospital, the bill of the patient's fee, the category, the name of the item, the specification, the unit, the quantity, the amount, etc. And automatically optimizing the frame boundary drawn by each piece of key information so as to better fit the text information on the picture. Firstly, estimating the kernel size of morphological operation according to the pixel points of characters in the frame:
Figure GDA0003143875010000131
where w and h are the width and height of the box, respectively. The image in the frame is opened by taking mu as a core, then the minimum rectangle outer bounding box is obtained, and the vertex of the rectangles is marked as C.
And (3) calculating a homography matrix O according to the template T obtained in the step (2.3) and the matching pair of the medical bill G to be identified currently, and positioning the key information of the hospital on the G picture according to the homography matrix.
CG=O·CT(12)
Wherein C isTSet of rectangular vertices, C, in template TGIs a set of rectangular vertices in note G. According to CGCan calculate the inclination angle, the scale and the like of the image GAnd correcting rotation, scaling and the like, and on the basis, each layout of the medical bill G can be segmented according to key information items and then sent to an OCR engine for recognition.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the present invention in its spirit and scope. Are intended to be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. An image preprocessing method for OCR recognition of medical bills is characterized by comprising the following steps:
s1, removing a red seal, character enhancement processing and background denoising processing from an initial medical bill image based on the initial medical bill image to obtain an enhanced medical bill image;
the S1 includes the steps of:
s1.1, separating based on RGB three channels of the initial medical bill image, and constructing an R channel histogram through R channel pixel values and an indication function of the RGB three channels;
s1.2, constructing a cumulative histogram based on the R channel histogram, subtracting the value of the first two bits from the value of the second two bits of the cumulative histogram to construct a difference value array, adding 2 to the subscript corresponding to the minimum value in the difference value array as a threshold value, and performing binarization operation on the initial medical bill image by using the threshold value to obtain the enhanced medical bill image with the red seal removed, the character enhanced and the background denoised;
s2, positioning and extracting image character invariant features of the enhanced medical bill image based on the enhanced medical bill image to obtain a feature value model of the enhanced medical bill image;
and S3, for the medical bill of the hospital without the template, constructing a medical bill identification template of the hospital through the characteristic value model, constructing a characteristic value matching model through the medical bill identification template, matching the medical bill identification template of the hospital with the characteristic value matching model based on the characteristic value of the enhanced medical bill image, performing layout decomposition and correction on the enhanced medical bill image according to matching parameters to obtain a normalized medical bill image, and using the normalized medical bill image as an input image for OCR (optical character recognition) of the medical bill.
2. The image preprocessing method for OCR recognition of medical tickets according to claim 1,
the S2 includes the steps of:
s2.1, obtaining a gradient image of the enhanced medical bill image based on the enhanced medical bill image, and constructing a thermal image of the enhanced medical bill image through the gradient image and a linear rectification function;
and S2.2, carrying out non-maximum value suppression operation on the thermal image, and taking the coordinate with the thermal image value not being 0 as the position of the image character invariant feature for positioning the image character invariant feature.
3. The image preprocessing method for OCR recognition of medical tickets according to claim 1,
the S2 further includes the steps of:
s201, obtaining a direction angle of the feature coordinate based on the coordinate of the image character invariant feature and the neighborhood pixel value of the corresponding enhanced medical bill image;
s202, based on the direction angle, performing interlaced sampling on the direction angle sub-region pixel accumulation matrix by calculating the direction angle sub-region pixel accumulation matrix of the enhanced medical bill image to obtain a sub-array, and performing pairwise comparison on elements of the sub-array to obtain a binary data string;
s203, based on the binary data string, constructing an image character invariant feature value by discarding the last bit of the binary data string, wherein the similarity between the two feature values is measured by adopting a Hamming distance.
4. The image preprocessing method for OCR recognition of medical tickets according to claim 1,
the S3 includes the steps of:
s3.1, dividing the hospital medical bill template image and the enhanced medical bill image into 16 multiplied by 16 small areas with equal proportion;
s3.2, matching the character invariant features of each equal-proportion small area of the medical bill template image with the character invariant features of the equal-proportion small area of the enhanced medical bill image at the corresponding position and four adjacent equal-proportion small areas of the enhanced medical bill image to obtain a first optimal matching pair;
s3.3, matching the character invariant features in each equal-proportion small area in the enhanced medical bill image with the character invariant features in the equal-proportion small areas of the medical bill template image at the corresponding positions and the character invariant features in the four adjacent equal-proportion small areas to obtain a second optimal matching pair;
and S3.4, when the first optimal matching pair is the same as the second optimal matching pair, taking the first optimal matching pair as a legal candidate matching pair.
5. The image preprocessing method for OCR recognition of medical tickets according to claim 1,
the S3 further includes performing layout decomposition and correction on the enhanced medical ticket image according to key information of the medical ticket identification template, wherein the key information includes hospital name, patient invoice, category, project name, specification, unit, quantity and amount;
the layout decomposition and correction method comprises the following steps:
s301, performing picture frame selection on the key information based on the medical bill identification template, estimating the kernel size of morphological operation according to pixel points of characters in a frame, performing opening operation on the image in the frame, calculating a minimum rectangular outer bounding box, and taking a vertex set of the minimum rectangular outer bounding box as the key information position of the hospital medical bill identification template;
s302, calculating a homography matrix based on the characteristic value matching model, and realizing the mapping from the key information of the hospital medical bill identification template to the enhanced medical bill image according to the homography matrix for the correction and layout decomposition of the enhanced medical bill image.
6. An image preprocessing system for OCR recognition of medical tickets, realized based on the method of any one of claims 1 to 5, comprising:
the system comprises an enhanced medical bill image generation module, an image character invariant characteristic value generation module, a normalized medical bill image generation module, a data storage module and an image acquisition module;
the data storage module is connected with the image acquisition module and the enhanced medical bill image generation module;
the enhanced medical bill image generation module is connected with the normalized medical bill image generation module through the image character invariant characteristic value generation module;
the image acquisition module is used for acquiring the initial medical bill image;
the enhanced medical bill image generation module is used for generating the enhanced medical bill image;
the image character invariant feature value generation module is used for generating a feature value of the enhanced medical bill image according to the enhanced medical bill image;
the normalized medical bill image generation module is used for generating the normalized medical bill image and providing the input image for OCR recognition of the medical bill.
7. The image preprocessing system for OCR recognition of medical tickets as claimed in claim 6,
the standardized medical bill image generation module comprises a medical bill identification template generation unit, an image character invariant feature positioning and extraction unit and a feature value matching identification unit;
the medical bill identification template generating unit is used for generating a hospital medical bill identification template;
the image character invariant feature positioning and extracting unit is used for positioning and extracting the features of the enhanced medical bill image;
the characteristic value matching and identifying unit is used for carrying out characteristic matching according to the enhanced medical bill to be identified and the hospital medical bill identifying template and obtaining the normalized medical bill image based on matching parameters.
8. The image preprocessing system for OCR recognition of medical tickets as claimed in claim 7,
the normalized medical bill image generation module further comprises an enhanced medical bill image layout decomposition unit and an enhanced medical bill image layout correction unit, and the enhanced medical bill image layout decomposition and correction unit is used for enhancing the layout decomposition and correction of the medical bill image and improving the OCR recognition precision.
CN202110147361.9A 2021-02-03 2021-02-03 Image preprocessing method and system for OCR recognition of medical bills Active CN112819004B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110147361.9A CN112819004B (en) 2021-02-03 2021-02-03 Image preprocessing method and system for OCR recognition of medical bills

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110147361.9A CN112819004B (en) 2021-02-03 2021-02-03 Image preprocessing method and system for OCR recognition of medical bills

Publications (2)

Publication Number Publication Date
CN112819004A CN112819004A (en) 2021-05-18
CN112819004B true CN112819004B (en) 2021-08-24

Family

ID=75860765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110147361.9A Active CN112819004B (en) 2021-02-03 2021-02-03 Image preprocessing method and system for OCR recognition of medical bills

Country Status (1)

Country Link
CN (1) CN112819004B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114445842B (en) * 2022-01-25 2022-09-20 杭州海量信息技术有限公司 Medical insurance catalogue matching method for OCR (optical character recognition) of medical bills
CN115131910B (en) * 2022-05-30 2024-02-13 华中科技大学同济医学院附属协和医院 Bill checking system based on big data
CN116189181B (en) * 2022-11-11 2024-01-23 杭州海量信息技术有限公司 Image normalization method and system for identity card OCR
CN117456532B (en) * 2023-11-10 2024-05-31 北京方易行信息科技有限公司 Correction method, device, equipment and storage medium for medicine amount

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622593A (en) * 2012-02-10 2012-08-01 北方工业大学 Text recognition method and system
CN105654072A (en) * 2016-03-24 2016-06-08 哈尔滨工业大学 Automatic character extraction and recognition system and method for low-resolution medical bill image
CN110580694A (en) * 2019-09-11 2019-12-17 石家庄学院 Secondary histogram equalization dynamic image method
CN212460579U (en) * 2021-01-04 2021-02-02 四川劳吉克信息技术有限公司 Automatic scanning equipment for medical equipment operation data

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9087272B2 (en) * 2013-07-17 2015-07-21 International Business Machines Corporation Optical match character classification
US9530068B2 (en) * 2014-11-10 2016-12-27 International Business Machines Corporation Template matching with data correction

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622593A (en) * 2012-02-10 2012-08-01 北方工业大学 Text recognition method and system
CN105654072A (en) * 2016-03-24 2016-06-08 哈尔滨工业大学 Automatic character extraction and recognition system and method for low-resolution medical bill image
CN110580694A (en) * 2019-09-11 2019-12-17 石家庄学院 Secondary histogram equalization dynamic image method
CN212460579U (en) * 2021-01-04 2021-02-02 四川劳吉克信息技术有限公司 Automatic scanning equipment for medical equipment operation data

Also Published As

Publication number Publication date
CN112819004A (en) 2021-05-18

Similar Documents

Publication Publication Date Title
CN112819004B (en) Image preprocessing method and system for OCR recognition of medical bills
Roy et al. HMM-based Indic handwritten word recognition using zone segmentation
CN109948510B (en) Document image instance segmentation method and device
JP4676225B2 (en) Method and apparatus for capturing electronic forms from scanned documents
US8494273B2 (en) Adaptive optical character recognition on a document with distorted characters
US11232300B2 (en) System and method for automatic detection and verification of optical character recognition data
US10489645B2 (en) System and method for automatic detection and verification of optical character recognition data
CN110442744A (en) Extract method, apparatus, electronic equipment and the readable medium of target information in image
US20220222284A1 (en) System and method for automated information extraction from scanned documents
JP2008259156A (en) Information processing device, information processing system, information processing method, program, and storage medium
CN112926469B (en) Certificate identification method based on deep learning OCR and layout structure
JP2009282985A (en) Method of identifying orientation of digital image
US11881043B2 (en) Image processing system, image processing method, and program
US20210209393A1 (en) Image processing system, image processing method, and program
CN112668580A (en) Text recognition method, text recognition device and terminal equipment
Saabni Efficient recognition of machine printed Arabic text using partial segmentation and Hausdorff distance
Bains et al. Dynamic features based stroke recognition system for signboard images of Gurmukhi text
JP5353325B2 (en) Document data generation apparatus and document data generation method
CN116563876A (en) Invoice identification method
JP2008282094A (en) Character recognition processing apparatus
CN115731550A (en) Deep learning-based automatic drug specification identification method and system and storage medium
Kumar et al. Line based robust script identification for indianlanguages
CN115376139A (en) Label collecting and analyzing system based on OCR high-speed image recognition
US11335108B2 (en) System and method to recognise characters from an image
CN111612045B (en) Universal method for acquiring target detection data set

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