CN111461100B - 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
CN111461100B
CN111461100B CN202010243502.2A CN202010243502A CN111461100B CN 111461100 B CN111461100 B CN 111461100B CN 202010243502 A CN202010243502 A CN 202010243502A CN 111461100 B CN111461100 B CN 111461100B
Authority
CN
China
Prior art keywords
bill
image
target
identifier
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.)
Active
Application number
CN202010243502.2A
Other languages
Chinese (zh)
Other versions
CN111461100A (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 treatment and corrosion treatment on the bill training image to obtain a treated image; performing 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 identifier, and identifying the bill scanning piece to be identified by using the bill identifier. According to the method and the device, the target area of the target bill scanning piece is cut, the bill training image is obtained, a small range is formulated in the complex bill image through cutting the target area, positioning is performed under a background with small interference, and the identification accuracy is improved. The application also provides a bill identification device, electronic equipment and a computer readable storage medium, which 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 identifying method, a bill identifying device, an electronic device, and a computer readable storage medium.
Background
OCR recognition has a great demand in banking industry, and along with development of artificial intelligence technology, OCR recognition accuracy of various notes of a bank is greatly improved, but as with other artificial intelligence technologies, to achieve higher accuracy, a great deal of training must be performed on notes to be recognized.
The current general training method generally comprises the following steps of: manually framing a position to be identified; inputting field contents in the box selection position; and importing the position coordinates and the content selected by all training sample frames into a machine learning system for training modeling. However, the field content of the bill can be directly exported from the system, but the frame selection position is marked only by manpower, so that the time is very long, and the frame selection influences the recognition rate and has higher precision requirement, so that the frame selection efficiency is lower under the condition of ensuring the precision by adopting manual frame selection, and the labor cost is increased.
Therefore, how to provide a solution to the above technical problem is a problem that a person skilled in the art needs to solve at present.
Disclosure of Invention
The purpose of the application is to provide a bill identification method, a bill identification device, electronic equipment 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 treatment and corrosion treatment on the bill training image to obtain a treated image;
performing 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 identifier, and identifying the bill scanning piece to be identified by using the bill identifier.
Optionally, the acquiring the target bill scanning piece cuts a target area of the target bill scanning piece to obtain a bill training image, including:
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:
performing 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 to obtain a bill identifier includes:
inputting the position coordinates and the content information into the trainer;
after training the trainer, obtaining an initial bill identifier;
judging whether the identification accuracy of the initial bill identifier to the test bill image is greater than a preset accuracy;
if yes, the bill identifier is obtained.
Optionally, the inputting the position coordinates and the content information into a trainer includes:
receiving the specified position coordinates when the position coordinates are wrong;
the specified position coordinates and the content information are input to the trainer.
The application provides a bill recognition device, include:
the cutting module is used for acquiring a target bill scanning piece, cutting a target area of the target bill scanning piece and obtaining a bill training image;
the processed image obtaining module is used for sequentially carrying out graying, self-adaptive threshold binarization, expansion treatment and corrosion treatment 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 identifier acquisition and identification module is used for inputting the position coordinates and the content information into the trainer so as to obtain a bill identifier, and identifying the bill scanning piece to be identified by using the bill identifier.
Optionally, the clipping module includes:
the target bill scanning piece acquisition unit is used for acquiring the target bill scanning piece;
the target area determining unit is used for receiving 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 profile 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 the contour region in the contour image within a preset threshold area range and determining the coordinate position of the contour region.
Optionally, the bill identifier acquisition and identification module includes:
an input unit for inputting the position coordinates and the content information into the trainer;
the initial bill identifier determining unit is used for obtaining an initial bill identifier after training the trainer;
the judging unit is used for judging whether the identification accuracy of the initial bill identifier on the test bill image is greater than a preset accuracy;
and the bill identifier acquisition unit is used for acquiring the bill identifier if yes.
Optionally, the bill identifier acquisition and identification module includes:
an acquisition unit configured to receive the specified position coordinates when the position coordinates are wrong;
and an input unit configured to input the specified position coordinates and the content information into the trainer.
The application provides an electronic device, comprising:
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 a ticket identification method 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 treatment and corrosion treatment on the bill training image to obtain a treated image; performing 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 identifier, and identifying the bill scanning piece to be identified by using the bill identifier.
Therefore, the method and the device have the advantages that 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 the target area, positioning is performed under a background with small interference, identification accuracy is improved, gray scale, self-adaptive threshold binarization, expansion processing, corrosion processing and contour detection are performed on the bill training image, the coordinate position is obtained, high-precision positioning is achieved, and the problems of low efficiency and high cost of positioning by manual work in the related technology are avoided through an automatic positioning mode.
The application also provides a bill identifying device, electronic equipment and a computer readable storage medium, which have the beneficial effects and are not described in detail herein.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings may be obtained according to the provided drawings without inventive effort to a person skilled in the art.
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 grayscale image according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a binarized image according to an embodiment of the present disclosure;
FIG. 4 is a schematic view of an image after a first expansion operation according to an embodiment of the present application;
FIG. 5 is a schematic illustration of an image after an etching operation provided in an embodiment of the present application;
FIG. 6 is a schematic illustration of an image after a second inflation operation according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a contour image according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of a final contour image according to 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
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of 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 apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The current general training method generally comprises the following steps of: manually framing a position to be identified; inputting field contents in the box selection position; and importing the position coordinates and the content selected by all training sample frames into a machine learning system for training modeling. However, the field content of the bill can be directly exported from the system, but the frame selection position is marked only by manpower, so that the time is very long, and the frame selection influences the recognition rate and has higher precision requirement, so that the frame selection efficiency is lower under the condition of ensuring the precision by adopting manual frame selection, and the labor cost is increased. Based on the above technical problems, the present embodiment provides a bill identifying method, referring specifically to fig. 1, fig. 1 is a flowchart of a bill identifying method provided in an embodiment of the present application, which specifically includes:
s110, acquiring a target bill scanning piece, and cutting a target area of the target bill scanning piece to obtain a bill training image.
In this embodiment, the size of the target bill scanning member is not limited, and in general, the sizes of all the target bill scanning members are identical, so that the coordinate information of the target areas of all the target bill scanning members are identical, and therefore, the bill training image can be obtained only by clipping according to the coordinate information.
Further, the step of acquiring the target bill scanning piece comprises the steps of acquiring 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 that all the target bill scanning pieces have the same size. Further, before the target bill scanning member is enlarged or reduced according to the ratio, the method may further include performing a rotation operation on the initial target bill scanning member.
Further, obtain the target bill scanning piece, tailor the target area of target bill scanning piece, obtain bill training image, include: 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 there are different areas to be defined by the target document scanning piece of different document type information, for example, the target area a1 is required for the document type information a; bill type information b, required target areas b1, b2; bill type information c, required target areas c1, c2, c3. Therefore, the association relationship of ticket type information-target area is preset in the present embodiment. 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 a preset operation, bill type information is obtained according to the bill type instruction, and the bill type information is matched with the association relationship between the bill type information and a target area to obtain the target area; in another implementation, receiving ticket type information and determining the target area based on the ticket type information includes: acquiring a target bill scanning piece, obtaining corresponding bill type information according to the mark information of the target bill scanning piece, and matching the bill type information with the association relation between the bill type information and a target area to obtain the target area; of course, there may be other modes, and the present embodiment is not limited thereto, 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, so that the method is applicable to various bills and has wider application range.
And S120, sequentially carrying out graying, self-adaptive threshold binarization, expansion treatment and corrosion treatment on the bill training image to obtain a treated image.
The gray level of each pixel point of the bill training image is calculated by a certain algorithm by using the rgb (red, green and blue) components of each pixel point of the bill training image, so that the image only contains brightness and no color information. r, g and b are three-channel color graphs, gray is a single-channel gray graph, and the gray processing formula is as follows: gray=b×0.114+g×0.587+r×0.299, a gray scale map is obtained.
The self-adaptive threshold binarization is carried out on the gray level image, the self-adaptive threshold binarization is to convert the image subjected to gray level processing into an image only containing two colors of black and white, no other gray level change exists between black and white images, the self-adaptive threshold operation does not need to determine a fixed threshold, and the self-adaptive threshold setting can be carried out on each pixel point through the local characteristic self-adaptive of the image according to a corresponding self-adaptive method, so as to obtain a binarized image. Performing expansion processing on the binarized image, and performing expansion processing by adopting a square convolution kernel: traversing each pixel in the image, performing expansion operation on each pixel to obtain an expanded image, wherein the convolution kernel is smaller and the convolution times are less in the expansion process, and compared with a binarized image, after the expansion process, some independent and smaller noise is removed, so that the purpose of filtering is achieved. Corrosion treatment is carried out on the expansion, and square convolution kernels are adopted for corrosion treatment: and traversing each pixel in the image, performing etching operation on each pixel to obtain an etched image, and connecting texts together through etching to form a rectangular area.
S130, performing contour detection on the processed image to obtain position coordinates.
The present embodiment is not limited to the form of contour detection, as long as the object of the present embodiment can be achieved. It will be appreciated that adjacent points after the expansion and corrosion processes are joined together to form a large area, and a processed image is obtained at this time, and each large area of the processed image can be found out by contour detection, and the contour image in the processed image is formed by a series of points, and the adjacent points and points belong to a contour "set" together, and the continuous points form a whole. And (3) obtaining the position coordinates corresponding to the reduced target area through contour detection.
Further, performing contour detection on the processed image to obtain a position coordinate, including: performing contour detection on the processed image to obtain a contour image; and acquiring a contour region in a preset threshold area range in the contour image, and determining the coordinate position of the contour region.
In this embodiment, according to the characteristics of the sliced text of the processed image, the contour with small area, similarity, narrow and high is removed, and a flat contour similar to the text is left, and the specific operation position will be the contour area larger than the preset threshold area in the contour image.
S140, inputting the position coordinates and the content information into a trainer so as to obtain a bill identifier, and identifying the bill scanning piece to be identified by using the bill identifier.
The position coordinates and the content information are input into the trainer, then the relevant parameters are set, and the bill identifier is obtained through training, wherein the number of the position coordinates and the corresponding content information is not limited, and the number can be 100, 1000 or 10000, so long as the aim of the embodiment can be achieved, and the user can set the bill identifier by himself. After the bill identifier is obtained, the bill identifier can be utilized to identify the bill scanning piece to be identified.
Further, inputting the position coordinates and the content information into a trainer to obtain a ticket identifier, comprising: inputting the position coordinates and the content information into a trainer; after training the trainer, obtaining an initial bill identifier; judging whether the identification accuracy of the initial bill identifier to the test bill image is greater than a preset accuracy; if yes, the bill identifier is obtained.
It can be understood that training of the trainer is performed according to the position coordinates and the content information to obtain the initial bill identifier, the initial bill identifier can be used as the bill identifier only when the identification accuracy of the initial bill identifier on the test bill image is larger than the preset accuracy, otherwise, the training is performed again until the identification accuracy is larger than the preset accuracy. The identification accuracy rate in practical application can be improved by setting the identification accuracy rate, and the identification accuracy is improved.
Further, inputting the position coordinates and the content information into the trainer, comprising: when the position coordinates are wrong, receiving the appointed position coordinates; the specified position coordinates and content information are input into the trainer. The coordinate position is obtained by adopting automatic frame selection of the program, namely by an image processing mode, and when the position coordinate is correct by manual verification, the AI trainer directly clicks the next target bill scanning piece, so that the time is greatly saved. If the program box selection position coordinates are wrong, the AI trainer manually boxes and selects the appointed position coordinates according to the actual situation.
Through the method for automatically acquiring the position information through the test, labor can be greatly saved, and labor cost is further 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, 60% of the positions are automatically finished, and only the wrong positions need to be manually specified, so that the workload of 60% can be saved. Of course, the present embodiment can improve the recognition accuracy, i.e., the accuracy by training, and when the accuracy reaches 90%, only 10% needs to be manually determined. Therefore, when the accuracy is the current percentage, the labor of the percentage can be reduced, and the labor cost is saved.
Based on the above technical scheme, according to the embodiment, the target area of the target bill scanning piece is cut to obtain the bill training image, a small range is formulated in the complex bill image through cutting the target area, positioning is performed under a background with small interference, the identification accuracy is improved, and then the bill training image is subjected to graying, self-adaptive threshold binarization, expansion processing, corrosion processing and contour detection to obtain the coordinate position, so that the high-precision positioning is realized, and the problems of low efficiency and high cost of positioning by manpower in the related technology are avoided through an automatic positioning mode.
The application provides a specific bill identifier acquisition method, which comprises the following steps:
1. since each target bill scan piece is the same size (if not the same can be scaled), the target areas (x 1, y1, w1, h 1) of the bill capital amount can be configured in advance (with the upper left corner of the bill as the origin, x1, y1, w1, h1 are respectively the upper left corner abscissa of the rectangle, the upper left corner ordinate of the rectangle, the rectangular width, the rectangular height). And acquiring a target bill scanning piece, and cutting a target area of the target bill scanning piece to obtain a bill training image.
2. And (3) sequentially carrying out graying, self-adaptive threshold binarization, expansion treatment and corrosion treatment on the bill training image to obtain a treated image.
And 2-1, sequentially graying the bill training images to obtain graying images. Referring to fig. 2, fig. 2 is a schematic diagram of a graying image according to an embodiment of the present application.
2-2, performing self-adaptive threshold binarization on the gray level image to obtain a binarized image. The threshold values in the gray image are calculated by adopting a mean value method, and the principle is as follows: traversing each pixel point in the image, and calculating a threshold value T (x, y) of each pixel value according to the formula:
Figure BDA0002433333840000091
where b represents a square block size centered on the current pixel value, which can be determined to be 25; p (i, j) represents a pixel value at a (i, j) position in the square block, and C represents a threshold shift amount, which can be determined to be 10. The specific method for performing the adaptive threshold binarization can comprise the following steps: binary=cv2.adaptation threshold (gray, 255, cv2.adapt_thresh_mean_c, cv2.thresh_binary,25, 10). Wherein, input gray is gray image, 255 is maximum gray value, cv2.ADAPTIVE_THRESH_MEAN_C is MEAN extraction method, cv2.THRESH_BINARY is binarization, 25 is adjacent block size, and 10 is threshold value reduced constant. The return value bin is a binarized image. Referring to fig. 3, fig. 3 is a schematic diagram of a binary image according to an embodiment of the present application.
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 is mainly used for dividing independent image elements in the binarized image, and independent small noise points can be removed; adjacent elements are connected, text areas are merged, the first expansion operation is to remove smaller noise, and the second expansion operation is to reserve main areas. Wherein the expansion operation is performed using dst_scale (x, y) =max (src (x+x ', y+y')), src (x+x ', y+y') representing a square block extending to (x ', y') centered on the current pixel point (x, y); max represents taking the maximum value of the pixel points in the square block. And (3) corrosion operation: dst_error (x, y) =min (src (x+x ', y+y')), where src (x+x ', y+y') represents a square block that is extended to (x ', y') centered on the current pixel point (x, y); min represents the minimum value of the pixel points in the square block. Referring to fig. 4 to fig. 6, fig. 4 is a schematic diagram of an image after a first expansion operation provided in an embodiment of the present application, fig. 5 is a schematic diagram of an image after a corrosion operation provided in an embodiment of the present application, and fig. 6 is a schematic diagram of an image after a second expansion operation provided in an embodiment of the present application. The image after the second expansion operation is the processed image.
3. And performing contour detection on the processed image to obtain a position coordinate.
Contour detection is carried out on the processed image, and specific codes comprise: conneurs, hierarchy=cv2.findcontours (img, cv2.retr_tree, cv2.chan_approx_simple). Wherein img is a binarized picture subjected to expansion and corrosion, cv2.RETR_TREE is internal and external contour detection, and cv2.CHAIN_APPROX_SIMPLE is inflection point information for only preserving contours. The return value contours is the contour coordinate vector and hierarchy is the contour number.
Specifically, contour detection is carried out on the processed image to obtain a contour image; and acquiring a contour region in a preset threshold area range in the contour image, and determining the coordinate position of the contour region. And acquiring a contour region in a preset threshold area range in the contour image, obtaining a final contour image, and determining a coordinate position from the final contour image. The current coordinates (x 2, y2, w2, h 2) are combined with the object region (x 1, x1, w1, h 1) of the upper slice to obtain final position coordinates (x1+x2, y1+y2, w2, h 2) (4 values are respectively the left upper corner abscissa, the left upper corner middle coordinate, the frame width and the frame height of the frame). Fig. 7 is a schematic diagram of a contour image provided in an embodiment of the present application, and fig. 8 is a schematic diagram of a final contour image provided in an embodiment of the present application.
The following describes a bill identifying device provided in the embodiment of the present application, and the bill identifying device described below and the bill identifying method described above may be referred to correspondingly, and referring to fig. 9, fig. 9 is a schematic structural diagram of the bill identifying device provided in the embodiment of the present application, including:
the clipping module 910 is configured to obtain a target bill scanning piece, clip a target area of the target bill scanning piece, and obtain a bill training image;
the processed image obtaining module 920 is configured to sequentially perform graying, adaptive threshold binarization, expansion processing, and corrosion processing on the ticket training image, to obtain a processed image;
the contour detection module 930 is configured to perform contour detection on the processed image to obtain a position coordinate;
the bill identifier acquisition and identification module 940 is configured to input the position coordinates and the content information into the trainer, so as to obtain a bill identifier, and identify the bill scanning piece to be identified by using the bill identifier.
In some particular embodiments, the clipping module 910 includes:
the target bill scanning piece acquisition unit is used for acquiring the 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 bill training images.
In some particular 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 range of the preset threshold area in the contour image and determining the coordinate position of the contour region.
In some particular embodiments, 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 identifier determining unit is used for obtaining an initial bill identifier after training the trainer;
the judging unit is used for judging whether the identification accuracy of the initial bill identifier to the test bill image is greater than the preset accuracy;
and the bill identifier acquisition unit is used for acquiring the bill identifier if yes.
In some particular embodiments, ticket identifier acquisition and identification module 940 includes:
an acquisition unit configured to receive a specified position coordinate when the position coordinate is wrong;
and an input unit for inputting the specified position coordinates and content information into the trainer.
Since the embodiments of the apparatus portion and the embodiments of the method portion correspond to each other, the embodiments of the apparatus portion are referred to the description of the embodiments of the method portion, and are not repeated herein.
The following describes an electronic device provided in an embodiment of the present application, where the electronic device described below and the bill identifying method described above may be referred to correspondingly.
The present embodiment provides an electronic device including:
a memory for storing a computer program;
and a processor for implementing the steps of the bill identifying method as described above when executing the computer program.
Since the embodiment of the electronic device part corresponds to the embodiment of the bill identifying method part, the embodiment of the electronic device part is referred to the description of the embodiment of the bill identifying method part, and is not repeated herein.
A computer readable storage medium provided in the embodiments of the present application is described below, 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 executed by a processor implements the steps of the ticket identification method as described above.
Since the embodiments of the computer readable storage medium portion and the embodiments of the method portion correspond to each other, the embodiments of the computer readable storage medium portion are referred to the description of the embodiments of the method portion, and are not repeated herein.
In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
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 elements and steps are described above generally in terms of functionality in order to clearly illustrate the 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 solution. 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. The software modules may be disposed 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.
Specific examples are set forth herein to illustrate the principles and embodiments of the present application, and the description of the examples above is only intended to assist in understanding the methods of the present application and their core ideas. It should be noted that it would be obvious to those skilled in the art that various improvements and modifications can be made to the present application without departing from the principles of the present application, and such improvements and modifications fall within the scope of the claims of the present application.

Claims (7)

1. A ticket identification method, 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 treatment and corrosion treatment on the bill training image to obtain a treated image;
performing contour detection on the processed image to obtain a position coordinate;
inputting the position coordinates and the content information into a trainer so as to obtain a bill identifier, and identifying a bill scanning piece to be identified by using the bill identifier;
correspondingly, the performing contour detection on the processed image to obtain a position coordinate includes:
performing contour detection on the processed image to obtain a contour image;
acquiring a contour region in the contour image within a preset threshold area range, and determining the coordinate position of the contour region;
correspondingly, the step of inputting the position coordinates and the content information into a trainer so as to obtain a bill identifier, and the step of identifying the bill scanning piece to be identified by using the bill identifier comprises the following steps:
inputting the position coordinates and the content information into the trainer;
after training the trainer, obtaining an initial bill identifier;
judging whether the identification accuracy of the initial bill identifier to the test bill image is greater than a preset accuracy;
if yes, the bill identifier is obtained.
2. The bill identifying method according to claim 1, wherein the acquiring the target bill scanning member cuts a target area of the target bill scanning member to obtain a bill training image, comprising:
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 ticket identification method as claimed in claim 1, wherein said inputting the position coordinates and the content information into a trainer comprises:
receiving the specified position coordinates when the position coordinates are wrong;
the specified position coordinates and the content information are input to the trainer.
4. A bill identifying device, characterized by comprising:
the cutting module is used for acquiring a target bill scanning piece, cutting a target area of the target bill scanning piece and obtaining a bill training image;
the processed image obtaining module is used for sequentially carrying out graying, self-adaptive threshold binarization, expansion treatment and corrosion treatment 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;
the bill identifier acquisition and identification module is used for inputting the position coordinates and the content information into the trainer so as to obtain a bill identifier, and identifying a bill scanning piece to be identified by using the bill identifier;
correspondingly, 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;
a coordinate position determining unit, configured to obtain a contour region in a preset threshold area range in the contour image, and determine the coordinate position of the contour region;
correspondingly, the bill identifier acquisition and identification module comprises:
an input unit for inputting the position coordinates and the content information into the trainer;
the initial bill identifier determining unit is used for obtaining an initial bill identifier after training the trainer;
the judging unit is used for judging whether the identification accuracy of the initial bill identifier to the test bill image is greater than the preset accuracy;
and the bill identifier acquisition unit is used for acquiring the bill identifier if yes.
5. The ticket identification apparatus of claim 4 wherein said clipping module comprises:
the target bill scanning piece acquisition unit is used for acquiring the target bill scanning piece;
the target area determining unit is used for receiving 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.
6. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the ticket identification method as claimed in any one of claims 1 to 3 when said computer program is executed.
7. A computer readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, implements the steps of the ticket identification method according to any of claims 1 to 3.
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 CN111461100A (en) 2020-07-28
CN111461100B true 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)

Families Citing this family (6)

* 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
CN113255657B (en) * 2020-12-31 2024-04-05 深圳怡化电脑股份有限公司 Method and device for detecting scratch on bill surface, electronic equipment and machine-readable medium
CN113286053B (en) * 2021-05-14 2022-08-30 广州广电银通金融电子科技有限公司 File scanning method, equipment, medium and product
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

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107506746A (en) * 2017-09-08 2017-12-22 电子科技大学中山学院 Locating point-free image identification method and system for intelligent marking system

Family Cites Families (13)

* 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
CN108446621A (en) * 2018-03-14 2018-08-24 平安科技(深圳)有限公司 Bank slip recognition method, server and computer readable storage medium
CN109255300B (en) * 2018-08-14 2023-12-01 中国平安财产保险股份有限公司 Bill information extraction method, bill information extraction device, computer equipment and storage medium
CN109190594A (en) * 2018-09-21 2019-01-11 广东蔚海数问大数据科技有限公司 Optical Character Recognition system and information extracting method
CN110298376B (en) * 2019-05-16 2022-07-01 西安电子科技大学 Bank bill image classification method based on improved 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
CN110598686B (en) * 2019-09-17 2023-08-04 携程计算机技术(上海)有限公司 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

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107506746A (en) * 2017-09-08 2017-12-22 电子科技大学中山学院 Locating point-free image identification method and system for intelligent marking system

Also Published As

Publication number Publication date
CN111461100A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
CN111461100B (en) Bill identification method and device, electronic equipment and storage medium
US11580647B1 (en) Global and local binary pattern image crack segmentation method based on robot vision
CN110119741B (en) Card image information identification method with background
CN108090511B (en) Image classification method and device, electronic equipment and readable storage medium
CN111915704A (en) Apple hierarchical identification method based on deep learning
CN104866849A (en) Food nutrition label identification method based on mobile terminal
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
CN111680690A (en) Character recognition method and device
CN112651256A (en) Two-dimensional code identification method and device, computer equipment and storage medium
CN109741273A (en) A kind of mobile phone photograph low-quality images automatically process and methods of marking
CN110298835B (en) Leather surface damage detection method, system and related device
CN108877030B (en) Image processing method, device, terminal and computer readable storage medium
CN113591507A (en) Robust two-dimensional code DataMatrix positioning method and system
CN111445402B (en) Image denoising method and device
CN110175257B (en) Method for matching line manuscript images, electronic equipment and storage medium
CN113743360B (en) Intelligent seal analysis method and device
CN116503871A (en) Character segmentation preprocessing method, terminal device and computer readable storage medium
CN111753573B (en) Two-dimensional code image recognition method and device, electronic equipment and readable storage medium
CN114267002A (en) Working condition monitoring method, device and equipment for tobacco shred manufacturing workshop of cigarette factory and storage medium
CN114267035A (en) Document image processing method and system, electronic device and readable medium
CN112508024A (en) Intelligent identification method for embossed seal font of electrical nameplate of transformer
CN111931688A (en) Ship recognition method and device, computer equipment and storage medium
CN111476800A (en) Character region detection method and device based on morphological operation

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