CN107945194A - Bill dividing method based on OpenCV technologies - Google Patents

Bill dividing method based on OpenCV technologies Download PDF

Info

Publication number
CN107945194A
CN107945194A CN201711046410.XA CN201711046410A CN107945194A CN 107945194 A CN107945194 A CN 107945194A CN 201711046410 A CN201711046410 A CN 201711046410A CN 107945194 A CN107945194 A CN 107945194A
Authority
CN
China
Prior art keywords
bill
edge
picture
opencv
scanned copy
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.)
Pending
Application number
CN201711046410.XA
Other languages
Chinese (zh)
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.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric 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 Sichuan Changhong Electric Co Ltd filed Critical Sichuan Changhong Electric Co Ltd
Priority to CN201711046410.XA priority Critical patent/CN107945194A/en
Publication of CN107945194A publication Critical patent/CN107945194A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • G06T3/147
    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/181Segmentation; Edge detection involving edge growing; involving edge linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20028Bilateral filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20032Median filtering

Abstract

The invention discloses the bill dividing method based on OpenCV technologies, it is related to computer image processing technology field.Comprise the following steps:Step 1:Picture pretreatment is carried out to scanned copy picture, the pretreatment includes the denoising to scanned copy image content and binary conversion treatment, the denoising includes bilateral filtering, medium filtering carries out smoothly, the binary conversion treatment, the gray-scale map content of picture is specially first obtained, then carries out binary conversion treatment further according to rational threshold value;Step 2:Edge detection is carried out to scanned copy using Canny operators, obtains bill edge line of the bill in whole picture, its minimum outer rectangular is then obtained according to bill edge line computation;Step 3:According to the bill edge line detected and its minimum outer rectangular, sola bill is partitioned into using the affine transformation function in Opencv.Method proposed by the invention then only needs marginal information to complete the above process, not only saves computing resource, also improves the speed of bill processing.

Description

Bill dividing method based on OpenCV technologies
Technical field
Embodiments of the present invention are related to computer image processing technology field, more specifically, embodiments of the present invention Relate to the use of OpenCV and realize a kind of high accuracy, high efficiency, the method for versatile automatic segmentation bill.
Background technology
The financial staff of big companies needs to handle substantial amounts of bill cumbersomely daily, with the lifting of corporate business amount, Company may be faced with financial staff shortage, business processing not in time the problem of, at this moment we are just needed by computer vision Middle OCR technique carries out automatic identification and processing.But bill and irregular stickup in scanned copy, using common reimbursement bill as Example, we often many bills mix and it is irregular be attached on the paper of one or more A4 paper sizes, then to this A little paper for pasting bill are scanned, then carry out follow-up identifying processing.But the OCR of bill identifications are not with scanned copy For recognition unit, but a recognition unit is used as using sola bill.Here just need to split using proposed bill Method, i.e., handled the scanned copy of an A4 paper size, and each bill above is split, and in order to improve OCR recognition correct rates are, it is necessary to which backed bill deflection angle is as small as possible.
The content of the invention
The purpose of the present invention is for the defects of above-mentioned background technology, there is provided a kind of bill based on OpenCV technologies point Segmentation method, i.e., based on computer vision technique, bill in automatic segmentation scanned copy is realized by OpenCV.Due to the bill of processing All it is color image, needs first to carry out the pretreatment of bill piece before being corrected, then carried by edge detection algorithm The profile information of bill is taken out, the minimum outer rectangular of profile information is then calculated, finally utilizes wherein three of the rectangle Vertex carries out affine transformation and obtains final " Founder " bill.
In order to reach above-mentioned technique effect, the present invention takes following technical scheme:Bill based on OpenCV technologies point Segmentation method, comprises the following steps:
Step 1:Picture pretreatment is carried out to scanned copy picture, the pretreatment includes removing scanned copy image content To make an uproar processing and binary conversion treatment, the denoising includes bilateral filtering, medium filtering carries out smooth, the binary conversion treatment, The gray-scale map content of picture is specially first obtained, then carries out binary conversion treatment further according to rational threshold value;
Step 2:Edge detection is carried out to scanned copy using Canny operators, obtains bill of the bill in whole picture Edge line, then obtains its minimum outer rectangular according to bill edge line computation;
Step 3:According to the bill edge line detected and its minimum outer rectangular, the affine transformation in Opencv is utilized Function is partitioned into sola bill.
Bill dividing method based on OpenCV technologies, its general principles are:Automatic segmentation bill is realized by opencv, Since the bill of processing is all color image, needs first to carry out the pretreatment of bill piece before being corrected, then pass through Edge detection algorithm extracts the profile information i.e. bill edge line of bill, then is gone out based on bill edge line computation outside its minimum Rectangle;The affine transformation based on rectangle vertex is finally utilized to obtain sola bill.
Opencv (Open Source Computer Vision Library) be one based on BSD permitted it is issuable across Platform computer vision storehouse, may operate in Linux, Windows, Android and Mac OS operating systems.Its lightweight and And efficiently --- it is made of a series of C functions and a small amount of C++ class, while provides connecing for the language such as Python, Ruby, MATLAB Mouthful, realize many general-purpose algorithms in terms of image procossing and computer vision.
Edge (edge) refers to that image local intensity changes most significant part.It is primarily present in target and target, target It is the graphical analyses such as image segmentation, textural characteristics and shape facility between background, region and region (including different color) Important foundation.In order to which bill is identified from background, it would be desirable to edge detection is used, wherein common edge detection is calculated Method has:Sobel operators, Roberts operators, Prewitt operators, Laplacian operators, Canny operators.Wherein Soble operators Image subject and Beijing cannot strictly be separated, Roberts algorithms are not very high to the precision that edge positions, and Prewitt is calculated Son has noise inhibitory action, but edge detection precision is still inadequate;Laplacian operators because using second dervative, So the operator has unacceptable sensitiveness to noise;And used Canny operators are suppressing noise in the present invention, and Edge detection precision has preferable effect.
Further technical solution is:Marginal information point is obtained using Canny edge detections in step 2, is recycled more Side shape fitting algorithm obtains more complete marginal information to edge fitting.
Further technical solution is:One is obtained to the edge calculations after fitting using function boundingRect (args..) A complete rectangle frame, i.e., minimum outer rectangular.
Compared with prior art, the present invention with following beneficial effect:Traditional picture segmentation technology is simply by inspection The edge of target image is surveyed, is then extracted target area using stingy diagram technology, the process and without the concern for angle Degree problem.Bill images segmentation is but drawn a bill evidence according to edge extracting exactly on the contrary, not requiring nothing more than, it is also necessary to which bill can " Founder ".Consider that, when splitting bill, we just need to calculate two important informations from operational angle:Marginal information, angle Information.
Conventional bill cutting techniques go out area-of-interest first with edge extraction, then according to angle information to carrying The image of taking-up carries out the rotation of an angle, finally just obtains us and wants image.Method proposed by the invention then only needs Want marginal information to complete the above process, not only save computing resource, also improve the speed of bill processing.
Brief description of the drawings
Fig. 1 is the bill segmentation flow chart of the present invention;
Fig. 2 is scanned copy design sketch;
Fig. 3 is pretreatment denoising effect figure;
Fig. 4 is pretreatment binaryzation design sketch;
Fig. 5 is bill edge detection design sketch in scanned copy;
Fig. 6 is the minimum outer rectangular design sketch of bill edge in scanned copy;
Fig. 7 is that minimum outer rectangular carries out affine transformation schematic diagram;
Fig. 8 is the bill design sketch after cutting.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, with reference to embodiments, to the present invention It is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not used to Limit the present invention.
Embodiment:
With reference to figure 1, the bill dividing method based on OpenCV technologies, comprises the following steps:
Step 1:Picture pretreatment is carried out to scanned copy picture, which is included to scanned copy image content
A. denoising, including bilateral filtering, medium filtering carry out smoothly;
B. binary conversion treatment, specially first obtains the gray-scale map content of picture, then carries out two further according to rational threshold value Value is handled;
Step 2:Edge detection is carried out to scanned copy using Canny operators, obtains position of the bill in whole picture (Fig. 5 edge lines), then obtains its minimum outer rectangular (Fig. 6 edge lines) according to edge calculations;
Step 3:According to the minimum outer rectangular of the bill edge and edge detected, we utilize imitative in Opencv Penetrate transforming function transformation function and be partitioned into sola bill, so as to carry out OCR identifying processings to bill behind being more advantageous to.
Make more detailed illustrate below:
OpenCV is used as in the widely applied open source software storehouse of image processing field, there is provided the figure that largely can be used directly As processing basic skills, such as denoising, conversion, binaryzation, so we to each basic algorithm with regard to without carrying out local reality It is existing, development efficiency has not only been saved, also can guarantee that higher accuracy.Substantially our common image processing algorithms can be Corresponding method is found in OpenCV, and according to regulation form input picture, parameter, it is possible to obtain the result that we want. It is being to be realized using OpenCV to image processing techniques involved in the bill dividing method.
This technology realizes that flow is broadly divided into two essential parts:First input picture is pre-processed, such as denoising, Regularization etc., this is the indispensable step of image processing field, then recycles us core methed to be carried out to image Processing, finally obtains desired result.It is specific as follows:
1. picture pre-processes;
With reference to figure 2- Fig. 4, which includes the denoising smooth, gray processing, binaryzation to scanned copy image content.Specifically adopt With bilateral filtering, medium filtering, both pretreatment filtering modes are relatively conventional in image preprocessing, and effect compared with It is good, so do not repeat excessively, directly using function bilateralFilter (args..) in OpenCV image procossings storehouse, MedianBlur (args..) is realized.
2. bill edge detection in scanned copy;
With reference to figure 5 and Fig. 6, which includes edge detection and minimum outer rectangular.Edge detection algorithm species is various, respectively There are advantage and disadvantage, wherein Canny algorithms have obvious advantage, and are used widely, here using function Canny in OpenCV (args..).Marginal information point is obtained, recycles polygon approach algorithm approxPolyDP (args..) to intend edge Close, to obtain more complete marginal information, bill edge at this time very close rectangle;To prevent losing for billing information Lose, a complete rectangle frame obtain the edge calculations after fitting using boundingRect (args..) --- minimum exterior square Shape.
3. utilize marginal information segmentation bill;
With reference to figure 7- Fig. 8, which includes carrying out affine transformation to minimum outer rectangular, finally obtains bill images.Such as 7 Shown in figure, there is deflection angle in reimbursement train ticket position on expense report, by previous step outside obtained minimum Rectangle, including the length and width information of rectangle and deflection angle information.Our target is exactly to split rectangle src from the expense report, It is understood that affine transformation can not only be translated, can also be rotated, just can be light as long as obtaining corresponding transformation matrix And easily lift and try to achieve target image dst.On three vertex of known rectangular aspect, three vertex of original rectangular and target rectangle, We are with regard to that can try to achieve affine transformation matrix
The method is related to the edge detection to scanned copy, splits accuracy to improve bill edge detection and bill, builds View carries out bill stickup using the A4 paper high with bill color contrast as far as possible in the specific implementation.
Although reference be made herein to invention has been described for explanatory embodiment of the invention, however, it is to be understood that ability Field technique personnel can be designed that a lot of other modifications and embodiment, these modifications and embodiment will fall in the application public affairs Within the spirit and spirit opened.More specifically, can be to the group of theme combination layout in the range of disclosure A variety of variations and modifications are carried out into component and/or layout.In addition to the variations and modifications carried out to building block and/or layout, To those skilled in the art, other purposes also will be apparent.

Claims (3)

1. the bill dividing method based on OpenCV technologies, it is characterised in that comprise the following steps:
Step 1:Picture pretreatment is carried out to scanned copy picture, the pretreatment is included at the denoising to scanned copy image content Reason and binary conversion treatment, the denoising includes bilateral filtering, medium filtering carries out smooth, the binary conversion treatment, specifically First to obtain the gray-scale map content of picture, then binary conversion treatment is carried out further according to rational threshold value;
Step 2:Edge detection is carried out to scanned copy using Canny operators, obtains bill edge of the bill in whole picture Line, then obtains its minimum outer rectangular according to bill edge line computation;
Step 3:According to the bill edge line detected and its minimum outer rectangular, the affine transformation function in Opencv is utilized It is partitioned into sola bill.
2. the bill dividing method according to claim 1 based on OpenCV technologies, it is characterised in that:Adopted in step 2 Marginal information point is obtained with Canny edge detections, recycles polygon approach algorithm to obtain more complete side to edge fitting Edge information.
3. the bill dividing method according to claim 2 based on OpenCV technologies, it is characterised in that:Using function BoundingRect (args..) obtains the edge calculations after fitting one complete rectangle frame, i.e., minimum outer rectangular.
CN201711046410.XA 2017-10-31 2017-10-31 Bill dividing method based on OpenCV technologies Pending CN107945194A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711046410.XA CN107945194A (en) 2017-10-31 2017-10-31 Bill dividing method based on OpenCV technologies

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711046410.XA CN107945194A (en) 2017-10-31 2017-10-31 Bill dividing method based on OpenCV technologies

Publications (1)

Publication Number Publication Date
CN107945194A true CN107945194A (en) 2018-04-20

Family

ID=61936018

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711046410.XA Pending CN107945194A (en) 2017-10-31 2017-10-31 Bill dividing method based on OpenCV technologies

Country Status (1)

Country Link
CN (1) CN107945194A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109064304A (en) * 2018-08-03 2018-12-21 四川长虹电器股份有限公司 Finance reimbursement bill automated processing system and method
CN109460762A (en) * 2018-10-19 2019-03-12 南京理工大学 A kind of answering card methods of marking based on image recognition
CN109657665A (en) * 2018-10-31 2019-04-19 广东工业大学 A kind of invoice batch automatic recognition system based on deep learning
CN109740548A (en) * 2019-01-08 2019-05-10 北京易道博识科技有限公司 A kind of reimbursement bill images dividing method and system
CN110288655A (en) * 2019-06-28 2019-09-27 深圳市同为数码科技股份有限公司 The method and device of test pattern position in a kind of automatic identification chart picture
CN110322395A (en) * 2019-06-18 2019-10-11 电子科技大学中山学院 Part outline shape detection method and device based on image processing and affine transformation
CN110400321A (en) * 2019-07-26 2019-11-01 广东工业大学 The extracting method of leather material profile based on machine vision and actual size
CN110427932A (en) * 2019-08-02 2019-11-08 杭州睿琪软件有限公司 The method and device of multiple document fields in a kind of identification image
CN111062317A (en) * 2019-12-16 2020-04-24 中国计量大学上虞高等研究院有限公司 Method and system for cutting edges of scanned document
WO2020248497A1 (en) * 2019-06-12 2020-12-17 平安科技(深圳)有限公司 Picture scanning document processing method and apparatus, computer device, and storage medium
CN112801098A (en) * 2019-11-14 2021-05-14 临沂市拓普网络股份有限公司 Contour technology-based mathematical symbol identification method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080101058A (en) * 2007-05-15 2008-11-21 엘지엔시스(주) Apparatus for media recognition and method for media access direction estimating with the same
CN102930265A (en) * 2012-09-19 2013-02-13 广州市中崎商业机器有限公司 Method and device for scanning multiple identity cards
CN104112128A (en) * 2014-06-19 2014-10-22 中国工商银行股份有限公司 Digital image processing system applied to bill image character recognition and method
CN104981105A (en) * 2015-07-09 2015-10-14 广东工业大学 Detecting and error-correcting method capable of rapidly and accurately obtaining element center and deflection angle
CN104990926A (en) * 2015-06-25 2015-10-21 哈尔滨工业大学 TR element locating and defect detecting method based on vision
CN107169488A (en) * 2017-05-03 2017-09-15 四川长虹电器股份有限公司 A kind of correction system and antidote of bill scan image

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080101058A (en) * 2007-05-15 2008-11-21 엘지엔시스(주) Apparatus for media recognition and method for media access direction estimating with the same
CN102930265A (en) * 2012-09-19 2013-02-13 广州市中崎商业机器有限公司 Method and device for scanning multiple identity cards
CN104112128A (en) * 2014-06-19 2014-10-22 中国工商银行股份有限公司 Digital image processing system applied to bill image character recognition and method
CN104990926A (en) * 2015-06-25 2015-10-21 哈尔滨工业大学 TR element locating and defect detecting method based on vision
CN104981105A (en) * 2015-07-09 2015-10-14 广东工业大学 Detecting and error-correcting method capable of rapidly and accurately obtaining element center and deflection angle
CN107169488A (en) * 2017-05-03 2017-09-15 四川长虹电器股份有限公司 A kind of correction system and antidote of bill scan image

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109064304A (en) * 2018-08-03 2018-12-21 四川长虹电器股份有限公司 Finance reimbursement bill automated processing system and method
CN109460762A (en) * 2018-10-19 2019-03-12 南京理工大学 A kind of answering card methods of marking based on image recognition
CN109460762B (en) * 2018-10-19 2022-05-06 南京理工大学 Answer sheet scoring method based on image recognition
CN109657665A (en) * 2018-10-31 2019-04-19 广东工业大学 A kind of invoice batch automatic recognition system based on deep learning
CN109657665B (en) * 2018-10-31 2023-01-20 广东工业大学 Invoice batch automatic identification system based on deep learning
CN109740548A (en) * 2019-01-08 2019-05-10 北京易道博识科技有限公司 A kind of reimbursement bill images dividing method and system
WO2020248497A1 (en) * 2019-06-12 2020-12-17 平安科技(深圳)有限公司 Picture scanning document processing method and apparatus, computer device, and storage medium
CN110322395A (en) * 2019-06-18 2019-10-11 电子科技大学中山学院 Part outline shape detection method and device based on image processing and affine transformation
CN110288655B (en) * 2019-06-28 2021-06-15 深圳市同为数码科技股份有限公司 Method and device for automatically identifying position of test pattern in chart picture
CN110288655A (en) * 2019-06-28 2019-09-27 深圳市同为数码科技股份有限公司 The method and device of test pattern position in a kind of automatic identification chart picture
CN110400321A (en) * 2019-07-26 2019-11-01 广东工业大学 The extracting method of leather material profile based on machine vision and actual size
CN110427932A (en) * 2019-08-02 2019-11-08 杭州睿琪软件有限公司 The method and device of multiple document fields in a kind of identification image
CN112801098A (en) * 2019-11-14 2021-05-14 临沂市拓普网络股份有限公司 Contour technology-based mathematical symbol identification method
CN112801098B (en) * 2019-11-14 2023-01-10 临沂市拓普网络股份有限公司 Contour technology-based mathematical symbol identification method
CN111062317A (en) * 2019-12-16 2020-04-24 中国计量大学上虞高等研究院有限公司 Method and system for cutting edges of scanned document

Similar Documents

Publication Publication Date Title
CN107945194A (en) Bill dividing method based on OpenCV technologies
Gandhi et al. Preprocessing of non-symmetrical images for edge detection
CN104361336A (en) Character recognition method for underwater video images
CN107169488A (en) A kind of correction system and antidote of bill scan image
Shen et al. Improving OCR performance with background image elimination
CN107491730A (en) A kind of laboratory test report recognition methods based on image procossing
CN103208004A (en) Automatic recognition and extraction method and device for bill information area
WO2017012581A1 (en) Method and system for decoding qr code based on weighted average grey method
CN105374015A (en) Binary method for low-quality document image based on local contract and estimation of stroke width
Chen et al. Shadow-based Building Detection and Segmentation in High-resolution Remote Sensing Image.
Harraj et al. OCR accuracy improvement on document images through a novel pre-processing approach
CN110119741A (en) A kind of card card image information recognition methods having powerful connections
CN113160257A (en) Image data labeling method and device, electronic equipment and storage medium
CN110674812B (en) Civil license plate positioning and character segmentation method facing complex background
US11263752B2 (en) Computer-implemented method of detecting foreign object on background object in an image, apparatus for detecting foreign object on background object in an image, and computer-program product
Shedlovska et al. Shadow detection and removal using a shadow formation model
CN113505702A (en) Pavement disease identification method and system based on double neural network optimization
CN115272306A (en) Solar cell panel grid line enhancement method utilizing gradient operation
CN110533049B (en) Method and device for extracting seal image
CN112364863B (en) Character positioning method and system for license document
Salunkhe et al. Recognition of multilingual text from signage boards
Lai et al. Binarization by local k-means clustering for Korean text extraction
Nomura et al. Morphological preprocessing method to thresholding degraded word images
Gun et al. A contour detector with improved corner detection
Jin et al. Towards an automatic system for road lane marking extraction in large-scale aerial images acquired over rural areas by hierarchical image analysis and Gabor filter

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180420