WO2019200802A1 - 合同影像图片的识别方法、电子装置及可读存储介质 - Google Patents

合同影像图片的识别方法、电子装置及可读存储介质 Download PDF

Info

Publication number
WO2019200802A1
WO2019200802A1 PCT/CN2018/102216 CN2018102216W WO2019200802A1 WO 2019200802 A1 WO2019200802 A1 WO 2019200802A1 CN 2018102216 W CN2018102216 W CN 2018102216W WO 2019200802 A1 WO2019200802 A1 WO 2019200802A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
contract
contract image
identified
red component
Prior art date
Application number
PCT/CN2018/102216
Other languages
English (en)
French (fr)
Inventor
郑佳
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019200802A1 publication Critical patent/WO2019200802A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content
    • G06V30/412Layout analysis of documents structured with printed lines or input boxes, e.g. business forms or tables
    • 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/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

Definitions

  • the present application relates to the field of computer technology, and in particular, to a method for identifying a contract image, an electronic device, and a readable storage medium.
  • the existing contract image recognition schemes are generally based on the traditional OCR recognition technology to directly identify the original contract image images, and the non-pure text type contract has poor adaptability and low recognition rate.
  • the purpose of the present application is to provide a method for identifying a contract image, an electronic device, and a readable storage medium, which are intended to improve the recognition rate of a contract image.
  • a first aspect of the present application provides an electronic device, where the electronic device includes a memory and a processor, where the memory stores an identification system of a contract image image that can be run on the processor, The identification system of the contract image picture is implemented by the processor to implement the following steps:
  • the contract image image to be identified After receiving the contract image image to be identified, the contract image image to be identified is subjected to a preset de-processing;
  • OCR optical character recognition
  • the second aspect of the present application further provides a method for identifying a contract image image, where the method for identifying a contract image image includes:
  • the contract image image to be identified After receiving the contract image image to be identified, the contract image image to be identified is subjected to a preset de-processing;
  • the OCR recognition is performed on the contract image image after the red component is removed.
  • a third aspect of the present application further provides a computer readable storage medium, where the computer readable storage medium stores an identification system for a contract image, and the identification system of the contract image can be at least A processor executes the step of causing the at least one processor to perform the method of identifying a contract image as described above.
  • the method, system and readable storage medium for identifying a contract image image proposed by the present application after performing the decontamination processing on the contract image image to be identified, determining the contract image image after the decontamination processing by using a preset elliptical contour detection rule
  • the elliptical contour in the middle, and the determined elliptical contour as the red outline in the contract image, white balance the image in the outline of the red cap in the contract image, and remove the red component, the contract after removing the red component Image images are OCR recognized. Because it can detect the characteristics of the contract image, the red image is detected by the ellipse contour detection method, and the red component is removed from the red image in the contract image, and the OCR recognition is performed, which can better support the contract image. Accurate identification of the red chapter in the picture, thereby improving the OCR recognition adaptability of non-pure text type contracts, and effectively improving the recognition rate of contract images.
  • FIG. 1 is a schematic diagram of an operating environment of a preferred embodiment of a contract image image recognition system 10 of the present application;
  • FIG. 2 is a schematic flow chart of an embodiment of a method for identifying a contract image image according to the present application.
  • FIG. 1 is a schematic diagram of an operating environment of a preferred embodiment of the contract image image recognition system 10 of the present application.
  • the identification system 10 of the contract image is installed and operated in the electronic device 1.
  • the electronic device 1 may include, but is not limited to, a memory 11, a processor 12, and a display 13.
  • Figure 1 shows only the electronic device 1 with components 11-13, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the memory 11 is at least one type of readable computer storage medium, which in some embodiments may be an internal storage unit of the electronic device 1, such as a hard disk or memory of the electronic device 1.
  • the memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (SMC), and a secure digital device. (Secure Digital, SD) card, flash card, etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 is configured to store application software and various types of data installed in the electronic device 1, such as program codes of the identification system 10 of the contract video image.
  • the memory 11 can also be used to temporarily store data that has been output or is about to be output.
  • the processor 12 may be a central processing unit (CPU), a microprocessor or other data processing chip for running program code or processing data stored in the memory 11, for example An identification system 10 or the like that executes the contract image image.
  • CPU central processing unit
  • microprocessor or other data processing chip for running program code or processing data stored in the memory 11, for example An identification system 10 or the like that executes the contract image image.
  • the display 13 in some embodiments may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch sensor, or the like.
  • the display 13 is configured to display information processed in the electronic device 1 and a user interface for displaying visualization, such as a contract image image to be recognized, a red outline in the detected contract image image, and finally a contract image.
  • the components 11-13 of the electronic device 1 communicate with one another via a system bus.
  • the contract image picture identification system 10 includes at least one computer readable instruction stored in the memory 11, the at least one computer readable instruction being executable by the processor 12 to implement various embodiments of the present application.
  • the identification system 10 of the contract image picture described above is executed by the processor 12 to implement the following steps:
  • step S1 after receiving the contract image image to be identified, the contract image image to be identified is subjected to preset de-processing.
  • the electronic device receives an OCR identification request sent by the user and includes a contract image image to be identified, for example, receiving an OCR identification request sent by the user through a terminal such as a mobile phone, a tablet computer, or a self-service terminal device, such as receiving the user on the mobile phone, An OCR identification request sent from a pre-installed client in a terminal such as a tablet or a self-service terminal device, or an OCR identification request sent by a user on a browser system in a terminal such as a mobile phone, a tablet, or a self-service terminal device.
  • the contract image image to be identified is subjected to a preset de-processing, such as Gaussian blur processing on the contract image image to be recognized, to initially remove noise and noise in the contract image to be identified. interference.
  • a preset de-processing such as Gaussian blur processing on the contract image image to be recognized
  • step S2 the elliptical contour in the processed contract image image is determined according to a preset elliptical contour detection rule, and the determined elliptical contour is used as a red outline in the contract image.
  • the RGB red component concentration region in the contract image image after the deconvolution process is detected, and the detected RGB red component concentration region image is extracted and the elliptical contour detection is performed.
  • the specific steps are:
  • edge detection is performed on the extracted RGB red component concentrated area image to obtain a binarized edge contour map, and the point coordinates on the binarized edge contour map are stored in the preset array A.
  • Corresponding points on the image of the RGB red component concentration area are taken as the center of the ellipse, and the center of the ellipse is marked as (P, Q), and the maximum value among the maximum distances is found, and the maximum value is taken as the length of the ellipse long axis a .
  • the values of the parameters b and ⁇ are obtained, and the values of the parameters b and ⁇ are counted in a preset two-dimensional parameter space, and the statistical values of the parameters b and ⁇ are obtained, and the maximum value of the statistical values exceeds a preset threshold.
  • the parameters b and ⁇ are used as elliptical contour parameters, and the elliptical contour is established by the elliptical contour parameters b and ⁇ , and the established elliptical contour is used as the red outline in the contract image.
  • step S3 white balance processing is performed on the picture in the outline of the red chapter in the contract image picture, and the red component is removed.
  • step S4 OCR identification is performed on the contract image image after the red component is removed.
  • the elliptical contour in the processed contract image image is determined by a preset elliptical contour detection rule, and the determined elliptical contour is used as a contract.
  • the outline of the red chapter in the image picture performs white balance processing on the picture in the outline of the red chapter in the contract image picture, and removes the red component, and performs OCR recognition on the contract image picture after removing the red component. Because it can detect the characteristics of the contract image, the red image is detected by the ellipse contour detection method, and the red component is removed from the red image in the contract image, and the OCR recognition is performed, which can better support the contract image. Accurate identification of the red chapter in the picture, thereby improving the OCR recognition adaptability of non-pure text type contracts, and effectively improving the recognition rate of contract images.
  • the identification system 10 of the contract image image is executed by the processor 12 before the step S4 is implemented, and further includes:
  • the closed linear frame detected in the picture is independently extracted and tabulated; the small closed linear frame is detected in the largest closed straight line frame in the table, and the detected small closed straight line frame is used as a table.
  • Item processing For example, when it is detected that a small closed linear frame has a diagonal line, the content of the oblique line is subjected to block processing, that is, the content separated by the oblique line is subjected to block identification, and the direction check is performed, and the identified block is branched. Showcase to display text in its original format. Accordingly, the text content of each form item in the form is separately identified by the OCR, and the form text recognition in the contract image picture has been completed.
  • the paragraph text segmentation process When the paragraph text segmentation process is performed, the pixel feature is segmented into the text image, and the block of the block is further processed.
  • Detection and processing for special formats For example, for the preset position (such as the top end of the picture) to detect the header and footer, the title is identified by the difference of the line spacing, the red chapter is removed for the red chapter, and the red chapter is recognized. OCR recognition is performed separately for these special formats.
  • the pixel width and height value are detected, and the part where the pixel height is smaller (below a certain threshold) causes the pixel block pixel volume to be interpolated to increase the pixel resolution. Rate, improve subsequent recognition accuracy.
  • the text blocks in the interpolated image are segmented, and the different text fields of the segmentation are respectively OCR identified. Finally, the text fields identified by the block are assembled according to the original text block position.
  • the OCR recognizes the text in the special format and the segmented text in other pictures, and then integrates the form text recognition, the recognition result of the entire contract image picture can be finally obtained.
  • the OCR recognition of the contract image is comprehensively supported, which can better support the accurate identification of the red chapter and the form in the contract image.
  • the present embodiment has better adaptability to the OCR recognition of the non-pure text type contract, and can effectively improve the OCR recognition rate of the contract image picture.
  • the method when the identification system 10 of the contract image image is executed by the processor 12 to implement the step S1, the method further includes:
  • Gaussian blur processing is performed on the contract image image to be identified
  • a gray histogram of the contract image image after Gaussian blurring is established, and the part of the preset gray value pixel is distributed into a patch-like image according to the gray histogram, and the background image in the contract image is removed, and the contract image is removed.
  • the background portion of the image is used to remove the interference from the background portion of the contract image to the recognition of the text portion of the contract image.
  • the contract image image may be preprocessed, such as Gaussian blur processing of the contract image image to be recognized, to initially remove noise and noise interference in the contract image to be identified.
  • Gaussian Blur also known as Gaussian Smoothing, adjusts the pixel color value according to the Gaussian curve to selectively blur the image, thereby reducing image noise and reducing the level of detail. It also detects the background and text of the contract image and removes the background portion of the contract image. Specifically, a gray histogram of the contract image image can be established, and the peak of the picture in the low gray area and the peak of the high gray area are the picture background and the text color.
  • the contract image image may be corrected, and the pre-processed contract image image is expanded, that is, pixels are added to the edge of the object in the image to blur the text details in the contract image image, and at the same time add text.
  • the pixel size For example, an expansion algorithm is as follows: each pixel of an image is scanned with a 3*3 structural element, and an AND operation is performed with the binary image covered by the structural element. If both are 0, the pixel of the resulting image is 0. , otherwise it is 1. The effect of the expansion algorithm is to enlarge the binary image by one revolution.
  • Perform text area detection on the expanded contract image image Specifically, the outermost edge detection is performed on the area of the text in the contract image image subjected to the expansion processing, and the straight edge is connected to obtain a rectangular or parallelogram or trapezoidal outer frame.
  • the outer frame of the rectangle is a text box in a normal state, and the outer frame of the parallelogram or the trapezoid may not be squared when scanning into a contract image, and the angle of the text in the contract image is not correct, and the parallelogram is required.
  • the trapezoidal frame picture is subjected to affine transformation correction processing to align the text in the contract image picture, so that the OCR recognition of the text in the contract image picture is more accurate.
  • the text direction of the contract image image corrected by the affine transformation can also be detected. Specifically, a horizontal line and a vertical line may be drawn every certain pixel in the contract image image corrected by the affine transformation to obtain a pixel value distribution curve of each line, when a certain type (such as horizontal or vertical) When there is a periodic background pixel in the curve, and the end or the beginning is a continuous background pixel, it is determined that the direction is the end of the paragraph, and the direction (such as horizontal or vertical) is determined to be the text direction. If there is only a periodic background pixel distribution in both the vertical direction and the horizontal direction, it is determined that the periodic interval is small as the text direction.
  • the detected text direction can be used for subsequent reference to OCR recognition of the text in the contract image.
  • FIG. 2 is a schematic flowchart of an embodiment of a method for identifying a contract image image according to the present application.
  • the method for identifying a contract image image includes the following steps:
  • Step S10 After receiving the contract image image to be identified, the contract image image to be identified is subjected to a preset de-processing.
  • the electronic device receives an OCR identification request sent by the user and includes a contract image image to be identified, for example, receiving an OCR identification request sent by the user through a terminal such as a mobile phone, a tablet computer, or a self-service terminal device, such as receiving the user on the mobile phone, An OCR identification request sent from a pre-installed client in a terminal such as a tablet or a self-service terminal device, or an OCR identification request sent by a user on a browser system in a terminal such as a mobile phone, a tablet, or a self-service terminal device.
  • the contract image image to be identified is subjected to a preset de-processing, such as Gaussian blur processing on the contract image image to be recognized, to initially remove noise and noise in the contract image to be identified. interference.
  • a preset de-processing such as Gaussian blur processing on the contract image image to be recognized
  • Step S20 determining an elliptical contour in the processed contract image image according to a preset elliptical contour detection rule, and using the determined elliptical contour as a red outline in the contract image image.
  • the RGB red component concentration region in the contract image image after the deconvolution process is detected, and the detected RGB red component concentration region image is extracted and the elliptical contour detection is performed.
  • the specific steps are:
  • edge detection is performed on the extracted RGB red component concentrated area image, and a binarized edge contour map is obtained, and the point coordinates on the binarized edge contour map are stored in the preset array A.
  • Corresponding points on the image of the RGB red component concentration area are taken as the center of the ellipse, and the center of the ellipse is marked as (P, Q), and the maximum value among the maximum distances is found, and the maximum value is taken as the length of the ellipse long axis a .
  • the values of the parameters b and ⁇ are obtained, and the values of the parameters b and ⁇ are counted in a preset two-dimensional parameter space, and the statistical values of the parameters b and ⁇ are obtained, and the maximum value of the statistical values exceeds a preset threshold.
  • the parameters b and ⁇ are used as elliptical contour parameters, and the elliptical contour is established by the elliptical contour parameters b and ⁇ , and the established elliptical contour is used as the red outline in the contract image.
  • step S30 white balance processing is performed on the picture in the outline of the red chapter in the contract image picture, and the red component is removed.
  • step S40 OCR identification is performed on the contract image image after the red component is removed.
  • the elliptical contour in the processed contract image image is determined by a preset elliptical contour detection rule, and the determined elliptical contour is used as a contract.
  • the outline of the red chapter in the image picture performs white balance processing on the picture in the outline of the red chapter in the contract image picture, and removes the red component, and performs OCR recognition on the contract image picture after removing the red component. Because it can detect the characteristics of the contract image, the red image is detected by the ellipse contour detection method, and the red component is removed from the red image in the contract image, and the OCR recognition is performed, which can better support the contract image. Accurate identification of the red chapter in the picture, thereby improving the OCR recognition adaptability of non-pure text type contracts, and effectively improving the recognition rate of contract images.
  • the method before the step S40, the method further includes:
  • the closed linear frame detected in the picture is independently extracted and tabulated; the small closed linear frame is detected in the largest closed straight line frame in the table, and the detected small closed straight line frame is used as a table.
  • Item processing For example, when it is detected that a small closed linear frame has a diagonal line, the content of the oblique line is subjected to block processing, that is, the content separated by the oblique line is subjected to block identification, and the direction check is performed, and the identified block is branched. Showcase to display text in its original format. Accordingly, the text content of each form item in the form is separately identified by the OCR, and the form text recognition in the contract image picture has been completed.
  • the paragraph text segmentation process When the paragraph text segmentation process is performed, the pixel feature is segmented into the text image, and the block of the block is further processed.
  • Detection and processing for special formats For example, for the preset position (such as the top end of the picture) to detect the header and footer, the title is identified by the difference of the line spacing, the red chapter is removed for the red chapter, and the red chapter is recognized. OCR recognition is performed separately for these special formats.
  • the pixel width and height value are detected, and the part where the pixel height is smaller (below a certain threshold) causes the pixel block pixel volume to be interpolated to increase the pixel resolution. Rate, improve subsequent recognition accuracy.
  • the text blocks in the interpolated image are segmented, and the different text fields of the segmentation are respectively OCR identified. Finally, the text fields identified by the block are assembled according to the original text block position.
  • the OCR recognizes the text in the special format and the segmented text in other pictures, and then integrates the form text recognition, the recognition result of the entire contract image picture can be finally obtained.
  • the OCR recognition of the contract image is comprehensively supported, which can better support the accurate identification of the red chapter and the form in the contract image.
  • the present embodiment has better adaptability to the OCR recognition of the non-pure text type contract, and can effectively improve the OCR recognition rate of the contract image picture.
  • step S10 includes:
  • Gaussian blur processing is performed on the contract image image to be identified
  • a gray histogram of the contract image image after Gaussian blurring is established, and the part of the preset gray value pixel is distributed into a patch-like image according to the gray histogram, and the background image in the contract image is removed, and the contract image is removed.
  • the background portion of the image is used to remove the interference from the background portion of the contract image to the recognition of the text portion of the contract image.
  • the contract image image may be preprocessed, such as Gaussian blur processing of the contract image image to be recognized, to initially remove noise and noise interference in the contract image to be identified.
  • Gaussian Blur also known as Gaussian Smoothing, adjusts the pixel color value according to the Gaussian curve to selectively blur the image, thereby reducing image noise and reducing the level of detail. It also detects the background and text of the contract image and removes the background portion of the contract image. Specifically, a gray histogram of the contract image image can be established, and the peak of the picture in the low gray area and the peak of the high gray area are the picture background and the text color.
  • the contract image image may be corrected, and the pre-processed contract image image is expanded, that is, pixels are added to the edge of the object in the image to blur the text details in the contract image image, and at the same time add text.
  • the pixel size For example, an expansion algorithm is as follows: each pixel of an image is scanned with a 3*3 structural element, and an AND operation is performed with the binary image covered by the structural element. If both are 0, the pixel of the resulting image is 0. , otherwise it is 1. The effect of the expansion algorithm is to enlarge the binary image by one revolution.
  • the outer frame of the rectangle is a text box in a normal state, and the outer frame of the parallelogram or the trapezoid may not be squared when scanning into a contract image, and the angle of the text in the contract image is not correct, and the parallelogram is required.
  • the trapezoidal frame picture is subjected to affine transformation correction processing to align the text in the contract image picture, so that the OCR recognition of the text in the contract image picture is more accurate.
  • the text direction of the contract image image corrected by the affine transformation can also be detected. Specifically, a horizontal line and a vertical line may be drawn every certain pixel in the contract image image corrected by the affine transformation to obtain a pixel value distribution curve of each line, when a certain type (such as horizontal or vertical) When there is a periodic background pixel in the curve, and the end or the beginning is a continuous background pixel, it is determined that the direction is the end of the paragraph, and the direction (such as horizontal or vertical) is determined to be the text direction. If there is only a periodic background pixel distribution in both the vertical direction and the horizontal direction, it is determined that the periodic interval is small as the text direction.
  • the detected text direction can be used for subsequent reference to OCR recognition of the text in the contract image.
  • the present application further provides a computer readable storage medium storing an identification system of contract image images, the identification system of the contract image image being executable by at least one processor to enable the The at least one processor performs the steps of the method for recognizing the contract image in the above-mentioned embodiment, and the specific implementation processes of the steps S10, S20, and S30 of the method for identifying the contract image are as described above, and are not described herein again.
  • the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and can also be implemented by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Image Analysis (AREA)
  • Character Input (AREA)

Abstract

本申请涉及一种合同影像图片的识别方法、电子装置及可读存储介质,该方法包括:收到待识别的合同影像图片后,对待识别的合同影像图片进行预设的去躁处理;按预设的椭圆轮廓检测规则确定出经去躁处理后的合同影像图片中的椭圆轮廓,并将确定出的椭圆轮廓作为合同影像图片中的红章轮廓;对合同影像图片中红章轮廓内的图片进行白平衡处理,并去除红色分量;对去除红色分量后的合同影像图片进行OCR识别。本申请能够较好的支持合同影像图片中红章部分的准确识别,从而提高对非纯文字类型合同的OCR识别适应性,有效地提高合同影像图片的识别率。

Description

合同影像图片的识别方法、电子装置及可读存储介质
优先权申明
本申请基于巴黎公约申明享有2018年04月17日递交的申请号为CN 2018103436345、名称为“合同影像图片的识别方法、电子装置及可读存储介质”中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种合同影像图片的识别方法、电子装置及可读存储介质。
背景技术
在现有金融领域中,经常需要对合同影像图片进行识别以将合同影像图片中的信息进行提取并进行其中的内容分析。现有的合同影像图片识别方案一般都是基于传统的OCR识别技术对原始的合同影像图片直接进行识别,对非纯文字类型合同适应性较差,识别率较低。
发明内容
本申请的目的在于提供一种合同影像图片的识别方法、电子装置及可读存储介质,旨在提高合同影像图片的识别率。
为实现上述目的,本申请第一方面提供一种电子装置,所述电子装置包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的合同影像图片的识别系统,所述合同影像图片的识别系统被所述处理器执行时实现如下步骤:
收到待识别的合同影像图片后,对待识别的合同影像图片进行预设的去躁处理;
按预设的椭圆轮廓检测规则确定出经去躁处理后的合同影像图片中的椭圆轮廓,并将确定出的椭圆轮廓作为合同影像图片中的红章轮廓;
对合同影像图片中红章轮廓内的图片进行白平衡处理,并去除红色分量;
对去除红色分量后的合同影像图片进行光学字符识别(OCR)。
此外,为实现上述目的,本申请第二方面还提供一种合同影像图片的识别方法,所述合同影像图片的识别方法包括:
收到待识别的合同影像图片后,对待识别的合同影像图片进行预设的去躁处理;
按预设的椭圆轮廓检测规则确定出经去躁处理后的合同影像图 片中的椭圆轮廓,并将确定出的椭圆轮廓作为合同影像图片中的红章轮廓;
对合同影像图片中红章轮廓内的图片进行白平衡处理,并去除红色分量;
对去除红色分量后的合同影像图片进行OCR识别。
进一步地,为实现上述目的,本申请第三方面还提供一种计算机可读存储介质,所述计算机可读存储介质存储有合同影像图片的识别系统,所述合同影像图片的识别系统可被至少一个处理器执行,以使所述至少一个处理器执行如上述的合同影像图片的识别方法的步骤。
本申请提出的合同影像图片的识别方法、系统及可读存储介质,在对待识别的合同影像图片进行去躁处理后,通过预设的椭圆轮廓检测规则确定出经去躁处理后的合同影像图片中的椭圆轮廓,并将确定出的椭圆轮廓作为合同影像图片中的红章轮廓,对合同影像图片中红章轮廓内的图片进行白平衡处理,并去除红色分量,对去除红色分量后的合同影像图片进行OCR识别。由于能针对合同影像图片的特征,通过椭圆轮廓检测的方式来对合同影像图片进行红章检测,并对合同影像图片中的红章去除红色分量后再进行OCR识别,能够较好的支持合同影像图片中红章部分的准确识别,从而提高对非纯文字类型合同的OCR识别适应性,有效地提高合同影像图片的识别率。
附图说明
图1为本申请合同影像图片的识别系统10较佳实施例的运行环境示意图;
图2为本申请合同影像图片的识别方法一实施例的流程示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种 技术方案的结合不存在,也不在本申请要求的保护范围之内。
本申请提供一种合同影像图片的识别系统。请参阅图1,是本申请合同影像图片的识别系统10较佳实施例的运行环境示意图。
在本实施例中,所述的合同影像图片的识别系统10安装并运行于电子装置1中。该电子装置1可包括,但不仅限于,存储器11、处理器12及显示器13。图1仅示出了具有组件11-13的电子装置1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
所述存储器11为至少一种类型的可读计算机存储介质,所述存储器11在一些实施例中可以是所述电子装置1的内部存储单元,例如该电子装置1的硬盘或内存。所述存储器11在另一些实施例中也可以是所述电子装置1的外部存储设备,例如所述电子装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括所述电子装置1的内部存储单元也包括外部存储设备。所述存储器11用于存储安装于所述电子装置1的应用软件及各类数据,例如所述合同影像图片的识别系统10的程序代码等。所述存储器11还可以用于暂时地存储已经输出或者将要输出的数据。
所述处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其他数据处理芯片,用于运行所述存储器11中存储的程序代码或处理数据,例如执行所述合同影像图片的识别系统10等。
所述显示器13在一些实施例中可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。所述显示器13用于显示在所述电子装置1中处理的信息以及用于显示可视化的用户界面,例如待识别的合同影像图片、检测出的合同影像图片中的红章轮廓、最终对合同影像图片的OCR识别结果等。所述电子装置1的部件11-13通过系统总线相互通信。
合同影像图片的识别系统10包括至少一个存储在所述存储器11中的计算机可读指令,该至少一个计算机可读指令可被所述处理器12执行,以实现本申请各实施例。
其中,上述合同影像图片的识别系统10被所述处理器12执行时实现如下步骤:
步骤S1,收到待识别的合同影像图片后,对待识别的合同影像图片进行预设的去躁处理。
本实施例中,电子装置接收用户发出的包含待识别的合同影像图 片的OCR识别请求,例如,接收用户通过手机、平板电脑、自助终端设备等终端发送的OCR识别请求,如接收用户在手机、平板电脑、自助终端设备等终端中预先安装的客户端上发送来的OCR识别请求,或接收用户在手机、平板电脑、自助终端设备等终端中的浏览器系统上发送来的OCR识别请求。
收到待识别的合同影像图片后,对待识别的合同影像图片进行预设的去躁处理,如对待识别的合同影像图片进行高斯模糊处理,以初步去除待识别的合同图片中的噪声、杂点干扰。
步骤S2,按预设的椭圆轮廓检测规则确定出经去躁处理后的合同影像图片中的椭圆轮廓,并将确定出的椭圆轮廓作为合同影像图片中的红章轮廓。
本实施例中,检测经过去躁处理后的合同影像图片中RGB红色分量集中区域,提取出检测出的RGB红色分量集中区域图像并进行椭圆轮廓检测。具体步骤为:
首先,对提取出的RGB红色分量集中区域图像进行边缘检测,得到二值化的边缘轮廓图,将二值化的边缘轮廓图上的点坐标存入预设的数组A。
对提取出的RGB红色分量集中区域图像上的每一点(包括RGB红色分量集中区域图像边缘上的点以及RGB红色分量集中区域图像内即图像中间位置的点),计算RGB红色分量集中区域图像上的每一点与上述所得数组A中点的距离,得到所述RGB红色分量集中区域图像上的每一点距离数组A中点的最大距离,找出各个最大距离中的最小值,将所述最小值对应的所述RGB红色分量集中区域图像上的点作为椭圆中心,该椭圆中心坐标记为(P,Q),找出各个最大距离中的最大值,将所述最大值作为椭圆长轴长度a。
将得到的椭圆中心坐标(P,Q),椭圆长轴长度a,及数组A中每一点的坐标(x,y)代入如下椭圆方程:
Figure PCTCN2018102216-appb-000001
求得参数b、θ的值,在预设的二维参数空间上对参数b、θ的值进行统计,得到参数b、θ的统计值,将统计值的最大值超过预设阈值的一组参数b、θ作为椭圆轮廓参数,并以所述椭圆轮廓参数b、θ来建立椭圆轮廓,将建立的椭圆轮廓作为合同影像图片中的红章轮廓。
步骤S3,对合同影像图片中红章轮廓内的图片进行白平衡处理,并去除红色分量。
步骤S4,对去除红色分量后的合同影像图片进行OCR识别。
本实施例中在对待识别的合同影像图片进行去躁处理后,通过预设的椭圆轮廓检测规则确定出经去躁处理后的合同影像图片中的椭圆轮廓,并将确定出的椭圆轮廓作为合同影像图片中的红章轮廓,对合同影像图片中红章轮廓内的图片进行白平衡处理,并去除红色分量,对去除红色分量后的合同影像图片进行OCR识别。由于能针对合同影像图片的特征,通过椭圆轮廓检测的方式来对合同影像图片进行红章检测,并对合同影像图片中的红章去除红色分量后再进行OCR识别,能够较好的支持合同影像图片中红章部分的准确识别,从而提高对非纯文字类型合同的OCR识别适应性,有效地提高合同影像图片的识别率。
在一可选的实施例中,在上述图1的实施例的基础上,所述合同影像图片的识别系统10被所述处理器12执行实现所述步骤S4之前,还包括:
对经过去躁处理或红章轮廓检测处理后的合同影像图片进行直线检测,并进行适当拟合,若检测到图片中的封闭直线框,则对封闭直线框进行预设的表格处理流程;对图片中没有检测到封闭直线框的部分,进行段落文本分块处理流程。
在进行表格处理流程时,对图片中检测到的封闭直线框进行独立提取做表格化处理;在表格中最大封闭直线框内检测小的封闭直线框,将检测到的小的封闭直线框作为表格项处理。例如,当检测到小的封闭直线框内存在斜线时,对斜线内容进行分块处理,即对斜线分开的内容进行分块识别,并进行方向校验,对识别出的文字块分行进行展示,以按原始格式位置进行文字展示。依此,通过OCR分别识别出表格中各表格项的文字内容,已完成对合同影像图片中的表格文字识别。
在进行段落文本分块处理流程时,对文本图片进行像素特征分块,对分块的文字块进行进一步处理。包括:
针对特殊格式进行检测与处理。例如,针对预设位置(如图片顶端末端)来检测出页眉页脚,利用行间距的不同识别出标题,针对去除红色分量后的红章,识别出红章的文字,等等。针对这些特殊格式分别进行OCR识别。
对于图片中除特殊格式之外的其他图片部分,检测像素宽高值,对于宽高像素值较低(低于某一阈值)导致文字块像素体积较小的部分进行插值处理,以增加像素分辨率,提高后续的识别精度。对插值处理后图片中的文本块进行分行分割,对分割的不同文字段分别进行OCR识别,最后对分块识别的文字段按原始文本块位置进行组装处理。
将OCR识别出特殊格式的文字和其他图片中分段的文字之后,再综合表格文字识别,即可最终得到对整个合同影像图片的识别结果。
本实施例中通过对合同影像图片进行红章检测、表格检测和段落文本分块等处理后,对合同影像图片综合进行OCR识别,能够较好的支持合同影像图片中红章、表格的准确识别,相比于对合同进行传统的OCR识别,本实施例对非纯文字类型合同的OCR识别适应性较好,能有效提高合同影像图片的OCR识别率。
在一可选的实施例中,所述合同影像图片的识别系统10被所述处理器12执行实现所述步骤S1时,进一步包括:
收到待识别的合同影像图片后,对待识别的合同影像图片进行高斯模糊处理;
建立经高斯模糊处理后的合同影像图片的灰度直方图,根据所述灰度直方图检测出预设灰度值像素点成片状分布的部分为合同影像图片中的背景部分,去除合同影像图片中的背景部分,以去除掉合同影像图片中的背景部分对合同影像图片中文字部分识别产生的干扰。
本实施例中,可对合同影像图片进行预处理,如对待识别的合同影像图片进行高斯模糊处理,以初步去除待识别的合同影像图片中的噪声、杂点干扰。高斯模糊(Gaussian Blur),也叫高斯平滑,是根据高斯曲线调节像素色值,有选择地模糊图像,从而减少图像噪声以及降低细节层次。还可检测出合同影像图片的背景和文字,并去除合同影像图片中的背景部分。具体地,可建立合同影像图片的灰度直方图,则图片在低灰度区域的峰值和高灰度区域的峰值为图片背景和文字颜色。即在检测到某种主要灰度值像素点(高灰度值像素点)的连续性高,成片状分布时,则检测出其为图片中的背景;当某种主要灰度值的像素点(低灰度值像素点)成散状均匀分布时,则检测出其为图片中的文字。去除掉检测出的图片中的背景部分,以去除掉图片中的背景部分对图片中文字部分识别产生的干扰。
进一步地,还可对合同影像图片进行校正处理,对经过预处理后的合同影像图片进行膨胀处理,即给图像中的对象边缘添加像素,以模糊合同影像图片中的文字细节,并同时增加文字的像素体积。例如,一种膨胀算法如下:用3*3的结构元素扫描图像的每一个像素,用结构元素与其覆盖的二值图像做“与”操作,如果都为0,结果图像的该像素点为0,否则为1。膨胀算法的效果是使二值图像扩大一圈。其中,膨胀处理的原理如下:把结构元素B平移a后得到Ba,若Ba击中X,则记下这个a点,D(X)={a|Ba↑X}。对经过膨胀处理的合同 影像图片进行文本区检测。具体地,对经过膨胀处理的合同影像图片中文字所在区域进行最外边缘检测,并进行直线边缘连接,得到长方形或平行四边形或梯形的外框。长方形的外框为正常状态下的文本框,平行四边形或梯形的外框则是在扫描成合同影像图片时可能没有将原始文件摆正,造成合同影像图片中文字角度不正,则需要对平行四边形和梯形的外框图片进行仿射变换校正处理,以将合同影像图片中文字摆正,以便后续对合同影像图片中文字OCR识别更加准确。例如,仿射变换校正处理的公式为:[x,y,1]=[u,v,1]T,其中,T为仿射矩阵。
还可对仿射变换校正后的合同影像图片检测文字方向。具体地,可对于仿射变换校正后的合同影像图片中每隔一定像素划一条横线和一条竖线,得到每条线的像素值分布曲线,当某一类(如横向的或纵向的)曲线存在周期性的背景像素,且末端或开头为连续背景像素时,则判定该方向为段落结尾处,认定该方向(如横向或纵向)为文本方向。若垂直方向和水平方向均仅存在周期性背景像素分布,则判定周期性间隔较小的作为文本方向。检测出的文字方向可供后续对合同影像图片中文字进行OCR识别时进行参考。
如图2所示,图2为本申请合同影像图片的识别方法一实施例的流程示意图,该合同影像图片的识别方法包括以下步骤:
步骤S10,收到待识别的合同影像图片后,对待识别的合同影像图片进行预设的去躁处理。
本实施例中,电子装置接收用户发出的包含待识别的合同影像图片的OCR识别请求,例如,接收用户通过手机、平板电脑、自助终端设备等终端发送的OCR识别请求,如接收用户在手机、平板电脑、自助终端设备等终端中预先安装的客户端上发送来的OCR识别请求,或接收用户在手机、平板电脑、自助终端设备等终端中的浏览器系统上发送来的OCR识别请求。
收到待识别的合同影像图片后,对待识别的合同影像图片进行预设的去躁处理,如对待识别的合同影像图片进行高斯模糊处理,以初步去除待识别的合同图片中的噪声、杂点干扰。
步骤S20,按预设的椭圆轮廓检测规则确定出经去躁处理后的合同影像图片中的椭圆轮廓,并将确定出的椭圆轮廓作为合同影像图片中的红章轮廓。
本实施例中,检测经过去躁处理后的合同影像图片中RGB红色分量集中区域,提取出检测出的RGB红色分量集中区域图像并进行椭圆轮廓检测。具体步骤为:
首先,对提取出的RGB红色分量集中区域图像进行边缘检测,得 到二值化的边缘轮廓图,将二值化的边缘轮廓图上的点坐标存入预设的数组A。
对提取出的RGB红色分量集中区域图像上的每一点(包括RGB红色分量集中区域图像边缘上的点以及RGB红色分量集中区域图像内即图像中间位置的点),计算RGB红色分量集中区域图像上的每一点与上述所得数组A中点的距离,得到所述RGB红色分量集中区域图像上的每一点距离数组A中点的最大距离,找出各个最大距离中的最小值,将所述最小值对应的所述RGB红色分量集中区域图像上的点作为椭圆中心,该椭圆中心坐标记为(P,Q),找出各个最大距离中的最大值,将所述最大值作为椭圆长轴长度a。
将得到的椭圆中心坐标(P,Q),椭圆长轴长度a,及数组A中每一点的坐标(x,y)代入如下椭圆方程:
Figure PCTCN2018102216-appb-000002
求得参数b、θ的值,在预设的二维参数空间上对参数b、θ的值进行统计,得到参数b、θ的统计值,将统计值的最大值超过预设阈值的一组参数b、θ作为椭圆轮廓参数,并以所述椭圆轮廓参数b、θ来建立椭圆轮廓,将建立的椭圆轮廓作为合同影像图片中的红章轮廓。
步骤S30,对合同影像图片中红章轮廓内的图片进行白平衡处理,并去除红色分量。
步骤S40,对去除红色分量后的合同影像图片进行OCR识别。
本实施例中在对待识别的合同影像图片进行去躁处理后,通过预设的椭圆轮廓检测规则确定出经去躁处理后的合同影像图片中的椭圆轮廓,并将确定出的椭圆轮廓作为合同影像图片中的红章轮廓,对合同影像图片中红章轮廓内的图片进行白平衡处理,并去除红色分量,对去除红色分量后的合同影像图片进行OCR识别。由于能针对合同影像图片的特征,通过椭圆轮廓检测的方式来对合同影像图片进行红章检测,并对合同影像图片中的红章去除红色分量后再进行OCR识别,能够较好的支持合同影像图片中红章部分的准确识别,从而提高对非纯文字类型合同的OCR识别适应性,有效地提高合同影像图片的识别率。
在一可选的实施例中,在上述实施例的基础上,在所述步骤S40之前,该方法还包括:
对经过去躁处理或红章轮廓检测处理后的合同影像图片进行直线检测,并进行适当拟合,若检测到图片中的封闭直线框,则对封闭 直线框进行预设的表格处理流程;对图片中没有检测到封闭直线框的部分,进行段落文本分块处理流程。
在进行表格处理流程时,对图片中检测到的封闭直线框进行独立提取做表格化处理;在表格中最大封闭直线框内检测小的封闭直线框,将检测到的小的封闭直线框作为表格项处理。例如,当检测到小的封闭直线框内存在斜线时,对斜线内容进行分块处理,即对斜线分开的内容进行分块识别,并进行方向校验,对识别出的文字块分行进行展示,以按原始格式位置进行文字展示。依此,通过OCR分别识别出表格中各表格项的文字内容,已完成对合同影像图片中的表格文字识别。
在进行段落文本分块处理流程时,对文本图片进行像素特征分块,对分块的文字块进行进一步处理。包括:
针对特殊格式进行检测与处理。例如,针对预设位置(如图片顶端末端)来检测出页眉页脚,利用行间距的不同识别出标题,针对去除红色分量后的红章,识别出红章的文字,等等。针对这些特殊格式分别进行OCR识别。
对于图片中除特殊格式之外的其他图片部分,检测像素宽高值,对于宽高像素值较低(低于某一阈值)导致文字块像素体积较小的部分进行插值处理,以增加像素分辨率,提高后续的识别精度。对插值处理后图片中的文本块进行分行分割,对分割的不同文字段分别进行OCR识别,最后对分块识别的文字段按原始文本块位置进行组装处理。
将OCR识别出特殊格式的文字和其他图片中分段的文字之后,再综合表格文字识别,即可最终得到对整个合同影像图片的识别结果。
本实施例中通过对合同影像图片进行红章检测、表格检测和段落文本分块等处理后,对合同影像图片综合进行OCR识别,能够较好的支持合同影像图片中红章、表格的准确识别,相比于对合同进行传统的OCR识别,本实施例对非纯文字类型合同的OCR识别适应性较好,能有效提高合同影像图片的OCR识别率。
在一可选的实施例中,所述步骤S10包括:
收到待识别的合同影像图片后,对待识别的合同影像图片进行高斯模糊处理;
建立经高斯模糊处理后的合同影像图片的灰度直方图,根据所述灰度直方图检测出预设灰度值像素点成片状分布的部分为合同影像图片中的背景部分,去除合同影像图片中的背景部分,以去除掉合同 影像图片中的背景部分对合同影像图片中文字部分识别产生的干扰。
本实施例中,可对合同影像图片进行预处理,如对待识别的合同影像图片进行高斯模糊处理,以初步去除待识别的合同影像图片中的噪声、杂点干扰。高斯模糊(Gaussian Blur),也叫高斯平滑,是根据高斯曲线调节像素色值,有选择地模糊图像,从而减少图像噪声以及降低细节层次。还可检测出合同影像图片的背景和文字,并去除合同影像图片中的背景部分。具体地,可建立合同影像图片的灰度直方图,则图片在低灰度区域的峰值和高灰度区域的峰值为图片背景和文字颜色。即在检测到某种主要灰度值像素点(高灰度值像素点)的连续性高,成片状分布时,则检测出其为图片中的背景;当某种主要灰度值的像素点(低灰度值像素点)成散状均匀分布时,则检测出其为图片中的文字。去除掉检测出的图片中的背景部分,以去除掉图片中的背景部分对图片中文字部分识别产生的干扰。
进一步地,还可对合同影像图片进行校正处理,对经过预处理后的合同影像图片进行膨胀处理,即给图像中的对象边缘添加像素,以模糊合同影像图片中的文字细节,并同时增加文字的像素体积。例如,一种膨胀算法如下:用3*3的结构元素扫描图像的每一个像素,用结构元素与其覆盖的二值图像做“与”操作,如果都为0,结果图像的该像素点为0,否则为1。膨胀算法的效果是使二值图像扩大一圈。其中,膨胀处理的原理如下:把结构元素B平移a后得到Ba,若Ba击中X,则记下这个a点,D(X)={a|Ba↑X}。对经过膨胀处理的合同影像图片进行文本区检测。具体地,对经过膨胀处理的合同影像图片中文字所在区域进行最外边缘检测,并进行直线边缘连接,得到长方形或平行四边形或梯形的外框。长方形的外框为正常状态下的文本框,平行四边形或梯形的外框则是在扫描成合同影像图片时可能没有将原始文件摆正,造成合同影像图片中文字角度不正,则需要对平行四边形和梯形的外框图片进行仿射变换校正处理,以将合同影像图片中文字摆正,以便后续对合同影像图片中文字OCR识别更加准确。例如,仿射变换校正处理的公式为:[x,y,1]=[u,v,1]T,其中,T为仿射矩阵。
还可对仿射变换校正后的合同影像图片检测文字方向。具体地,可对于仿射变换校正后的合同影像图片中每隔一定像素划一条横线和一条竖线,得到每条线的像素值分布曲线,当某一类(如横向的或纵向的)曲线存在周期性的背景像素,且末端或开头为连续背景像素时,则判定该方向为段落结尾处,认定该方向(如横向或纵向)为文本方向。若垂直方向和水平方向均仅存在周期性背景像素分布,则判定周期性间隔较小的作为文本方向。检测出的文字方向可供后续对合同影像图片中文字进行OCR识别时进行参考。
此外,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有合同影像图片的识别系统,所述合同影像图片的识别系统可被至少一个处理器执行,以使所述至少一个处理器执行如上述实施例中的合同影像图片的识别方法的步骤,该合同影像图片的识别方法的步骤S10、S20、S30等具体实施过程如上文所述,在此不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件来实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上参照附图说明了本申请的优选实施例,并非因此局限本申请的权利范围。上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。另外,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本领域技术人员不脱离本申请的范围和实质,可以有多种变型方案实现本申请,比如作为一个实施例的特征可用于另一实施例而得到又一实施例。凡在运用本申请的技术构思之内所作的任何修改、等同替换和改进,均应在本申请的权利范围之内。

Claims (20)

  1. 一种电子装置,其特征在于,所述电子装置包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的合同影像图片的识别系统,所述合同影像图片的识别系统被所述处理器执行时实现如下步骤:
    收到待识别的合同影像图片后,对待识别的合同影像图片进行预设的去躁处理;
    按预设的椭圆轮廓检测规则确定出经去躁处理后的合同影像图片中的椭圆轮廓,并将确定出的椭圆轮廓作为合同影像图片中的红章轮廓;
    对合同影像图片中红章轮廓内的图片进行白平衡处理,并去除红色分量;
    对去除红色分量后的合同影像图片进行OCR识别。
  2. 如权利要求1所述的电子装置,其特征在于,所述按预设的椭圆轮廓检测规则确定出经去躁处理后的合同影像图片中的椭圆轮廓,并将确定出的椭圆轮廓作为合同影像图片中的红章轮廓的步骤包括:
    检测经去躁处理后的合同影像图片中的RGB红色分量集中区域;
    提取出RGB红色分量集中区域图像并对提取出的RGB红色分量集中区域图像进行边缘检测,得到二值化的边缘轮廓图;
    将二值化的边缘轮廓图上的点坐标存入预设数组;
    计算所述RGB红色分量集中区域图像上的每一点与所述预设数组中点的距离,得到所述RGB红色分量集中区域图像上的每一点距离所述预设数组中点的最大距离,找出各个最大距离中的最小值,将所述最小值对应的所述RGB红色分量集中区域图像上的点作为椭圆中心,找出各个最大距离中的最大值,将所述最大值作为椭圆长轴长度;
    基于所述椭圆中心、所述椭圆长轴长度和所述预设数组建立椭圆轮廓,并将建立的椭圆轮廓作为合同影像图片中的红章轮廓。
  3. 如权利要求2所述的电子装置,其特征在于,所述基于所述椭圆中心、所述椭圆长轴长度和所述预设数组构造椭圆轮廓,并将构造出的椭圆轮廓作为合同影像图片中的红章轮廓的步骤包括:
    将椭圆中心坐标(P,Q),椭圆长轴长度a,及预设数组中每一点的坐标(x,y)代入如下椭圆方程:
    Figure PCTCN2018102216-appb-100001
    求得参数b、θ的值,在预设的二维参数空间上对参数b、θ的值进行统计,得到参数b、θ的统计值,将统计值的最大值超过预设阈值的一组参数b、θ作为椭圆轮廓参数,根据所述椭圆轮廓参数来建立椭圆轮廓,并将建立的椭圆轮廓作为合同影像图片中的红章轮廓。
  4. 如权利要求1所述的电子装置,其特征在于,在所述对去除红色分量后的合同影像图片进行OCR识别的步骤之前,所述处理器还用于执行所述合同影像图片的识别系统,以实现以下步骤:
    对待识别的合同影像图片进行直线检测并拟合,以检测待识别的合同影像图片中的封闭直线框;
    若检测到待识别的合同影像图片中的封闭直线框,则对检测到的封闭直线框进行独立提取做表格化处理,在提取的表格中最大封闭直线框内检测小的封闭直线框,将检测到的小的封闭直线框作为表格项处理;
    所述对去除红色分量后的合同影像图片进行OCR识别的步骤包括:
    利用OCR分别识别出合同影像图片中检测的表格中各表格项的文字内容。
  5. 如权利要求2所述的电子装置,其特征在于,在所述对去除红色分量后的合同影像图片进行OCR识别的步骤之前,所述处理器还用于执行所述合同影像图片的识别系统,以实现以下步骤:
    对待识别的合同影像图片进行直线检测并拟合,以检测待识别的合同影像图片中的封闭直线框;
    若检测到待识别的合同影像图片中的封闭直线框,则对检测到的封闭直线框进行独立提取做表格化处理,在提取的表格中最大封闭直线框内检测小的封闭直线框,将检测到的小的封闭直线框作为表格项处理;
    所述对去除红色分量后的合同影像图片进行OCR识别的步骤包括:
    利用OCR分别识别出合同影像图片中检测的表格中各表格项的文字内容。
  6. 如权利要求3所述的电子装置,其特征在于,在所述对去除红色分量后的合同影像图片进行OCR识别的步骤之前,所述处理器还用于执行所述合同影像图片的识别系统,以实现以下步骤:
    对待识别的合同影像图片进行直线检测并拟合,以检测待识别的合同影像图片中的封闭直线框;
    若检测到待识别的合同影像图片中的封闭直线框,则对检测到的封闭直线框进行独立提取做表格化处理,在提取的表格中最大封闭直 线框内检测小的封闭直线框,将检测到的小的封闭直线框作为表格项处理;
    所述对去除红色分量后的合同影像图片进行OCR识别的步骤包括:
    利用OCR分别识别出合同影像图片中检测的表格中各表格项的文字内容。
  7. 如权利要求1所述的电子装置,其特征在于,所述收到待识别的合同影像图片后,对待识别的合同影像图片进行预设的去躁处理的步骤包括:
    收到待识别的合同影像图片后,对待识别的合同影像图片进行高斯模糊处理;
    建立经高斯模糊处理后的合同影像图片的灰度直方图,根据所述灰度直方图检测出预设灰度值像素点成片状分布的部分为合同影像图片中的背景部分,去除合同影像图片中的背景部分,以去除掉合同影像图片中的背景部分对合同影像图片中文字部分识别产生的干扰。
  8. 如权利要求2所述的电子装置,其特征在于,所述收到待识别的合同影像图片后,对待识别的合同影像图片进行预设的去躁处理的步骤包括:
    收到待识别的合同影像图片后,对待识别的合同影像图片进行高斯模糊处理;
    建立经高斯模糊处理后的合同影像图片的灰度直方图,根据所述灰度直方图检测出预设灰度值像素点成片状分布的部分为合同影像图片中的背景部分,去除合同影像图片中的背景部分,以去除掉合同影像图片中的背景部分对合同影像图片中文字部分识别产生的干扰。
  9. 如权利要求3所述的电子装置,其特征在于,所述收到待识别的合同影像图片后,对待识别的合同影像图片进行预设的去躁处理的步骤包括:
    收到待识别的合同影像图片后,对待识别的合同影像图片进行高斯模糊处理;
    建立经高斯模糊处理后的合同影像图片的灰度直方图,根据所述灰度直方图检测出预设灰度值像素点成片状分布的部分为合同影像图片中的背景部分,去除合同影像图片中的背景部分,以去除掉合同影像图片中的背景部分对合同影像图片中文字部分识别产生的干扰。
  10. 一种合同影像图片的识别方法,其特征在于,所述合同影像图片的识别方法包括:
    收到待识别的合同影像图片后,对待识别的合同影像图片进行预设的去躁处理;
    按预设的椭圆轮廓检测规则确定出经去躁处理后的合同影像图 片中的椭圆轮廓,并将确定出的椭圆轮廓作为合同影像图片中的红章轮廓;
    对合同影像图片中红章轮廓内的图片进行白平衡处理,并去除红色分量;
    对去除红色分量后的合同影像图片进行OCR识别。
  11. 如权利要求10所述的合同影像图片的识别方法,其特征在于,所述按预设的椭圆轮廓检测规则确定出经去躁处理后的合同影像图片中的椭圆轮廓,并将确定出的椭圆轮廓作为合同影像图片中的红章轮廓的步骤包括:
    检测经去躁处理后的合同影像图片中的RGB红色分量集中区域;
    提取出RGB红色分量集中区域图像并对提取出的RGB红色分量集中区域图像进行边缘检测,得到二值化的边缘轮廓图;
    将二值化的边缘轮廓图上的点坐标存入预设数组;
    计算所述RGB红色分量集中区域图像上的每一点与所述预设数组中点的距离,得到所述RGB红色分量集中区域图像上的每一点距离所述预设数组中点的最大距离,找出各个最大距离中的最小值,将所述最小值对应的所述RGB红色分量集中区域图像上的点作为椭圆中心,找出各个最大距离中的最大值,将所述最大值作为椭圆长轴长度;
    基于所述椭圆中心、所述椭圆长轴长度和所述预设数组建立椭圆轮廓,并将建立的椭圆轮廓作为合同影像图片中的红章轮廓。
  12. 如权利要求11所述的合同影像图片的识别方法,其特征在于,所述基于所述椭圆中心、所述椭圆长轴长度和所述预设数组构造椭圆轮廓,并将构造出的椭圆轮廓作为合同影像图片中的红章轮廓的步骤包括:
    将椭圆中心坐标(P,Q),椭圆长轴长度a,及预设数组中每一点的坐标(x,y)代入如下椭圆方程:
    Figure PCTCN2018102216-appb-100002
    求得参数b、θ的值,在预设的二维参数空间上对参数b、θ的值进行统计,得到参数b、θ的统计值,将统计值的最大值超过预设阈值的一组参数b、θ作为椭圆轮廓参数,根据所述椭圆轮廓参数来建立椭圆轮廓,并将建立的椭圆轮廓作为合同影像图片中的红章轮廓。
  13. 如权利要求10所述的合同影像图片的识别方法,其特征在于,在所述对去除红色分量后的合同影像图片进行OCR识别的步骤之前,还包括:
    对待识别的合同影像图片进行直线检测并拟合,以检测待识别的合同影像图片中的封闭直线框;
    若检测到待识别的合同影像图片中的封闭直线框,则对检测到的封闭直线框进行独立提取做表格化处理,在提取的表格中最大封闭直线框内检测小的封闭直线框,将检测到的小的封闭直线框作为表格项处理;
    所述对去除红色分量后的合同影像图片进行OCR识别的步骤包括:
    利用OCR分别识别出合同影像图片中检测的表格中各表格项的文字内容。
  14. 如权利要求11所述的合同影像图片的识别方法,其特征在于,在所述对去除红色分量后的合同影像图片进行OCR识别的步骤之前,还包括:
    对待识别的合同影像图片进行直线检测并拟合,以检测待识别的合同影像图片中的封闭直线框;
    若检测到待识别的合同影像图片中的封闭直线框,则对检测到的封闭直线框进行独立提取做表格化处理,在提取的表格中最大封闭直线框内检测小的封闭直线框,将检测到的小的封闭直线框作为表格项处理;
    所述对去除红色分量后的合同影像图片进行OCR识别的步骤包括:
    利用OCR分别识别出合同影像图片中检测的表格中各表格项的文字内容。
  15. 如权利要求12所述的合同影像图片的识别方法,其特征在于,在所述对去除红色分量后的合同影像图片进行OCR识别的步骤之前,还包括:
    对待识别的合同影像图片进行直线检测并拟合,以检测待识别的合同影像图片中的封闭直线框;
    若检测到待识别的合同影像图片中的封闭直线框,则对检测到的封闭直线框进行独立提取做表格化处理,在提取的表格中最大封闭直线框内检测小的封闭直线框,将检测到的小的封闭直线框作为表格项处理;
    所述对去除红色分量后的合同影像图片进行OCR识别的步骤包括:
    利用OCR分别识别出合同影像图片中检测的表格中各表格项的文字内容。
  16. 如权利要求10所述的合同影像图片的识别方法,其特征在于,所述收到待识别的合同影像图片后,对待识别的合同影像图片进 行预设的去躁处理的步骤包括:
    收到待识别的合同影像图片后,对待识别的合同影像图片进行高斯模糊处理;
    建立经高斯模糊处理后的合同影像图片的灰度直方图,根据所述灰度直方图检测出预设灰度值像素点成片状分布的部分为合同影像图片中的背景部分,去除合同影像图片中的背景部分,以去除掉合同影像图片中的背景部分对合同影像图片中文字部分识别产生的干扰。
  17. 如权利要求11所述的合同影像图片的识别方法,其特征在于,所述收到待识别的合同影像图片后,对待识别的合同影像图片进行预设的去躁处理的步骤包括:
    收到待识别的合同影像图片后,对待识别的合同影像图片进行高斯模糊处理;
    建立经高斯模糊处理后的合同影像图片的灰度直方图,根据所述灰度直方图检测出预设灰度值像素点成片状分布的部分为合同影像图片中的背景部分,去除合同影像图片中的背景部分,以去除掉合同影像图片中的背景部分对合同影像图片中文字部分识别产生的干扰。
  18. 如权利要求12所述的合同影像图片的识别方法,其特征在于,所述收到待识别的合同影像图片后,对待识别的合同影像图片进行预设的去躁处理的步骤包括:
    收到待识别的合同影像图片后,对待识别的合同影像图片进行高斯模糊处理;
    建立经高斯模糊处理后的合同影像图片的灰度直方图,根据所述灰度直方图检测出预设灰度值像素点成片状分布的部分为合同影像图片中的背景部分,去除合同影像图片中的背景部分,以去除掉合同影像图片中的背景部分对合同影像图片中文字部分识别产生的干扰。
  19. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有合同影像图片的识别系统,所述合同影像图片的识别系统被处理器执行时实现如下步骤:
    收到待识别的合同影像图片后,对待识别的合同影像图片进行预设的去躁处理;
    按预设的椭圆轮廓检测规则确定出经去躁处理后的合同影像图片中的椭圆轮廓,并将确定出的椭圆轮廓作为合同影像图片中的红章轮廓;
    对合同影像图片中红章轮廓内的图片进行白平衡处理,并去除红色分量;
    对去除红色分量后的合同影像图片进行OCR识别。
  20. 如权利要求19所述的计算机可读存储介质,其特征在于,所述按预设的椭圆轮廓检测规则确定出经去躁处理后的合同影像图 片中的椭圆轮廓,并将确定出的椭圆轮廓作为合同影像图片中的红章轮廓的步骤包括:
    检测经去躁处理后的合同影像图片中的RGB红色分量集中区域;
    提取出RGB红色分量集中区域图像并对提取出的RGB红色分量集中区域图像进行边缘检测,得到二值化的边缘轮廓图;
    将二值化的边缘轮廓图上的点坐标存入预设数组;
    计算所述RGB红色分量集中区域图像上的每一点与所述预设数组中点的距离,得到所述RGB红色分量集中区域图像上的每一点距离所述预设数组中点的最大距离,找出各个最大距离中的最小值,将所述最小值对应的所述RGB红色分量集中区域图像上的点作为椭圆中心,找出各个最大距离中的最大值,将所述最大值作为椭圆长轴长度;
    基于所述椭圆中心、所述椭圆长轴长度和所述预设数组建立椭圆轮廓,并将建立的椭圆轮廓作为合同影像图片中的红章轮廓。
PCT/CN2018/102216 2018-04-17 2018-08-24 合同影像图片的识别方法、电子装置及可读存储介质 WO2019200802A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810343634.5A CN108830133B (zh) 2018-04-17 2018-04-17 合同影像图片的识别方法、电子装置及可读存储介质
CN201810343634.5 2018-04-17

Publications (1)

Publication Number Publication Date
WO2019200802A1 true WO2019200802A1 (zh) 2019-10-24

Family

ID=64154845

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/102216 WO2019200802A1 (zh) 2018-04-17 2018-08-24 合同影像图片的识别方法、电子装置及可读存储介质

Country Status (2)

Country Link
CN (1) CN108830133B (zh)
WO (1) WO2019200802A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111368695A (zh) * 2020-02-28 2020-07-03 上海汇航捷讯网络科技有限公司 一种表格结构提取方法
CN112861503A (zh) * 2020-12-30 2021-05-28 南京智闪萤科技有限公司 产生电子合同的方法、计算设备和计算机存储介质
CN113983932A (zh) * 2021-11-03 2022-01-28 合肥国轩高科动力能源有限公司 一种圆柱电池钢珠打偏检测方法和系统
CN114694147A (zh) * 2022-02-28 2022-07-01 华南理工大学 分割椭圆形图案中环绕文字的方法和装置

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111797838A (zh) * 2019-04-08 2020-10-20 上海怀若智能科技有限公司 一种图片类文档盲去噪系统、方法及装置
CN110378248B (zh) * 2019-06-25 2023-07-21 平安科技(深圳)有限公司 饼状图识别方法、装置、设备及计算机可读存储介质
CN112749649A (zh) * 2020-12-31 2021-05-04 武汉文楚智信科技有限公司 一种智能识别并生成电子合同的方法及系统
CN112766275B (zh) * 2021-04-08 2021-09-10 金蝶软件(中国)有限公司 印章文字识别方法、装置、计算机设备和存储介质
CN113705571A (zh) * 2021-08-31 2021-11-26 平安银行股份有限公司 基于rgb阈值去红章的方法、装置、可读介质及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002109521A (ja) * 2000-07-25 2002-04-12 Canon Inc 文書処理装置及び方法
CN101533517A (zh) * 2009-04-15 2009-09-16 北京联合大学 一种基于结构特征的中国书画印章图像自动提取方法
CN106156768A (zh) * 2016-07-01 2016-11-23 屈桢深 基于视觉的机动车行驶证检测方法
CN107358184A (zh) * 2017-06-30 2017-11-17 中国科学院自动化研究所 文档文字的提取方法及提取装置

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103208004A (zh) * 2013-03-15 2013-07-17 北京英迈杰科技有限公司 票据信息区域自动识别和提取方法及设备
US9152858B2 (en) * 2013-06-30 2015-10-06 Google Inc. Extracting card data from multiple cards
CN103839064B (zh) * 2014-01-20 2019-02-01 中国建设银行股份有限公司 用于提取电子印鉴账户信息的方法和系统
CN104112128B (zh) * 2014-06-19 2018-01-26 中国工商银行股份有限公司 应用于票据影像字符识别的数字图像处理系统及方法
CN104966051B (zh) * 2015-06-03 2018-07-17 中国科学院信息工程研究所 一种文档图像的版式识别方法
CN105741272A (zh) * 2016-01-25 2016-07-06 上海中信信息发展股份有限公司 去除文档图像背面渗透字迹的方法
CN105654072B (zh) * 2016-03-24 2019-03-01 哈尔滨工业大学 一种低分辨率医疗票据图像的文字自动提取和识别系统与方法
CN107133621B (zh) * 2017-05-12 2020-09-29 中电鸿信信息科技有限公司 基于ocr的格式化传真的分类和信息提取方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002109521A (ja) * 2000-07-25 2002-04-12 Canon Inc 文書処理装置及び方法
CN101533517A (zh) * 2009-04-15 2009-09-16 北京联合大学 一种基于结构特征的中国书画印章图像自动提取方法
CN106156768A (zh) * 2016-07-01 2016-11-23 屈桢深 基于视觉的机动车行驶证检测方法
CN107358184A (zh) * 2017-06-30 2017-11-17 中国科学院自动化研究所 文档文字的提取方法及提取装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CHANG, JIAYAN: "The Study of Seal Feature Extraction Technology Based on the Vein", CHINA ACADEMIC LITERATURE NETWORK PUBLISHING DATABASE, 10 May 2007 (2007-05-10) *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111368695A (zh) * 2020-02-28 2020-07-03 上海汇航捷讯网络科技有限公司 一种表格结构提取方法
CN111368695B (zh) * 2020-02-28 2023-06-20 上海汇航捷讯网络科技有限公司 一种表格结构提取方法
CN112861503A (zh) * 2020-12-30 2021-05-28 南京智闪萤科技有限公司 产生电子合同的方法、计算设备和计算机存储介质
CN113983932A (zh) * 2021-11-03 2022-01-28 合肥国轩高科动力能源有限公司 一种圆柱电池钢珠打偏检测方法和系统
CN113983932B (zh) * 2021-11-03 2023-08-08 合肥国轩高科动力能源有限公司 一种圆柱电池钢珠打偏检测方法和系统
CN114694147A (zh) * 2022-02-28 2022-07-01 华南理工大学 分割椭圆形图案中环绕文字的方法和装置
CN114694147B (zh) * 2022-02-28 2024-04-19 华南理工大学 分割椭圆形图案中环绕文字的方法和装置

Also Published As

Publication number Publication date
CN108830133B (zh) 2020-02-21
CN108830133A (zh) 2018-11-16

Similar Documents

Publication Publication Date Title
WO2019200802A1 (zh) 合同影像图片的识别方法、电子装置及可读存储介质
US11538235B2 (en) Methods and apparatus to determine the dimensions of a region of interest of a target object from an image using target object landmarks
TWI726422B (zh) 二維碼識別方法、裝置及設備
US9430704B2 (en) Image processing system with layout analysis and method of operation thereof
WO2019061661A1 (zh) 图像篡改检测方法、电子装置及可读存储介质
US8189961B2 (en) Techniques in optical character recognition
US9412164B2 (en) Apparatus and methods for imaging system calibration
WO2017124940A1 (zh) 识别规格图片中是否包含水印的方法及装置
WO2014160426A1 (en) Classifying objects in digital images captured using mobile devices
WO2014160433A2 (en) Systems and methods for classifying objects in digital images captured using mobile devices
US8897600B1 (en) Method and system for determining vanishing point candidates for projective correction
WO2019169767A1 (zh) 色情图片鉴定方法、电子装置及可读存储介质
US10169673B2 (en) Region-of-interest detection apparatus, region-of-interest detection method, and recording medium
US20180253852A1 (en) Method and device for locating image edge in natural background
Lelore et al. Super-resolved binarization of text based on the fair algorithm
US8913836B1 (en) Method and system for correcting projective distortions using eigenpoints
US20210124918A1 (en) Method and device for acquiring slant value of slant image, terminal and storage medium
CN111553251A (zh) 证件四角残缺检测方法、装置、设备及存储介质
WO2021168703A1 (zh) 字符处理及字符识别方法、存储介质和终端设备
CN112419207A (zh) 一种图像矫正方法及装置、系统
EP2536123B1 (en) Image processing method and image processing apparatus
EP2545498B1 (en) Resolution adjustment of an image that includes text undergoing an ocr process
WO2020082731A1 (zh) 电子装置、证件识别方法及存储介质
US20130050765A1 (en) Method and apparatus for document authentication using image comparison on a block-by-block basis
CN116503871A (zh) 字符分割的预处理方法、终端设备和计算机可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18915163

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18915163

Country of ref document: EP

Kind code of ref document: A1