CN111461100A - Bill identification method and device, electronic equipment and storage medium - Google Patents

Bill identification method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111461100A
CN111461100A CN202010243502.2A CN202010243502A CN111461100A CN 111461100 A CN111461100 A CN 111461100A CN 202010243502 A CN202010243502 A CN 202010243502A CN 111461100 A CN111461100 A CN 111461100A
Authority
CN
China
Prior art keywords
bill
image
target
scanning piece
contour
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.)
Granted
Application number
CN202010243502.2A
Other languages
Chinese (zh)
Other versions
CN111461100B (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.)
Chongqing Rural Commercial Bank Co ltd
Original Assignee
Chongqing Rural Commercial Bank 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 Chongqing Rural Commercial Bank Co ltd filed Critical Chongqing Rural Commercial Bank Co ltd
Priority to CN202010243502.2A priority Critical patent/CN111461100B/en
Publication of CN111461100A publication Critical patent/CN111461100A/en
Application granted granted Critical
Publication of CN111461100B publication Critical patent/CN111461100B/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
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • 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/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
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The application provides a bill identification method, which comprises the following steps: acquiring a target bill scanning piece, and cutting a target area of the target bill scanning piece to obtain a bill training image; sequentially carrying out graying, self-adaptive threshold binarization, expansion processing and corrosion processing on the bill training image to obtain a processed image; carrying out contour detection on the processed image to obtain a position coordinate; and inputting the position coordinates and the content information into a trainer so as to obtain a bill recognizer, and recognizing the bill scanning piece to be recognized by using the bill recognizer. According to the bill training image processing method and device, the target area of the target bill scanning piece is cut to obtain the bill training image, a small range is formulated in the complicated bill image through cutting of the target area, positioning is carried out under the background of small interference, and the identification accuracy is improved. The application also provides a bill recognition device, an electronic device and a computer readable storage medium, which all have the beneficial effects.

Description

Bill identification method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of artificial intelligence training technologies, and in particular, to a bill identification method, a bill identification device, an electronic device, and a computer-readable storage medium.
Background
The OCR recognition has great demand in the banking industry, the OCR recognition accuracy of various bills of a bank is greatly improved along with the development of an artificial intelligence technology at present, but like other artificial intelligence technologies, a great deal of training must be firstly carried out on the bills to be recognized in order to achieve higher accuracy.
The current general training method generally comprises the following steps of carrying out the following steps on a certain amount of samples: manually framing a position to be identified; inputting field content in a selection position of the box; and importing the position coordinates and the contents of all the training sample frame selections into a machine learning system for training and modeling. However, the field content of the bill can be directly exported from the system, but for the framing position, only manual marking is needed, which is time-consuming, because framing affects the recognition rate and the precision requirement is high, therefore, manual framing is adopted, the framing efficiency is low under the condition of ensuring the precision, and the labor cost is increased.
Therefore, how to provide a solution to the above technical problem is a problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The application aims to provide a bill identification method, a bill identification device, an electronic device and a computer readable storage medium, which can improve the efficiency of frame selection and reduce the cost. The specific scheme is as follows:
the application provides a bill identification method, which comprises the following steps:
acquiring a target bill scanning piece, and cutting a target area of the target bill scanning piece to obtain a bill training image;
sequentially carrying out graying, self-adaptive threshold binarization, expansion processing and corrosion processing on the bill training image to obtain a processed image;
carrying out contour detection on the processed image to obtain a position coordinate;
and inputting the position coordinates and the content information into a trainer so as to obtain a bill recognizer, and recognizing the bill scanning piece to be recognized by using the bill recognizer.
Optionally, the obtaining a target bill scanned part, and cutting a target area of the target bill scanned part to obtain a bill training image includes:
acquiring the target bill scanning piece;
receiving bill type information, and determining the target area according to the bill type information;
and cutting the target area of the target bill scanning piece to obtain the bill training image.
Optionally, the performing contour detection on the processed image to obtain a position coordinate includes:
carrying out contour detection on the processed image to obtain a contour image;
and acquiring a contour region in the contour image within a preset threshold area range, and determining the coordinate position of the contour region.
Optionally, the inputting the position coordinates and the content information into a trainer so as to obtain a bill recognizer includes:
inputting the position coordinates and the content information into the trainer;
after the trainer is trained, an initial bill recognizer is obtained;
judging whether the identification accuracy of the initial bill identifier to the test bill image is greater than a preset accuracy;
and if so, obtaining the bill recognizer.
Optionally, the inputting the position coordinates and the content information into the trainer includes:
when the position coordinate is wrong, receiving the specified position coordinate;
inputting the specified position coordinates and the content information into the trainer.
The application provides a bill recognition device, includes:
the cutting module is used for obtaining a target bill scanning piece and cutting a target area of the target bill scanning piece to obtain a bill training image;
the processed image obtaining module is used for sequentially carrying out graying, adaptive threshold binarization, expansion processing and corrosion processing on the bill training image to obtain a processed image;
the contour detection module is used for carrying out contour detection on the processed image to obtain a position coordinate;
and the bill recognizer obtaining and recognizing module is used for inputting the position coordinates and the content information into the trainer so as to obtain the bill recognizer, and recognizing the bill scanning piece to be recognized by utilizing the bill recognizer.
Optionally, the cutting module includes:
the target bill scanning piece obtaining unit is used for obtaining the target bill scanning piece;
the target area determining unit is used for receiving the bill type information and determining the target area according to the bill type information;
and the cutting unit is used for cutting the target area of the target bill scanning piece to obtain the bill training image.
Optionally, the contour detection module includes:
the contour image acquisition unit is used for carrying out contour detection on the processed image to obtain a contour image;
and the coordinate position determining unit is used for acquiring a contour region in the contour image within a preset threshold area range and determining the coordinate position of the contour region.
Optionally, the ticket recognizer obtaining and recognizing module includes:
an input unit for inputting the position coordinates and the content information into the trainer;
the initial bill recognizer determining unit is used for obtaining an initial bill recognizer after the trainer is trained;
the judging unit is used for judging whether the identification accuracy of the initial bill recognizer on the test bill image is greater than the preset accuracy;
and the bill identifier acquisition unit is used for acquiring the bill identifier if the bill identifier is acquired.
Optionally, the ticket recognizer obtaining and recognizing module includes:
an acquisition unit configured to receive the specified position coordinate when the position coordinate is erroneous;
an input unit for inputting the specified position coordinates and the content information into the trainer.
The application provides an electronic device, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of the bill identification method when executing the computer program.
The present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of ticket identification as described above.
The application provides a bill identification method, which comprises the following steps: acquiring a target bill scanning piece, and cutting a target area of the target bill scanning piece to obtain a bill training image; sequentially carrying out graying, self-adaptive threshold binarization, expansion processing and corrosion processing on the bill training image to obtain a processed image; carrying out contour detection on the processed image to obtain a position coordinate; and inputting the position coordinates and the content information into a trainer so as to obtain a bill recognizer, and recognizing the bill scanning piece to be recognized by using the bill recognizer.
Therefore, the bill training image is obtained by cutting the target area of the target bill scanning piece, a small range is formulated in the complex bill image by cutting the target area, positioning is carried out under the background of small interference, the identification accuracy is improved, and then graying, self-adaptive threshold value binaryzation, expansion processing, corrosion processing and contour detection are carried out on the bill training image to obtain the coordinate position, high-precision positioning is realized, and the problems of low efficiency and high cost of manual positioning in the related technology are solved by an automatic positioning mode.
The application also provides a bill recognition device, electronic equipment and a computer readable storage medium, which all have the beneficial effects and are not repeated herein.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a bill identifying method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a grayed image provided in an embodiment of the present application;
fig. 3 is a schematic diagram of a binarized image provided in an embodiment of the present application;
FIG. 4 is a schematic view of an image after a first dilation operation according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of an image after an etching operation according to an embodiment of the present disclosure;
FIG. 6 is a schematic view of an image after a second dilation operation as provided in embodiments of the present application;
FIG. 7 is a schematic diagram of a contour image provided in an embodiment of the present application;
FIG. 8 is a schematic diagram of a final contour image provided by an embodiment of the present application;
fig. 9 is a schematic structural diagram of a bill identifying device according to an embodiment of the present application.
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 some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The current general training method generally comprises the following steps of carrying out the following steps on a certain amount of samples: manually framing a position to be identified; inputting field content in a selection position of the box; and importing the position coordinates and the contents of all the training sample frame selections into a machine learning system for training and modeling. However, the field content of the bill can be directly exported from the system, but for the framing position, only manual marking is needed, which is time-consuming, because framing affects the recognition rate and the precision requirement is high, therefore, manual framing is adopted, the framing efficiency is low under the condition of ensuring the precision, and the labor cost is increased. Based on the above technical problem, the present embodiment provides a bill identification method, and please refer to fig. 1 specifically, where fig. 1 is a flowchart of a bill identification method provided in the present embodiment, and the method specifically includes:
s110, obtaining a target bill scanning piece, and cutting a target area of the target bill scanning piece to obtain a bill training image.
In the embodiment, the size of the target bill scanning piece is not limited, and generally, the sizes of all the target bill scanning pieces are consistent, so that the coordinate information of the target areas of all the target bill scanning pieces is consistent, and the bill training image can be obtained by only cutting according to the coordinate information.
Further, the step of obtaining the target bill scanning piece comprises the steps of obtaining an initial target bill scanning piece, judging the proportion between the initial target bill scanning piece and a standard target bill scanning piece, and amplifying or reducing according to the proportion to obtain the target bill scanning piece so as to realize the same size of all the target bill scanning pieces. Further, before the target bill scanning piece is enlarged or reduced according to the proportion, the method can further comprise the step of rotating the initial target bill scanning piece.
Further, acquiring a target bill scanning piece, cutting a target area of the target bill scanning piece to obtain a bill training image, comprising: acquiring a target bill scanning piece; receiving bill type information, and determining a target area according to the bill type information; and cutting the target area of the target bill scanning piece to obtain a bill training image.
It will be appreciated that the target document scans for different document type information will have different defined areas, for example, for document type information a, the desired target area a 1; ticket type information b, desired target areas b1, b 2; note type information c, desired destination areas c1, c2, c 3. Therefore, in this embodiment, the association relationship between the ticket type information and the target area is preset. In one implementation, receiving ticket type information and determining a target area based on the ticket type information includes: when a user sends a bill type instruction through preset operation, acquiring bill type information according to the bill type instruction, and matching the bill type information with the association relationship between the bill type information and a target area to acquire the target area; in another implementable embodiment, receiving ticket type information and determining a target zone based on the ticket type information includes: acquiring a target bill scanning piece, acquiring corresponding bill type information according to the mark information of the target bill scanning piece, and matching the bill type information with the association relationship between the bill type information and a target area to acquire a target area; of course, there may be other modes, and the present embodiment is not limited to this, as long as the object of the present embodiment can be achieved.
Therefore, the directional cutting is realized by setting the bill type information and matching the bill type information with the target area, and the directional cutting method can be applied to various bills and has wider application range.
And S120, sequentially carrying out graying, adaptive threshold binarization, expansion processing and corrosion processing on the bill training image to obtain a processed image.
The graying of the note training image is to calculate the gray value of each pixel point of the note training image by rgb three components of each pixel point through a certain algorithm, so that the image only contains brightness but not color information. r, g, b are three-channel color images, gray is a single-channel gray image, and a gray processing formula is as follows: gray 0.114+ g 0.587+ r 0.299 to obtain a gray scale map.
The method comprises the steps of carrying out self-adaptive threshold binarization on a gray image, wherein the self-adaptive threshold binarization is to convert a picture subjected to graying into an image only containing black and white colors, no change of other grays exists between the black and white images, a fixed threshold is not required to be determined in self-adaptive threshold operation, and binarization processing can be carried out on each pixel point through a self-adaptive set threshold of local features of the image according to a corresponding self-adaptive method to obtain a binarized image. And (3) performing expansion processing on the binary image, and performing expansion processing by adopting a square convolution kernel: traversing each pixel in the image, and performing expansion operation on each pixel to obtain an expanded image, wherein a convolution kernel is smaller and the convolution times are less in the expansion process. And (3) carrying out corrosion treatment on the expansion, and carrying out corrosion treatment by adopting a square convolution kernel: and traversing each pixel in the image, carrying out corrosion operation on each pixel to obtain a corrosion image, and connecting the texts together to form a rectangular area through corrosion.
And S130, carrying out contour detection on the processed image to obtain a position coordinate.
The present embodiment does not limit the manner of contour detection as long as the object of the present embodiment can be achieved. It can be understood that adjacent points after the expansion processing and the erosion processing are connected together to form a large area, and then a processed image is obtained, and at this time, each large area of the processed image can be found out through contour detection, the contour image in the processed image is composed of a series of points, adjacent points and points belong to a contour 'set', and continuous points form a whole. By contour detection, the position coordinates corresponding to the region with the reduced target region can be obtained.
Further, the contour detection is performed on the processed image to obtain a position coordinate, and the method includes: carrying out contour detection on the processed image to obtain a contour image; and acquiring a contour region within a preset threshold area range in the contour image, and determining the coordinate position of the contour region.
In this embodiment, according to the feature of the sliced text of the processed image, the small, similar, narrow and high outline is removed, a flat outline similar to the text is left, and the specific operation position is to select an outline region larger than a preset threshold area in the outline image.
And S140, inputting the position coordinates and the content information into a trainer so as to obtain a bill recognizer, and recognizing the bill scanning piece to be recognized by using the bill recognizer.
Inputting the position coordinates and the content information into a trainer, setting related parameters, and performing training to obtain the bill recognizer, wherein the number of the position coordinates and the corresponding content information is not limited in the embodiment, and may be 100, 1000, and 10000, as long as the purpose of the embodiment can be achieved, and the setting can be set by a user. After the bill recognizer is obtained, the bill recognizer can be used for recognizing the bill scanning piece to be recognized.
Further, inputting the position coordinates and the content information into a trainer so as to obtain the bill recognizer, comprising: inputting the position coordinates and the content information into a trainer; after training the trainer, obtaining an initial bill recognizer; judging whether the identification accuracy of the initial bill identifier on the test bill image is greater than a preset accuracy; and if so, obtaining the bill recognizer.
It can be understood that the initial bill recognizer is obtained by training the trainer according to the position coordinates and the content information, the initial bill recognizer can be used as the bill recognizer only when the recognition accuracy of the initial bill recognizer on the test bill image is greater than the preset accuracy, otherwise, the initial bill recognizer is retrained until the recognition accuracy is greater than the preset accuracy. The identification accuracy in practical application can be improved by setting the identification accuracy, and the identification precision is improved.
Further, inputting the position coordinates and the content information into a trainer, comprising: when the position coordinate is wrong, receiving the specified position coordinate; the specified position coordinates and content information are input to the trainer. In the embodiment, the program is adopted for automatic frame selection, namely, the coordinate position is obtained through an image processing mode, and then when the position coordinate is correct through manual verification, an AI trainer directly clicks the next target bill scanning piece, so that the time is greatly saved. And if the program framing position coordinate is wrong, manually framing by an AI trainer according to the actual situation to obtain the specified position coordinate.
By testing and using the method for automatically acquiring the position information, the labor can be greatly saved, and further the labor cost is saved. When the accuracy of the position coordinates provided by the embodiment is about 60%, that is, when the target bill scanning pieces are positioned in a large batch, the positioning is automatically completed by 60%, and only the wrong positioning needs to be manually specified, so that the workload can be saved by 60%. Of course, the present embodiment can improve the recognition accuracy, i.e. the accuracy, through training, when the accuracy reaches 90%, only 10% needs to be determined manually. Therefore, when the accuracy is the current percentage, the manpower of the percentage can be reduced, and the labor cost is saved.
Based on the technical scheme, the bill training image is obtained by cutting the target area of the target bill scanning piece, a small range is formulated in the complex bill image through cutting the target area, positioning is carried out under the background of small interference, the identification accuracy is improved, graying, self-adaptive threshold value binaryzation, expansion processing, corrosion processing and contour detection are carried out on the bill training image, the coordinate position is obtained, high-precision positioning is realized, and the problems of low efficiency and high cost of manual positioning in the related technology are solved through an automatic positioning mode.
The application provides a specific acquisition method of a bill identifier, which comprises the following steps:
1. since each target bill scanning element has the same size (if different, the target bill scanning elements can be scaled), target areas (x1, y1, w1 and h1) of the capital value of the bills can be configured in advance (the left upper left corner of the bill is taken as an origin, and x1, y1, w1 and h1 are respectively the abscissa of the upper left corner of the rectangle, the ordinate of the upper left corner of the rectangle, the width of the rectangle and the height of the rectangle). And obtaining a target bill scanning piece, and cutting a target area of the target bill scanning piece to obtain a bill training image.
2. And sequentially carrying out graying, self-adaptive threshold binarization, expansion processing and corrosion processing on the bill training image to obtain a processed image.
And 2-1, sequentially graying the bill training images to obtain grayed images. Referring to fig. 2, fig. 2 is a schematic view of a grayed image according to an embodiment of the present disclosure.
And 2-2, carrying out self-adaptive threshold value binarization on the gray level image to obtain a binarized image. The threshold values in the gray images are calculated by adopting an average value method, and the principle is as follows: traversing each pixel point in the image, wherein the threshold value T (x, y) of each pixel value is calculated according to the formula:
Figure BDA0002433333840000091
where b denotes a square block size centered on the current pixel value, which may be determined to be 25; p (i, j) represents the pixel value at the (i, j) position in the square block, and C represents the threshold offset amount, which can be determined to be 10. The specific method for adaptive threshold binarization may include: a BINARY ═ cv2.adaptive threshold (gray,255, cv2.adaptive _ threshold _ MEAN _ C, cv2. threshold _ BINARY,25, 10). Wherein, the input gray is a gray image, 255 is a maximum gray value, cv2.adaptive _ THRESH _ MEAN _ C is a MEAN value extraction method, cv2.THRESH _ BINARY represents binarization, 25 is an adjacent block size, and 10 is a threshold value reduced constant. The return value binary is the binarized image. Referring to fig. 3, fig. 3 is a schematic diagram of a binarized image according to an embodiment of the present disclosure.
And 2-3, performing expansion operation and corrosion operation on the binary image. It is understood that the first expansion operation, the etching operation, and the second expansion operation are sequentially performed in this application. The method mainly aims to segment independent image elements in the binary image and can remove independent small noise; connecting adjacent elements, merging text regions, performing a first expansion operation to remove less noise, and performing a second expansion operation to reserve a main region. Wherein the dilation operation is performed using dst _ partition (x, y) ═ max (src (x + x ', y + y')), where src (x + x ', y + y') denotes a square block expanded to (x ', y') centered on the current pixel point (x, y); max represents the maximum value of the pixel points in the square block. And (3) corrosion operation: dst _ anode (x, y) ═ min (src (x + x ', y + y')), where src (x + x ', y + y') denotes a square block that is expanded into (x ', y') centered around the current pixel point (x, y); and min represents the minimum value of pixel points in the square block. Referring to fig. 4-6, fig. 4 is a schematic view of an image after a first dilation operation according to an embodiment of the present disclosure, fig. 5 is a schematic view of an image after a erosion operation according to an embodiment of the present disclosure, and fig. 6 is a schematic view of an image after a second dilation operation according to an embodiment of the present disclosure. And the image after the second expansion operation is the processed image.
3. And carrying out contour detection on the processed image to obtain a position coordinate.
And detecting the contour of the processed image, wherein the specific code comprises constants, hierarchy, cv2.findContours (img, cv2.RETR _ TREE, cv2.CHAIN _ APPROX _ SIMP L E), wherein img is a binarized picture subjected to expansion and corrosion, cv2.RETR _ TREE is inner and outer contour detection, cv2.CHAIN _ APPROX _ SIMP L E is inflection point information only for storing the contour, return values constants are contour coordinate vectors and hierarchy is a contour number.
Specifically, carrying out contour detection on the processed image to obtain a contour image; and acquiring a contour region within a preset threshold area range in the contour image, and determining the coordinate position of the contour region. And acquiring a contour region within a preset threshold area range in the contour image to obtain a final contour image, and determining a coordinate position from the final contour image. The current coordinates (x2, y2, w2, h2) are combined with the target region (x1, x1, w1, h1) of the top slice to obtain the final position coordinates (x1+ x2, y1+ y2, w2, h2) (4 values are the abscissa of the top left corner of the box, the coordinate of the top left corner, the width of the box, and the height of the box), respectively. Fig. 7 is a schematic diagram of an outline image provided in an embodiment of the present application, and fig. 8 is a schematic diagram of a final outline image provided in the embodiment of the present application.
In the following, a bill identifying device provided in an embodiment of the present application is introduced, and the bill identifying device described below and the bill identifying method described above may be referred to in correspondence, and referring to fig. 9, fig. 9 is a schematic structural diagram of a bill identifying device provided in an embodiment of the present application, and includes:
the cutting module 910 is configured to obtain a target bill scanned piece, and cut a target area of the target bill scanned piece to obtain a bill training image;
a processed image obtaining module 920, configured to perform graying, adaptive threshold binarization, expansion processing, and corrosion processing on the ticket training image in sequence to obtain a processed image;
a contour detection module 930, configured to perform contour detection on the processed image to obtain a position coordinate;
and a bill recognizer obtaining and recognizing module 940 for inputting the position coordinates and the content information into the trainer so as to obtain the bill recognizer, and recognizing the bill scanned piece to be recognized by using the bill recognizer.
In some specific embodiments, the clipping module 910 includes:
the target bill scanning piece obtaining unit is used for obtaining a target bill scanning piece;
the target area determining unit is used for receiving the bill type information and determining a target area according to the bill type information;
and the cutting unit is used for cutting the target area of the target bill scanning piece to obtain a bill training image.
In some specific embodiments, the contour detection module 930 includes:
the contour image acquisition unit is used for carrying out contour detection on the processed image to obtain a contour image;
and the coordinate position determining unit is used for acquiring the contour region in the contour image within the preset threshold area range and determining the coordinate position of the contour region.
In some embodiments, the ticket identifier acquisition and identification module 940 includes:
an input unit for inputting the position coordinates and the content information into the trainer;
the initial bill recognizer determining unit is used for obtaining an initial bill recognizer after the trainer is trained;
the judging unit is used for judging whether the identification accuracy of the initial bill recognizer on the test bill image is greater than the preset accuracy;
and the bill recognizer obtaining unit is used for obtaining the bill recognizer if the bill recognizer is obtained.
In some embodiments, the ticket identifier acquisition and identification module 940 includes:
an acquisition unit configured to receive a specified position coordinate when the position coordinate is erroneous;
and the input unit is used for inputting the specified position coordinates and the content information into the trainer.
Since the embodiments of the apparatus portion and the method portion correspond to each other, please refer to the description of the embodiments of the method portion for the embodiments of the apparatus portion, which is not repeated here.
In the following, an electronic device provided by an embodiment of the present application is introduced, and the electronic device described below and the ticket identification method described above may be referred to correspondingly.
The present embodiment provides an electronic device, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of the bill identification method when executing the computer program.
Since the embodiment of the electronic device portion corresponds to the embodiment of the ticket identification method portion, please refer to the description of the embodiment of the ticket identification method portion for the embodiment of the electronic device portion, which is not repeated here.
The following describes a computer-readable storage medium provided by embodiments of the present application, and the computer-readable storage medium described below and the method described above may be referred to correspondingly.
The present embodiment provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the above-mentioned bill identifying method.
Since the embodiment of the computer-readable storage medium portion and the embodiment of the method portion correspond to each other, please refer to the description of the embodiment of the method portion for the embodiment of the computer-readable storage medium portion, which is not repeated here.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.

Claims (10)

1. A method of bill identification, comprising:
acquiring a target bill scanning piece, and cutting a target area of the target bill scanning piece to obtain a bill training image;
sequentially carrying out graying, self-adaptive threshold binarization, expansion processing and corrosion processing on the bill training image to obtain a processed image;
carrying out contour detection on the processed image to obtain a position coordinate;
and inputting the position coordinates and the content information into a trainer so as to obtain a bill recognizer, and recognizing the bill scanning piece to be recognized by using the bill recognizer.
2. The document identification method of claim 1, wherein the obtaining of the target document scanning piece and the cropping of the target area of the target document scanning piece to obtain the document training image comprises:
acquiring the target bill scanning piece;
receiving bill type information, and determining the target area according to the bill type information;
and cutting the target area of the target bill scanning piece to obtain the bill training image.
3. The bill identifying method according to claim 1, wherein the performing contour detection on the processed image to obtain position coordinates comprises:
carrying out contour detection on the processed image to obtain a contour image;
and acquiring a contour region in the contour image within a preset threshold area range, and determining the coordinate position of the contour region.
4. The bill identifying method according to claim 1, wherein said inputting the position coordinates and the content information into a trainer to obtain a bill identifier comprises:
inputting the position coordinates and the content information into the trainer;
after the trainer is trained, an initial bill recognizer is obtained;
judging whether the identification accuracy of the initial bill identifier to the test bill image is greater than a preset accuracy;
and if so, obtaining the bill recognizer.
5. The bill identifying method according to claim 1, wherein the inputting the position coordinates and the content information into a trainer comprises:
when the position coordinate is wrong, receiving the specified position coordinate;
inputting the specified position coordinates and the content information into the trainer.
6. A bill identifying apparatus, comprising:
the cutting module is used for obtaining a target bill scanning piece and cutting a target area of the target bill scanning piece to obtain a bill training image;
the processed image obtaining module is used for sequentially carrying out graying, adaptive threshold binarization, expansion processing and corrosion processing on the bill training image to obtain a processed image;
the contour detection module is used for carrying out contour detection on the processed image to obtain a position coordinate;
and the bill recognizer obtaining and recognizing module is used for inputting the position coordinates and the content information into the trainer so as to obtain the bill recognizer, and recognizing the bill scanning piece to be recognized by utilizing the bill recognizer.
7. The document identifying device of claim 6, wherein the cropping module comprises:
the target bill scanning piece obtaining unit is used for obtaining the target bill scanning piece;
the target area determining unit is used for receiving the bill type information and determining the target area according to the bill type information;
and the cutting unit is used for cutting the target area of the target bill scanning piece to obtain the bill training image.
8. The document identifying apparatus according to claim 6, wherein the contour detection module comprises:
the contour image acquisition unit is used for carrying out contour detection on the processed image to obtain a contour image;
and the coordinate position determining unit is used for acquiring a contour region in the contour image within a preset threshold area range and determining the coordinate position of the contour region.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the ticket identification method of any one of claims 1 to 5 when executing said computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the ticket identification method according to one of the claims 1 to 5.
CN202010243502.2A 2020-03-31 2020-03-31 Bill identification method and device, electronic equipment and storage medium Active CN111461100B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010243502.2A CN111461100B (en) 2020-03-31 2020-03-31 Bill identification method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010243502.2A CN111461100B (en) 2020-03-31 2020-03-31 Bill identification method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111461100A true CN111461100A (en) 2020-07-28
CN111461100B CN111461100B (en) 2023-04-28

Family

ID=71682200

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010243502.2A Active CN111461100B (en) 2020-03-31 2020-03-31 Bill identification method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111461100B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111898605A (en) * 2020-08-28 2020-11-06 四川长虹网络科技有限责任公司 Set top box information detection method and system based on image OCR recognition
CN111967395A (en) * 2020-08-18 2020-11-20 中国银行股份有限公司 Bank bill identification method and device
CN113177607A (en) * 2021-05-21 2021-07-27 浙江大华技术股份有限公司 Method for labeling training object and client
CN113255657A (en) * 2020-12-31 2021-08-13 深圳怡化电脑股份有限公司 Method and device for detecting scratch on surface of bill, electronic equipment and machine-readable medium
CN114359928A (en) * 2022-01-12 2022-04-15 平安科技(深圳)有限公司 Electronic invoice identification method and device, computer equipment and storage medium
WO2022236875A1 (en) * 2021-05-14 2022-11-17 广州广电运通金融电子股份有限公司 File scanning method, device, medium and product

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003233773A (en) * 2002-02-07 2003-08-22 Hitachi Ltd Image registeration device and software provided with image registeration function
WO2007070010A1 (en) * 2005-12-16 2007-06-21 Agency For Science, Technology And Research Improvements in electronic document analysis
CN103208004A (en) * 2013-03-15 2013-07-17 北京英迈杰科技有限公司 Automatic recognition and extraction method and device for bill information area
CN107506746A (en) * 2017-09-08 2017-12-22 电子科技大学中山学院 Locating point-free image identification method and system for intelligent marking system
CN108446621A (en) * 2018-03-14 2018-08-24 平安科技(深圳)有限公司 Bank slip recognition method, server and computer readable storage medium
CN109190594A (en) * 2018-09-21 2019-01-11 广东蔚海数问大数据科技有限公司 Optical Character Recognition system and information extracting method
CN109255300A (en) * 2018-08-14 2019-01-22 中国平安财产保险股份有限公司 Billing information extracting method, device, computer equipment and storage medium
CN110263694A (en) * 2019-06-13 2019-09-20 泰康保险集团股份有限公司 A kind of bank slip recognition method and device
CN110298376A (en) * 2019-05-16 2019-10-01 西安电子科技大学 A kind of bank money image classification method based on improvement B-CNN
CN110333813A (en) * 2019-05-30 2019-10-15 平安科技(深圳)有限公司 Method, electronic device and the computer readable storage medium of invoice picture presentation
CN110569846A (en) * 2019-09-16 2019-12-13 北京百度网讯科技有限公司 Image character recognition method, device, equipment and storage medium
CN110598686A (en) * 2019-09-17 2019-12-20 携程计算机技术(上海)有限公司 Invoice identification method, system, electronic equipment and medium
CN110647829A (en) * 2019-09-12 2020-01-03 全球能源互联网研究院有限公司 Bill text recognition method and system
CN110781885A (en) * 2019-10-24 2020-02-11 泰康保险集团股份有限公司 Text detection method, device, medium and electronic equipment based on image processing

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003233773A (en) * 2002-02-07 2003-08-22 Hitachi Ltd Image registeration device and software provided with image registeration function
WO2007070010A1 (en) * 2005-12-16 2007-06-21 Agency For Science, Technology And Research Improvements in electronic document analysis
CN103208004A (en) * 2013-03-15 2013-07-17 北京英迈杰科技有限公司 Automatic recognition and extraction method and device for bill information area
CN107506746A (en) * 2017-09-08 2017-12-22 电子科技大学中山学院 Locating point-free image identification method and system for intelligent marking system
CN108446621A (en) * 2018-03-14 2018-08-24 平安科技(深圳)有限公司 Bank slip recognition method, server and computer readable storage medium
CN109255300A (en) * 2018-08-14 2019-01-22 中国平安财产保险股份有限公司 Billing information extracting method, device, computer equipment and storage medium
CN109190594A (en) * 2018-09-21 2019-01-11 广东蔚海数问大数据科技有限公司 Optical Character Recognition system and information extracting method
CN110298376A (en) * 2019-05-16 2019-10-01 西安电子科技大学 A kind of bank money image classification method based on improvement B-CNN
CN110333813A (en) * 2019-05-30 2019-10-15 平安科技(深圳)有限公司 Method, electronic device and the computer readable storage medium of invoice picture presentation
CN110263694A (en) * 2019-06-13 2019-09-20 泰康保险集团股份有限公司 A kind of bank slip recognition method and device
CN110647829A (en) * 2019-09-12 2020-01-03 全球能源互联网研究院有限公司 Bill text recognition method and system
CN110569846A (en) * 2019-09-16 2019-12-13 北京百度网讯科技有限公司 Image character recognition method, device, equipment and storage medium
CN110598686A (en) * 2019-09-17 2019-12-20 携程计算机技术(上海)有限公司 Invoice identification method, system, electronic equipment and medium
CN110781885A (en) * 2019-10-24 2020-02-11 泰康保险集团股份有限公司 Text detection method, device, medium and electronic equipment based on image processing

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
汤雷雷: "基于深度学习的税务票据自动识别系统的研究及实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
赵丽艳等: "一个后督支票处理系统", 《微计算机信息》 *
陈炜: "基于图像分析的第二代身份证字符识别技术研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111967395A (en) * 2020-08-18 2020-11-20 中国银行股份有限公司 Bank bill identification method and device
CN111898605A (en) * 2020-08-28 2020-11-06 四川长虹网络科技有限责任公司 Set top box information detection method and system based on image OCR recognition
CN113255657A (en) * 2020-12-31 2021-08-13 深圳怡化电脑股份有限公司 Method and device for detecting scratch on surface of bill, electronic equipment and machine-readable medium
CN113255657B (en) * 2020-12-31 2024-04-05 深圳怡化电脑股份有限公司 Method and device for detecting scratch on bill surface, electronic equipment and machine-readable medium
WO2022236875A1 (en) * 2021-05-14 2022-11-17 广州广电运通金融电子股份有限公司 File scanning method, device, medium and product
CN113177607A (en) * 2021-05-21 2021-07-27 浙江大华技术股份有限公司 Method for labeling training object and client
CN113177607B (en) * 2021-05-21 2023-01-31 浙江大华技术股份有限公司 Method for labeling training object and client
CN114359928A (en) * 2022-01-12 2022-04-15 平安科技(深圳)有限公司 Electronic invoice identification method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111461100B (en) 2023-04-28

Similar Documents

Publication Publication Date Title
CN111461100B (en) Bill identification method and device, electronic equipment and storage medium
CN107220640B (en) Character recognition method, character recognition device, computer equipment and computer-readable storage medium
CN110119741B (en) Card image information identification method with background
CN112183038A (en) Form identification and typing method, computer equipment and computer readable storage medium
CN110210440B (en) Table image layout analysis method and system
CN111737478B (en) Text detection method, electronic device and computer readable medium
CN110647795A (en) Form recognition method
CN111626249B (en) Method and device for identifying geometric figure in topic image and computer storage medium
CN112307919B (en) Improved YOLOv 3-based digital information area identification method in document image
CN107977658B (en) Image character area identification method, television and readable storage medium
CN114926839A (en) Image identification method based on RPA and AI and electronic equipment
CN112507782A (en) Text image recognition method and device
CN111582000A (en) Bar code positioning method and device and related equipment
CN110119742A (en) A kind of recognition methods of container number, device and mobile terminal
CN111915635A (en) Test question analysis information generation method and system supporting self-examination paper marking
CN109741273A (en) A kind of mobile phone photograph low-quality images automatically process and methods of marking
US6694059B1 (en) Robustness enhancement and evaluation of image information extraction
CN111445402A (en) Image denoising method and device
CN113743360B (en) Intelligent seal analysis method and device
CN107330470B (en) Method and device for identifying picture
CN115984211A (en) Visual positioning method, robot and storage medium
CN114267035A (en) Document image processing method and system, electronic device and readable medium
CN113505784A (en) Automatic nail annotation analysis method and device, electronic equipment and storage medium
CN113255657B (en) Method and device for detecting scratch on bill surface, electronic equipment and machine-readable medium
CN107392205B (en) Code value table generation method and device of remote controller

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