WO2017096759A1 - 一种检测图像中信息卡的方法、装置和系统 - Google Patents

一种检测图像中信息卡的方法、装置和系统 Download PDF

Info

Publication number
WO2017096759A1
WO2017096759A1 PCT/CN2016/083100 CN2016083100W WO2017096759A1 WO 2017096759 A1 WO2017096759 A1 WO 2017096759A1 CN 2016083100 W CN2016083100 W CN 2016083100W WO 2017096759 A1 WO2017096759 A1 WO 2017096759A1
Authority
WO
WIPO (PCT)
Prior art keywords
information card
image
gradient
information
content
Prior art date
Application number
PCT/CN2016/083100
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 WO2017096759A1 publication Critical patent/WO2017096759A1/zh
Priority to US15/715,579 priority Critical patent/US10410053B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content
    • G06V30/414Extracting the geometrical structure, e.g. layout tree; Block segmentation, e.g. bounding boxes for graphics or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/36User authentication by graphic or iconic representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • G06V10/243Aligning, centring, orientation detection or correction of the image by compensating for image skew or non-uniform image deformations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • G06V10/245Aligning, centring, orientation detection or correction of the image by locating a pattern; Special marks for positioning
    • 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
    • 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/418Document matching, e.g. of document images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2133Verifying human interaction, e.g., Captcha

Definitions

  • the present application relates to image processing techniques, and more particularly to a method, apparatus and system for detecting an information card in an image.
  • the method for matching the template requires a high degree of cooperation on the user, that is, a high degree of cooperation is required in the process of interacting with the user, so that the ID card has substantially no deviation from the preset size and angle in the image; , need to scan the entire image content for matching, slow, and prone to no match.
  • a method for detecting an information card in an image is provided, and the other party A device and system for detecting an information card in an image is provided to reduce the requirement for user fit and to increase the processing speed.
  • the gradient template matching is performed on the perspective transformed image content according to the gradient template created according to the information content layout on the information card, and according to the matching result, whether the image content is the correct information card is determined.
  • a line detection module for performing line detection in an information card image, and obtaining two end points of a line segment corresponding to each of four sides of the information card;
  • the intersection calculation module is configured to generate a line equation corresponding to the edge according to the two end points of the line segment corresponding to each edge; and obtain four intersection coordinates according to the line equation corresponding to the four sides of the information card;
  • a transformation matrix calculation module configured to map the four intersection coordinates to four corner points of a standard rectangular frame of the information card to obtain a perspective transformation matrix
  • a perspective transformation module for representing four linear equations according to the perspective transformation matrix The image content surrounded by the four straight lines is transformed into perspective;
  • the template matching module is configured to perform gradient template matching on the perspective-transformed image content by using a gradient template created according to the information content layout on the information card, and determine whether the image content is a correct information card according to the matching result.
  • a system for detecting an information card in an image provided in the embodiment of the present application includes: a client and a server; wherein
  • the client is configured to provide an information card image to the server;
  • the server is configured to perform line detection on the information card image to obtain two end points of a line segment corresponding to each of four sides of the information card; and generate corresponding edge according to two end points of the line segment corresponding to each edge a straight line equation; according to the line equation corresponding to the four sides of the information card, four intersection coordinates are obtained; the four intersection coordinates are mapped to the four corner points of the standard rectangular frame of the information card to obtain a perspective transformation matrix;
  • the perspective transformation matrix performs perspective transformation on the image content surrounded by the four straight lines represented by the four linear equations; and uses the gradient template created according to the information content layout on the information card to perform gradient template matching on the perspective transformed image content, according to the matching As a result, it is determined whether the image content is the correct information card.
  • FIG. 1 is an exemplary flowchart of a method for detecting an information card in an image according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of information content layout of an identity card according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of an indication of an information card placement area frame in an embodiment of the present application.
  • FIG. 4 is an exemplary structural diagram of an apparatus for detecting an information card in an image according to an embodiment of the present application
  • FIG. 5 is an exemplary structural diagram of a system for detecting an information card in an image according to an embodiment of the present application
  • FIG. 7 is a schematic structural diagram of a server device according to an embodiment of the present application.
  • the information card in order to reduce the cooperation requirement of the user, it is necessary to consider that the information card may be deformed in the captured information card image, for example, the rectangular information card becomes trapezoidal in the information card image, To this end, before detecting the image content of the information card, the size of the information card should be calibrated first, and then the image content is detected.
  • FIG. 1 is an exemplary flowchart of a method for detecting an information card in an image according to an embodiment of the present application. As shown in FIG. 1, the method can include the following processing.
  • Step 101 performing line detection in an information card image, and obtaining four sides of the information card The two endpoints of the corresponding one line segment.
  • the complete line segment of each of the four sides of the information card may not be obtained, corresponding to a certain piece.
  • the side perhaps only a part of the line segment of the edge may be detected, or one end of the detected line segment is beyond a portion of the edge, etc., but at least a part of it overlaps the edge.
  • two endpoints of the line segment can be recorded for each detected line segment.
  • Step 102 Generate a line equation corresponding to the edge of each line according to the two end points of the line segment corresponding to each edge, and obtain four intersection coordinates according to the line equation corresponding to the four sides of the information card.
  • the straight line equation is first calculated according to the end point of the line segment, and then four cards of the information card image are calculated according to the four line equations. Intersection coordinates.
  • Step 103 Map the four intersection coordinates to four corner points of a standard rectangular frame of the set information card to obtain a perspective transformation matrix.
  • a standard rectangular frame of the information card may be first set, and the standard rectangular frame has a set proportional relationship with the size of the actual information card.
  • the perspective transformation method can be used to map the four intersection coordinates obtained in step 102 to the four corner points of the standard rectangular frame, thereby obtaining a perspective transformation matrix.
  • Step 104 Perform perspective transformation on the image content surrounded by the four straight lines represented by the four linear equations according to the perspective transformation matrix.
  • the size calibration of the deformed information card image can be realized.
  • the size matching is adopted, and the requirement for the user's cooperation degree can be reduced.
  • Step 105 using a gradient template created according to the information content layout on the information card, The transformed image content is subjected to gradient template matching, and according to the matching result, it is determined whether the image content is a correct information card.
  • Figure 2 shows the layout of the information content of an identity card.
  • the area on the ID card showing the name, gender, ethnicity, date of birth, address, and citizenship number is the information content area, and the area on the ID card that does not display any information is the non-information content area.
  • the present embodiment when creating a gradient template, it is considered that part or all of the information content area in the information card is used as the first gradient area, and part or all of the non-information content area in the information card is used as the second gradient area.
  • the area indicated by the numeral 1 may be determined as the first gradient area
  • the area indicated by the numeral 2 may be determined as the second gradient area.
  • a gradient threshold for detecting an information card in the image may be respectively determined according to an average gradient of the first gradient region and an average gradient of the second gradient region, that is, according to the information content region set on the information card (ie, the first gradient)
  • the area is determined by the first gradient threshold
  • the second gradient threshold is determined according to the non-information content area (ie, the second gradient area) set on the information card.
  • the first region corresponding to the first gradient region and the second region corresponding to the second gradient region may be proportionally determined in the perspective-transformed image content according to the information content layout on the information card.
  • the image content in the first region is subjected to an average gradient value calculation to obtain a first average gradient value; and the image content in the second region is subjected to an average gradient value calculation to obtain a second average gradient value.
  • determining whether the first average gradient value is greater than the first gradient threshold, and whether the second average gradient value is less than the second gradient threshold, if the first average gradient value is greater than the first gradient a threshold, and the second average gradient value is smaller than the second gradient threshold then determining that the transformed image content is a correct information card; otherwise, determining The transformed image content is not the correct information card.
  • the above-described method of gradient matching can increase the processing speed by 10 times compared with the template matching method, and no false detection occurs.
  • step 100 may be further performed before the step 101: generating an information card placement area frame on the user interface, for instructing the user to place an information card in the area frame.
  • the photographing is performed, and the information card image is acquired under the guidance of the information card placement area frame.
  • FIG. 3 is a schematic diagram of an indication of an information card placement area frame in an embodiment of the present application. As shown in FIG. 3, the rectangular frame indicated by reference numeral 3 is an information card placement area frame in an example of the present application.
  • step 101 line detection can be performed in the vicinity of the position corresponding to the information card placement area frame.
  • a detection range is respectively set for each side of the corresponding information card placement area frame, as indicated by the numerals 31, 32, 33, 34 shown in FIG.
  • the area, that is, step 101, can perform line detection on the information card image within a predetermined range corresponding to each side of the information card placement area frame, thereby further increasing the speed of detection.
  • the foregoing methods may all be performed on the client side.
  • a client-side application APP
  • the client performs steps 101 to 105.
  • the client performs steps 100 through 105.
  • the foregoing method may be mainly performed on the server side.
  • the client may be responsible for uploading the image of the user's information card to the server side, and the server side performs step 101 to step 105.
  • step 100 is also done on the client side.
  • the information card image is obtained under the guidance of an information card placement area frame.
  • Information card image the server may perform line detection on the information card image within a predetermined range corresponding to each side of the information card placement area frame.
  • FIG. 4 is an exemplary structural diagram of an apparatus for detecting an information card in an image according to an embodiment of the present application. As shown by the solid line portion in FIG. 4, the apparatus may include a line detection module 401, an intersection calculation module 402, a transformation matrix calculation module 403, a perspective transformation module 404, and a template matching module 405.
  • the line detection module 401 is configured to perform line detection in an information card image to obtain two end points of a line segment corresponding to each of the four sides of the information card.
  • the intersection calculation module 402 is configured to generate a line equation corresponding to the edge of each line according to the two end points of the line segment corresponding to each edge; and obtain four intersection coordinates according to the line equation corresponding to the four sides of the information card.
  • the transformation matrix calculation module 403 is configured to map the four intersection coordinates onto the four corner points of the standard rectangular frame of the information card to obtain a perspective transformation matrix.
  • the perspective transformation module 404 is configured to perform perspective transformation on the image content surrounded by the four straight lines represented by the four linear equations according to the perspective transformation matrix.
  • the template matching module 405 is configured to perform gradient template matching on the perspective-transformed image content by using a gradient template created according to the information content layout on the information card, and determine whether the image content is a correct information card according to the matching result.
  • the gradient template created according to the information content layout on the information card may include: a first gradient region of the correspondingly set information content region determined according to the information content layout on the information card and correspondingly set non-information a second gradient region of the content region, and a first gradient threshold determined according to an average gradient of the first gradient region and according to the second gradient region The average gradient determines the second gradient threshold.
  • the template matching module 405 can include: an area determining sub-module 4051, an average gradient value calculating sub-module 4052, and a result determining sub-module 4053.
  • the area determining sub-module 4051 is configured to proportionally determine a first area corresponding to the first gradient area and a second area corresponding to the second gradient area in the perspective-transformed image content according to the information content layout on the information card.
  • the average gradient value calculation sub-module 4052 is configured to perform average gradient value calculation on the image content in the first region to obtain a first average gradient value, and perform average gradient value calculation on the image content in the second region to obtain a second average gradient value.
  • the result judging sub-module 4053 is configured to determine that the transformed image content is correct when the first average gradient value is greater than the first gradient threshold and the second average gradient value is smaller than the second gradient threshold Information card; otherwise, it is determined that the transformed image content is not the correct information card.
  • the device shown in the solid line of Figure 4 can be implemented on the client side or on the server side. If implemented on the server side, the client may upload the acquired information card image of the user to the server side.
  • the apparatus may further include a user interface module 406 and an image acquisition module 407 as shown in the dashed line portion.
  • the user interface module 406 is configured to generate an information card placement area frame for instructing the user to place an information card in the area frame for shooting.
  • the user interface module 406 and the image acquisition module 407 shown in the broken line portion in FIG. 4 are implemented on the client side.
  • the client side uploads the information card image acquired under the guidance of the information card placement area frame to the service.
  • the server side can perform line detection on the information card image in a predetermined range corresponding to each side of the information card placement area frame to improve the detection speed.
  • the client side may further include a sending module (not shown) for transmitting the information card image acquired by the image obtaining module 407 to the server; correspondingly, the server side may further include receiving A module (not shown) for receiving the information card image and providing the information card image to the line detection module 401.
  • FIG. 5 is an exemplary structural diagram of a system for detecting an information card in an image according to an embodiment of the present application. As shown in FIG. 5, the system includes a client 501 and a server 502.
  • the client 501 is configured to provide an information card image to the server 502.
  • the server 502 is configured to perform line detection on the information card image to obtain two end points of a line segment corresponding to each of four sides of the information card; and generate corresponding edges according to two end points of the line segment corresponding to each side a straight line equation; according to the straight line equation corresponding to the four sides of the information card, four intersection coordinates are obtained; the four intersection coordinates are mapped to the four corner points of the standard rectangular frame of the information card to obtain a perspective transformation matrix; Transforming the matrix, performing perspective transformation on the image content surrounded by the four straight lines represented by the four linear equations; using the gradient template created according to the information content layout on the information card, performing gradient template matching on the perspective transformed image content, according to the matching result And determining whether the image content is the correct information card.
  • the gradient template created according to the information content layout on the information card may include: a first gradient region corresponding to the setting information content region and a corresponding setting non-information content region determined according to the information content layout on the information card a second gradient region, and a first gradient threshold determined according to an average gradient of the first gradient region and a second gradient threshold determined according to an average gradient of the second gradient region;
  • the server 502 is configured to, according to the information content layout on the information card, proportionally determine a first region corresponding to the first gradient region and a second region corresponding to the second gradient region in the perspective-transformed image content; Average content of image content in an area Calculating, obtaining a first average gradient value; performing average gradient value calculation on the image content in the second region to obtain a second average gradient value; wherein the first average gradient value is greater than the first gradient threshold, and the When the two average gradient values are smaller than the second gradient threshold, determining that the transformed image content is a correct information card; otherwise, determining that the transformed image content is not the correct information card.
  • the client 501 is configured to generate an information card placement area frame on the user interface, to instruct the user to place an information card in the area frame for shooting; and in the information card placement area box
  • the information card image is obtained under the guidance, and the acquired information card image is uploaded to the server 502.
  • the server 502 can be configured to perform line detection on the information card image within a predetermined range corresponding to each side of the information card placement area frame.
  • each of the embodiments of the present application can be implemented by a data processing program executed by a data processing device such as a computer.
  • the data processing program constitutes the present application.
  • a data processing program usually stored in a storage medium is executed by directly reading a program out of a storage medium or by installing or copying the program to a storage device (such as a hard disk and or a memory) of the data processing device. Therefore, such a storage medium also constitutes the present application.
  • the storage medium can use any type of recording method, such as paper storage medium (such as paper tape, etc.), magnetic storage medium (such as floppy disk, hard disk, flash memory, etc.), optical storage medium (such as CD-ROM, etc.), magneto-optical storage medium (such as MO, etc.).
  • paper storage medium such as paper tape, etc.
  • magnetic storage medium such as floppy disk, hard disk, flash memory, etc.
  • optical storage medium such as CD-ROM, etc.
  • magneto-optical storage medium Such as MO, etc.
  • FIG. 6 is a schematic structural diagram of a client device according to an embodiment of the present application.
  • the client device can be used to implement the method shown in FIG. 1 and the device shown in FIG.
  • the client device can include a processor 601, a non-transitory computer readable memory 602, a display unit 603, a network communication interface 604, an I/O interface 605, and a camera 606. These components communicate over bus 607.
  • the memory 602 stores a plurality of program modules, for example, an operating system. 608, I/O module 609, network communication module 610, and application module 611.
  • the processor 601 can read various modules included in the application module 611 in the memory 602 to perform various functional applications and data processing of the terminal device.
  • the processor 601 in this embodiment may be one or multiple, and may be a CPU, a processing unit/module, an ASIC, a logic module, or a programmable gate array.
  • the operating system 608 includes, but is not limited to, an Android operating system, a Windows operating system, an Apple iOS operating system, an Apple Mac OS operating system, and the like.
  • the application 611 can include various functional modules in the apparatus shown in FIG. 4 and form a corresponding set of computer executable instructions 612 and corresponding metadata and heuristic algorithms 613. These sets of computer executable instructions may be executed by the processor 601 and perform the functions of the method illustrated in FIG. 1 or the apparatus illustrated in FIG.
  • the network communication interface 604 cooperates with the network communication module 610 to complete transmission and reception of various network signals of the terminal device, including information card image data transmission and network data interaction with the server.
  • the display unit 603 has a display panel for completing input and display of related information, including displaying an information card placement area frame and an acquired information card image.
  • the I/O interface 605 is connected to the camera 606. In addition, there are other I/O interfaces for connecting with other input/output devices such as touch panels (such as touch screens).
  • the I/O interface 605 transmits the information card image data received from the camera 606 to the I/O module 609 for processing.
  • the application module 611 can include various functional modules of the dashed portion of the device shown in FIG. Alternatively, individual functional modules of the solid line portion of the apparatus shown in FIG. 4 may also be included. Alternatively, each functional module of the dotted line portion and the solid line portion of the apparatus shown in Fig. 4 may be simultaneously included. These functional modules may be computer executable instructions that are executed by the processor 601.
  • the image obtaining module 407 can be used to acquire the image acquired by the camera 606 through the I/O module 609. Information card image data.
  • FIG. 7 is a schematic structural diagram of a server device according to an embodiment of the present application.
  • the server device may include a processor 701, a non-volatile computer readable memory 702, an input-output controller 703, and a network communication interface 704. These components communicate over bus 705.
  • a plurality of program modules such as an operating system 706, a network communication module 707, and an application module 708, are stored in the memory 702.
  • the processor 701 can read various modules (not shown) in the application in the memory 702 to perform various functional applications and data processing of the server device.
  • the processor 701 in this embodiment may be one or multiple, and may be a CPU, a processing unit/module, an ASIC, a logic module, or a programmable gate array.
  • the input/output controller 703 has a display and an input device for performing input, output, display, and the like of related data.
  • Operating system 706 includes, but is not limited to, an Android operating system, a Symbian operating system, a Windows operating system, a Linux operating system, and the like.
  • the application module 708 can include various functional modules of the solid line portion of the device shown in FIG. These functional modules may be a computer executable instruction set 709 and corresponding metadata and heuristic algorithm 710 executed by the processor 701.
  • the network communication interface 704 cooperates with the network communication module 706 to complete transmission and reception of various network signals of the server device, including information card image data transmission and network data interaction with the client device.
  • the present application also provides a storage medium, such as a non-transitory computer readable storage medium, having stored therein a data processing program for performing any of the above-described embodiments of the present application.
  • the line equation corresponding to the side of the line can be obtained, and then the line equation corresponding to the four sides can be obtained according to the line equation corresponding to the four sides Get four intersection coordinates.
  • a perspective transformation matrix can be obtained; and further, the image content surrounded by the four straight lines represented by the four linear equations can be obtained according to the perspective transformation matrix.
  • the perspective transformation is performed, and thus, the image content of the image card that is deformed is converted into the image content of the standard information card. It can be seen that the technical solution in the embodiment of the present application can reduce the requirement for the user's cooperation degree because the automatic correction of the deformed image can be implemented. Then, using the gradient template created according to the information content layout on the information card, gradient template matching is performed on the perspective-transformed image content, so that whether the image content is a correct information card can be determined according to the matching result. It can be seen that the technical solution in the embodiment of the present application only performs gradient matching, so there is no need to scan the entire image content for matching, and the speed is faster.

Abstract

一种检测图像中信息卡的方法、装置及系统。其中,方法包括:在一信息卡图像中进行直线检测(101),根据检测到的四条边各自所对应的线段的两个端点,生成直线方程,并计算得到四个交点坐标(102);将所述四个交点坐标映射到信息卡的标准矩形框的四个角点上,得到透视变换矩阵(103),对四个直线方程表示的四条直线所包围的图像内容进行透视变换(104)。利用根据信息卡上的信息内容布局制作的梯度模板,对透视变换后的图像内容进行梯度模板匹配,根据匹配结果,确定所述图像内容是否为正确的信息卡(105)。所述检测图像中信息卡的方法、装置及系统能够降低对用户配合度的要求,并提高信息卡的检测速度。

Description

一种检测图像中信息卡的方法、装置和系统
本申请要求于2015年12月7日提交中国专利局、申请号为201510890003.1、发明名称为“一种检测图像中信息卡的方法、装置和系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像处理技术,特别是一种检测图像中信息卡的方法、装置和系统。
发明背景
随着互联网应用的普及,需要进行身份验证或信息交互的场合也越来越多。例如,在互联网金融应用中,有时需要上传用户的身份证图像以备身份检验或留存。又如,在有些生活类应用中,可能需要上传用户的社保卡、医保卡或驾驶证等图像以进行验证或留存等。
对于这些身份证、社保卡、医保卡或驾驶证等信息卡图像的检测,目前尚没有一种较好的识别方案,最多只能由人工来进行检测。目前对于图像中的身份证检测,有一种方法是:制作一身份证图像模板,使用模板匹配的方式搜索图像,以检测图像中的身份证。
但上述模板匹配的方法一方面对用户的配合度要求较高,即在与用户交互过程中需要用户高度配合,以使身份证在图像中和预设的大小、角度基本无偏差;另一方面,需要扫描整个图像内容进行匹配,速度慢,且容易出现无匹配。
发明内容
本申请实施例中一方面提供一种检测图像中信息卡的方法,另一方 面提供一种检测图像中信息卡的装置和系统,用以降低对用户配合度的要求,并提高处理速度。
本申请实施例中提供的一种检测图像中信息卡的方法,包括:
在一信息卡图像中进行直线检测,得到信息卡四条边各自所对应的一线段的两个端点;
根据每条边所对应的线段的两个端点,生成该条边对应的直线方程;
根据信息卡四条边对应的直线方程,得到四个交点坐标;
将所述四个交点坐标映射到信息卡的标准矩形框的四个角点上,得到透视变换矩阵;
根据所述透视变换矩阵,对四个直线方程表示的四条直线所包围的图像内容进行透视变换;
利用根据信息卡上的信息内容布局制作的梯度模板,对透视变换后的图像内容进行梯度模板匹配,根据匹配结果,确定所述图像内容是否为正确的信息卡。
本申请实施例中提供的一种检测图像中信息卡的装置,包括:处理器和存储器;所述存储器中存储有可被所述处理器执行的应用程序模块;所述应用程序模块包括:
直线检测模块,用于在一信息卡图像中进行直线检测,得到信息卡四条边各自所对应的一线段的两个端点;
交点计算模块,用于根据每条边所对应的线段的两个端点,生成该条边对应的直线方程;根据信息卡四条边对应的直线方程,得到四个交点坐标;
变换矩阵计算模块,用于将所述四个交点坐标映射到信息卡的标准矩形框的四个角点上,得到透视变换矩阵;
透视变换模块,用于根据所述透视变换矩阵,对四个直线方程表示 的四条直线所包围的图像内容进行透视变换;
模板匹配模块,用于利用根据信息卡上的信息内容布局制作的梯度模板,对透视变换后的图像内容进行梯度模板匹配,根据匹配结果,确定所述图像内容是否为正确的信息卡。
本申请实施例中提供的一种检测图像中信息卡的系统,包括:客户端和服务器;其中,
所述客户端用于将一信息卡图像提供给所述服务器;
所述服务器用于在所述信息卡图像中进行直线检测,得到信息卡四条边各自所对应的一线段的两个端点;根据每条边所对应的线段的两个端点,生成该条边对应的直线方程;根据信息卡四条边对应的直线方程,得到四个交点坐标;将所述四个交点坐标映射到信息卡的标准矩形框的四个角点上,得到透视变换矩阵;根据所述透视变换矩阵,对四个直线方程表示的四条直线所包围的图像内容进行透视变换;利用根据信息卡上的信息内容布局制作的梯度模板,对透视变换后的图像内容进行梯度模板匹配,根据匹配结果,确定所述图像内容是否为正确的信息卡。
附图简要说明
为了更清楚的说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来说,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。其中,
图1为本申请实施例中一种检测图像中信息卡的方法的示例性流程图;
图2为本申请实施例中一种身份证的信息内容布局示意图;
图3为本申请实施例中一种信息卡放置区域框的指示示意图;
图4为本申请实施例中一种检测图像中信息卡的装置的示例性结构图;
图5为本申请实施例中一种检测图像中信息卡的系统的示例性结构图;
图6为本申请实施例中一种客户端设备的结构示意图;
图7为本申请实施例中一种服务器设备的结构示意图。
实施本申请的方式
本申请实施例中,为了降低对用户的配合度要求,则需考虑信息卡在拍摄得到的信息卡图像中有可能会产生变形,例如,矩形的信息卡在信息卡图像中变为梯形等,为此在检测信息卡的图像内容之前,应首先对其进行尺寸进行校准,之后再对图像内容进行检测。
为使本申请的目的、技术方案和优点更加清楚,以下举实施例对本申请进一步详细说明。
为了描述上的简洁和直观,下文通过描述若干代表性的实施方式来对本申请的方案进行阐述。实施方式中大量的细节仅用于帮助理解本申请的方案。但是很明显,本申请的技术方案实现时可以不局限于这些细节。为了避免不必要地模糊了本申请的方案,一些实施方式没有进行细致地描述,而是仅给出了框架。下文中,“包括”是指“包括但不限于”,“根据……”是指“至少根据……,但不限于仅根据……”。由于汉语的语言习惯,下文中没有特别指出一个成分的数量时,意味着该成分可以是一个也可以是多个,或可理解为至少一个。
图1为本申请实施例中一种检测图像中信息卡的方法的示例性流程图。如图1所示,该方法可包括如下处理。
步骤101,在一信息卡图像中进行直线检测,得到信息卡四条边各 自所对应的一线段的两个端点。
本步骤中,考虑到信息卡图像的分辨率或拍摄时光线等的影响,在信息卡图像中进行直线检测时,不一定都能得到信息卡四条边中每条边的完整线段,对应某条边,也许只能检测到该条边的一部分线段,或者检测到的线段的某一端超出该条边一部分等,但不管怎样,其至少有一部分是与该条边相重合的。
本实施例中,对于检测到的每条线段可记录该线段的两个端点。
步骤102,根据每条边所对应的线段的两个端点,生成该条边对应的直线方程,根据信息卡四条边对应的直线方程,得到四个交点坐标。
本步骤中,正是考虑到步骤101中检测到的线段有可能比信息卡的边短,因此首先根据线段端点计算出直线方程,再根据四个直线方程计算出信息卡图像中卡片的四个交点坐标。
步骤103,将所述四个交点坐标映射到设定的信息卡的标准矩形框的四个角点上,得到透视变换矩阵。
本实施例中,可首先设定信息卡的一个标准矩形框,该标准矩形框与实际信息卡的尺寸具有设定的比例关系。则本步骤中,可利用透视变换方法,将步骤102中得到的四个交点坐标映射到该标准矩形框的四个角点上,从而得到透视变换矩阵。
步骤104,根据所述透视变换矩阵,对四个直线方程表示的四条直线所包围的图像内容进行透视变换。
本步骤中,通过将四个直线方程表示的四条直线所包围的图像内容利用步骤103中得到的透视变换矩阵进行透视变换,可实现对变形的信息卡图像的尺寸校准。本实施例中通过采用尺寸校准,可降低对用户配合度的要求。
步骤105,利用根据信息卡上的信息内容布局制作的梯度模板,对 透视变换后的图像内容进行梯度模板匹配,根据匹配结果,确定所述图像内容是否为正确的信息卡。
本实施例中,制作梯度模板的方法可有多种,下面列举其中一种:
考虑到对应某一类型的信息卡,其上的信息内容通常是固定布局的。例如,图2示出了一身份证的信息内容布局。如图2所示,该身份证上显示姓名、性别、民族、出生年月日、住址以及公民身份号码等的区域为信息内容区域,身份证上不显示任何信息的区域为非信息内容区域。
因此,本实施例中,在制作梯度模板时,考虑将信息卡中信息内容区域的部分或全部作为第一梯度区域,将信息卡中非信息内容区域的部分或全部作为第二梯度区域。例如,图2中,可将标号1指示的区域确定为第一梯度区域,将标号2指示的区域确定为第二梯度区域。之后,可根据第一梯度区域的平均梯度以及第二梯度区域的平均梯度分别确定一个用于检测图像中的信息卡的梯度阈值,即根据信息卡上设定的信息内容区域(即第一梯度区域)确定第一梯度阈值,根据信息卡上设定的非信息内容区域(即第二梯度区域)确定第二梯度阈值。至此,梯度模板制作完毕。
相应地,本步骤中,可首先根据信息卡上的信息内容布局,在透视变换后的图像内容中按比例确定出对应第一梯度区域的第一区域和对应第二梯度区域的第二区域。
然后,对第一区域内的图像内容进行平均梯度值计算,得到第一平均梯度值;对第二区域内的图像内容进行平均梯度值计算,得到第二平均梯度值。最后,判断所述第一平均梯度值是否大于所述第一梯度阈值,且所述第二平均梯度值是否小于所述第二梯度阈值,如果所述第一平均梯度值大于所述第一梯度阈值,且所述第二平均梯度值小于所述第二梯度阈值,则可确定所述变换后的图像内容为正确的信息卡;否则,确定 所述变换后的图像内容不是正确的信息卡。
在一个应用例子中,发现上述梯度匹配的方法相较模板匹配的方法,其处理速度可提高10倍,且不会出现误检。
本实施例中,为了进一步提高检测的速度,可在步骤101之前进一步执行如下步骤100:在用户界面上生成一信息卡放置区域框,用于指示用户将一信息卡置于所述区域框内进行拍摄,并在该信息卡放置区域框的引导下获取所述信息卡图像。
图3为本申请实施例中一种信息卡放置区域框的指示示意图。如图3所示,标号3指示的矩形框为本申请一个例子中的信息卡放置区域框。
相应地,步骤101中可在对应所述信息卡放置区域框的位置附近进行直线检测。考虑到用户放置卡片时的抖动或误差,本实施例中,对应信息卡放置区域框的每条边分别设置一个检测范围,如图3中所示的标号31、32、33、34所指示的区域,即步骤101中可在对应所述信息卡放置区域框的每条边的预定范围内,对所述信息卡图像中进行直线检测,从而进一步提高了检测的速度。
在一个应用例子中,采用本实施例中的技术方案,能够处理信息卡在图像中出现与预定直线正负5度以内的偏差,并能够处理与预定大小10%以内的尺寸误差。
实际应用中,上述方法可以全部在客户端侧完成,例如,可生成一个客户端侧的应用程序(APP),则该客户端执行步骤101至步骤105。如果还包括步骤100,则该客户端执行步骤100至步骤105。或者,上述方法也可以主要在服务器侧完成,此时客户端可主要负责将用户的信息卡图像上传给服务器侧,由服务器侧执行步骤101至步骤105。当然,如果还包括步骤100的话,则步骤100也在客户端侧完成。此时,对于服务器侧来说,所述信息卡图像为在一信息卡放置区域框的引导下获取 的信息卡图像;所述服务器可在对应所述信息卡放置区域框的每条边的预定范围内,对所述信息卡图像中进行直线检测。
下述为本申请装置实施例,可以用于执行本申请对应的方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例中的描述。
图4为本申请实施例中一种检测图像中信息卡的装置的示例性结构图。如图4中的实线部分所示,该装置可包括:直线检测模块401、交点计算模块402、变换矩阵计算模块403、透视变换模块404和模板匹配模块405。
其中,直线检测模块401用于在一信息卡图像中进行直线检测,得到信息卡四条边各自所对应的一线段的两个端点。
交点计算模块402用于根据每条边所对应的线段的两个端点,生成该条边对应的直线方程;根据信息卡四条边对应的直线方程,得到四个交点坐标。
变换矩阵计算模块403用于将所述四个交点坐标映射到信息卡的标准矩形框的四个角点上,得到透视变换矩阵。
透视变换模块404用于根据所述透视变换矩阵,对四个直线方程表示的四条直线所包围的图像内容进行透视变换。
模板匹配模块405用于利用根据信息卡上的信息内容布局制作的梯度模板,对透视变换后的图像内容进行梯度模板匹配,根据匹配结果,确定所述图像内容是否为正确的信息卡。
在一个实施方式中,根据信息卡上的信息内容布局制作的梯度模板可包括:根据信息卡上的信息内容布局确定的对应设定的信息内容区域的第一梯度区域和对应设定的非信息内容区域的第二梯度区域,以及根据第一梯度区域的平均梯度确定的第一梯度阈值和根据第二梯度区域 的平均梯度确定的第二梯度阈值。相应地,该模板匹配模块405可包括:区域确定子模块4051、平均梯度值计算子模块4052和结果判断子模块4053。
其中,区域确定子模块4051用于根据信息卡上的信息内容布局,在透视变换后的图像内容中按比例确定出对应第一梯度区域的第一区域和对应第二梯度区域的第二区域。
平均梯度值计算子模块4052用于对第一区域内的图像内容进行平均梯度值计算,得到第一平均梯度值;对第二区域内的图像内容进行平均梯度值计算,得到第二平均梯度值。
结果判断子模块4053用于在所述第一平均梯度值大于所述第一梯度阈值,且所述第二平均梯度值小于所述第二梯度阈值时,确定所述变换后的图像内容为正确的信息卡;否则,确定所述变换后的图像内容不是正确的信息卡。
图4实线部分所示装置可在客户端侧实现,也可在服务器侧实现。如果在服务器侧实现,则客户端可将获取的用户的信息卡图像上传给所述服务器侧。
进一步地,该装置可进一步如虚线部分所示包括:用户界面模块406和图像获取模块407。
其中,用户界面模块406用于生成一信息卡放置区域框,用于指示用户将一信息卡置于所述区域框内进行拍摄。
图像获取模块407用于获取一信息卡图像。
其中,对于图4中的虚线部分所示的用户界面模块406和图像获取模块407在客户端侧实现。
相应地,对于图4实线部分所示装置在服务器侧实现的情况,客户端侧将在一信息卡放置区域框的引导下获取的信息卡图像上传给服务 器侧,服务器侧可相应地在对应所述信息卡放置区域框的每条边的预定范围内,对所述信息卡图像中进行直线检测,以提高检测速度。此时,客户端侧可进一步包括一发送模块(图中未示出),用于将所述图像获取模块407获取的信息卡图像发送给所述服务器;相应地,服务器侧可进一步包括一接收模块(图中未示出),用于接收所述信息卡图像,并将所述信息卡图像提供给所述直线检测模块401。
图5为本申请实施例中一种检测图像中信息卡的系统的示例性结构图。如图5所示,该系统包括:客户端501和服务器502。
其中,客户端501用于将一信息卡图像提供给所述服务器502。
服务器502用于在所述信息卡图像中进行直线检测,得到信息卡四条边各自所对应的一线段的两个端点;根据每条边所对应的线段的两个端点,生成该条边对应的直线方程;根据信息卡四条边对应的直线方程,得到四个交点坐标;将所述四个交点坐标映射到信息卡的标准矩形框的四个角点上,得到透视变换矩阵;根据所述透视变换矩阵,对四个直线方程表示的四条直线所包围的图像内容进行透视变换;利用根据信息卡上的信息内容布局制作的梯度模板,对透视变换后的图像内容进行梯度模板匹配,根据匹配结果,确定所述图像内容是否为正确的信息卡。
在一个实施方式中,根据信息卡上的信息内容布局制作的梯度模板可包括:根据信息卡上的信息内容布局确定的对应设定信息内容区域的第一梯度区域和对应设定非信息内容区域的第二梯度区域,以及根据第一梯度区域的平均梯度确定的第一梯度阈值和根据第二梯度区域的平均梯度确定的第二梯度阈值;
相应地,服务器502可用于根据信息卡上的信息内容布局,在透视变换后的图像内容中按比例确定出对应第一梯度区域的第一区域和对应第二梯度区域的第二区域;对第一区域内的图像内容进行平均梯度值 计算,得到第一平均梯度值;对第二区域内的图像内容进行平均梯度值计算,得到第二平均梯度值;在所述第一平均梯度值大于所述第一梯度阈值,且所述第二平均梯度值小于所述第二梯度阈值时,确定所述变换后的图像内容为正确的信息卡;否则,确定所述变换后的图像内容不是正确的信息卡。
在一个实施方式中,客户端501可用于在用户界面上生成一信息卡放置区域框,用于指示用户将一信息卡置于所述区域框内进行拍摄;并在所述信息卡放置区域框的引导下获取所述信息卡图像,将获取的信息卡图像上传给服务器502。相应地,服务器502可用于在对应所述信息卡放置区域框的每条边的预定范围内,对所述信息卡图像中进行直线检测。
另外,本申请的每一个实施例可以通过由数据处理设备如计算机执行的数据处理程序来实现。显然,数据处理程序构成了本申请。此外,通常存储在一个存储介质中的数据处理程序通过直接将程序读取出存储介质或者通过将程序安装或复制到数据处理设备的存储设备(如硬盘和或内存)中执行。因此,这样的存储介质也构成了本申请。存储介质可以使用任何类型的记录方式,例如纸张存储介质(如纸带等)、磁存储介质(如软盘、硬盘、闪存等)、光存储介质(如CD-ROM等)、磁光存储介质(如MO等)等。
例如,图6为本申请实施例中一种客户端设备的结构示意图。如图6所示,该客户端设备可用于实现图1所示方法以及图4所示装置。如图6所示,该客户端设备可包括:处理器601、非易失性计算机可读存储器602、显示单元603、网络通信接口604、I/O接口605和摄像头606。这些组件通过总线607进行通信。
本实施例中,存储器602中存储有多个程序模块,例如:操作系统 608、I/O模块609、网络通信模块610和应用程序模块611。
处理器601可以读取存储器602中的应用程序模块611所包括的各种模块来执行终端设备的各种功能应用以及数据处理。本实施例中的处理器601可以为一个,也可以为多个,其可以为CPU,处理单元/模块,ASIC,逻辑模块或可编程门阵列等。
其中,操作系统608包括但不限于:Android操作系统、Windows操作系统、苹果iOS操作系统、苹果Mac OS操作系统等等。
应用程序611可包括图4所示装置中的各个功能模块,并形成对应的计算机可执行指令集612及对应的元数据和启发式算法613。这些计算机可执行指令集可以由所述处理器601执行并完成图1所示方法或图4所示装置的功能。
在本实施例中,网络通信接口604与网络通信模块610相配合完成终端设备各种网络信号的收发,包括与服务器之间的信息卡图像数据传输及网络数据交互等。
显示单元603具有一显示面板,用于完成相关信息的输入及显示,包括显示信息卡放置区域框以及获取的信息卡图像。
在本申请实施例中,I/O接口605与摄像头606相连。此外,还可以有其它的I/O接口,用于与其它输入/输出设备,如触控面板(如触摸屏)等连接。I/O接口605将从摄像头606接收到的信息卡图像数据发送给I/O模块609进行处理。
应用程序模块611可包括图4所示装置中的虚线部分的各个功能模块。或者,也可包括图4所示装置中的实线部分的各个功能模块。又或者,还可同时包括图4所示装置中虚线部分和实线部分的各个功能模块。这些功能模块可以为由所述处理器601来执行的计算机可执行指令。其中,图像获取模块407可用于通过I/O模块609获取摄像头606采集的 信息卡图像数据。
图7为本申请实施例中一种服务器设备的结构示意图。如图7所示,该服务器设备可包括:处理器701、非易失性计算机可读存储器702、输入输出控制器703、网络通信接口704。这些组件通过总线705进行通信。
本实施例中,存储器702中存储有多个程序模块,如操作系统706、网络通信模块707和应用程序模块708。
处理器701可以读取存储器702中的应用程序中的各种模块(图中未示出)来执行服务器设备的各种功能应用以及数据处理。本实施例中的处理器701可以为一个,也可以为多个,其可以为CPU,处理单元/模块,ASIC,逻辑模块或可编程门阵列等。
输入输出控制器703具有显示器和输入设备,用于完成相关数据的输入、输出及显示等。
操作系统706包括但不限于:Android操作系统、Symbian操作系统、Windows操作系统、Linux操作系统等等。
应用程序模块708可包括图4所示装置中的实线部分的各个功能模块。这些功能模块可以为由所述处理器701来执行的计算机可执行指令集709及对应的元数据和启发式算法710。
本实施例中,网络通信接口704与网络通信模块706相配合完成服务器设备各种网络信号的收发,包括与客户端设备之间的信息卡图像数据传输及网络数据交互等。
本申请还提供了一种存储介质,如非易失性计算机可读存储介质,其中存储有数据处理程序,该数据处理程序用于执行本申请上述方法的任何一种实施例。
可见,本申请实施例中,通过在一信息卡图像中进行直线检测可得 到拍摄变形的信息卡四条边中每条边对应的线段的两个端点,根据每条边对应的线段的两个端点可得到该条边对应的直线方程,进而可根据四条边对应的直线方程得到四个交点坐标。通过将四个交点坐标映射到信息卡的标准矩形框的四个角点上,可得到一透视变换矩阵;进而可根据该透视变换矩阵,对四个直线方程表示的四条直线所包围的图像内容进行透视变换,至此,拍摄变形的信息卡的图像内容被转换为标准信息卡的图像内容。可见,本申请实施例中的技术方案由于可实现变形图像的自动校正,因此可降低对用户配合度的要求。之后再利用根据信息卡上的信息内容布局制作的梯度模板,对透视变换后的图像内容进行梯度模板匹配,从而可根据匹配结果确定所述图像内容是否为正确的信息卡。可见,本申请实施例中的技术方案仅对进行梯度匹配,因此无需扫描整个图像内容进行匹配,速度较快。
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。

Claims (11)

  1. 一种检测图像中信息卡的方法,其特征在于,包括:
    在一信息卡图像中进行直线检测,得到信息卡四条边各自所对应的一线段的两个端点;
    根据每条边所对应的线段的两个端点,生成该条边对应的直线方程;
    根据信息卡四条边对应的直线方程,得到四个交点坐标;
    将所述四个交点坐标映射到信息卡的标准矩形框的四个角点上,得到透视变换矩阵;
    根据所述透视变换矩阵,对四个直线方程表示的四条直线所包围的图像内容进行透视变换;
    利用根据信息卡上的信息内容布局制作的梯度模板,对透视变换后的图像内容进行梯度模板匹配,根据匹配结果,确定所述图像内容是否为正确的信息卡。
  2. 根据权利要求1所述的方法,其特征在于,所述根据信息卡上的信息内容布局制作的梯度模板包括:根据信息卡上的信息内容布局确定的对应设定信息内容区域的第一梯度区域和对应设定非信息内容区域的第二梯度区域,以及根据第一梯度区域的平均梯度确定的第一梯度阈值和根据第二梯度区域的平均梯度确定的第二梯度阈值;
    所述利用根据信息卡上的信息内容布局制作的梯度模板,对透视变换后的图像内容进行梯度模板匹配,根据匹配结果,确定所述图像内容是否为正确的信息卡,包括:
    根据信息卡上的信息内容布局,在透视变换后的图像内容中按比例确定出对应第一梯度区域的第一区域和对应第二梯度区域的第二区域;
    对第一区域内的图像内容进行平均梯度值计算,得到第一平均梯度 值;
    对第二区域内的图像内容进行平均梯度值计算,得到第二平均梯度值;
    若所述第一平均梯度值大于所述第一梯度阈值,且所述第二平均梯度值小于所述第二梯度阈值,则确定所述变换后的图像内容为正确的信息卡;否则,确定所述变换后的图像内容不是正确的信息卡。
  3. 根据权利1或2所述的方法,其特征在于,所述信息卡图像为在一信息卡放置区域框的引导下获取的信息卡图像;所述信息卡放置区域框用于指示用户将一信息卡置于所述区域框内进行拍摄;
    所述在信息卡图像中进行直线检测包括:在对应所述信息卡放置区域框的每条边的预定范围内,对所述信息卡图像中进行直线检测。
  4. 根据权利1或2所述的方法,其特征在于,该方法进一步包括:在用户界面上生成一信息卡放置区域框,用于指示用户将一信息卡置于所述区域框内进行拍摄;
    获取一信息卡图像;
    所述在信息卡图像中进行直线检测包括:在对应所述信息卡放置区域框的每条边的预定范围内,对所述信息卡图像中进行直线检测。
  5. 一种检测图像中信息卡的装置,其特征在于,包括:处理器和存储器;所述存储器中存储有可被所述处理器执行的应用程序模块;所述应用程序模块包括:
    直线检测模块,用于在一信息卡图像中进行直线检测,得到信息卡四条边各自所对应的一线段的两个端点;
    交点计算模块,用于根据每条边所对应的线段的两个端点,生成该条边对应的直线方程;根据信息卡四条边对应的直线方程,得到四个交点坐标;
    变换矩阵计算模块,用于将所述四个交点坐标映射到信息卡的标准矩形框的四个角点上,得到透视变换矩阵;
    透视变换模块,用于根据所述透视变换矩阵,对四个直线方程表示的四条直线所包围的图像内容进行透视变换;
    模板匹配模块,用于利用根据信息卡上的信息内容布局制作的梯度模板,对透视变换后的图像内容进行梯度模板匹配,根据匹配结果,确定所述图像内容是否为正确的信息卡。
  6. 根据权利要求5所述的装置,其特征在于,所述根据信息卡上的信息内容布局制作的梯度模板包括:根据信息卡上的信息内容布局确定的对应设定信息内容区域的第一梯度区域和对应设定非信息内容区域的第二梯度区域,以及根据第一梯度区域的平均梯度确定的第一梯度阈值和根据第二梯度区域的平均梯度确定的第二梯度阈值;
    所述模板匹配模块包括:
    区域确定子模块,用于根据信息卡上的信息内容布局,在透视变换后的图像内容中按比例确定出对应第一梯度区域的第一区域和对应第二梯度区域的第二区域;
    平均梯度值计算子模块,用于对第一区域内的图像内容进行平均梯度值计算,得到第一平均梯度值;对第二区域内的图像内容进行平均梯度值计算,得到第二平均梯度值;
    结果判断子模块,用于在所述第一平均梯度值大于所述第一梯度阈值,且所述第二平均梯度值小于所述第二梯度阈值时,确定所述变换后的图像内容为正确的信息卡;否则,确定所述变换后的图像内容不是正确的信息卡。
  7. 根据权利5或6所述的装置,其特征在于,所述信息卡图像为在一信息卡放置区域框的引导下获取的信息卡图像;所述信息卡放置区域 框用于指示用户将一信息卡置于所述区域框内进行拍摄;
    所述直线检测模块用于在对应所述信息卡放置区域框的每条边的预定范围内,对所述信息卡图像中进行直线检测。
  8. 根据权利5或6所述的装置,其特征在于,所述应用程序模块进一步包括:用户界面模块,用于生成一信息卡放置区域框,用于指示用户将一信息卡置于所述区域框内进行拍摄;和
    图像获取模块,用于获取一信息卡图像;
    所述直线检测模块用于在对应所述信息卡放置区域框的每条边的预定范围内,对所述信息卡图像中进行直线检测。
  9. 一种检测图像中信息卡的系统,其特征在于,包括:客户端和服务器;其中,
    所述客户端用于将一信息卡图像提供给所述服务器;
    所述服务器用于在所述信息卡图像中进行直线检测,得到信息卡四条边各自所对应的一线段的两个端点;根据每条边所对应的线段的两个端点,生成该条边对应的直线方程;根据信息卡四条边对应的直线方程,得到四个交点坐标;将所述四个交点坐标映射到信息卡的标准矩形框的四个角点上,得到透视变换矩阵;根据所述透视变换矩阵,对四个直线方程表示的四条直线所包围的图像内容进行透视变换;利用根据信息卡上的信息内容布局制作的梯度模板,对透视变换后的图像内容进行梯度模板匹配,根据匹配结果,确定所述图像内容是否为正确的信息卡。
  10. 根据权利要求9所述的系统,其特征在于,所述客户端用于在用户界面上生成一信息卡放置区域框,用于指示用户将一信息卡置于所述区域框内进行拍摄;并在所述信息卡放置区域框的引导下获取所述信息卡图像;
    所述服务器用于在对应所述信息卡放置区域框的每条边的预定范围 内,对所述信息卡图像中进行直线检测。
  11. 一种计算机可读存储介质,其特征在于,存储有计算机程序代码,所述计算机程序代码能够被一计算机单元所执行,并使得所述计算机单元执行如权利要求1至4中任一项所述的检测图像中信息卡的方法。
PCT/CN2016/083100 2015-12-07 2016-05-24 一种检测图像中信息卡的方法、装置和系统 WO2017096759A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/715,579 US10410053B2 (en) 2015-12-07 2017-09-26 Method, apparatus, system, and storage medium for detecting information card in image

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510890003.1 2015-12-07
CN201510890003.1A CN106845508B (zh) 2015-12-07 2015-12-07 一种检测图像中信息卡的方法、装置和系统

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/715,579 Continuation US10410053B2 (en) 2015-12-07 2017-09-26 Method, apparatus, system, and storage medium for detecting information card in image

Publications (1)

Publication Number Publication Date
WO2017096759A1 true WO2017096759A1 (zh) 2017-06-15

Family

ID=59012628

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/083100 WO2017096759A1 (zh) 2015-12-07 2016-05-24 一种检测图像中信息卡的方法、装置和系统

Country Status (3)

Country Link
US (1) US10410053B2 (zh)
CN (1) CN106845508B (zh)
WO (1) WO2017096759A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116681721A (zh) * 2023-06-07 2023-09-01 东南大学 一种基于视觉的直线轨迹检测与跟踪方法

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6885896B2 (ja) * 2017-04-10 2021-06-16 富士フイルム株式会社 自動レイアウト装置および自動レイアウト方法並びに自動レイアウトプログラム
CN107862345B (zh) * 2017-12-01 2020-05-08 北京智芯原动科技有限公司 一种车牌比对方法及装置
CN109472202A (zh) * 2018-09-29 2019-03-15 天津大学 一种基于车载摄像头的路面标志检测方法
CN109360205B (zh) * 2018-12-07 2021-08-31 泰康保险集团股份有限公司 双录视频质检方法、装置、介质和电子设备
CN110796602B (zh) * 2019-10-30 2021-08-31 福州大学 一种用于降低图像透视变换后失真的方法
CN111368820A (zh) * 2020-03-06 2020-07-03 腾讯科技(深圳)有限公司 文本标注方法、装置及存储介质
CN114118949B (zh) * 2021-11-09 2023-06-27 北京市燃气集团有限责任公司 一种票据的信息处理系统和方法
CN117237957A (zh) * 2023-11-16 2023-12-15 新视焰医疗科技(杭州)有限公司 用于检测文件方向并对倾斜或畸形文件矫正的方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1055446A (ja) * 1996-08-09 1998-02-24 Omron Corp 物体認識装置
CN1794267A (zh) * 2005-12-29 2006-06-28 兆日科技(深圳)有限公司 用于防伪信息识别过程中矩形框定位的方法
US20090185715A1 (en) * 2008-01-18 2009-07-23 Mvtec Software Gmbh System and method for deformable object recognition
CN103488984A (zh) * 2013-10-11 2014-01-01 从兴技术有限公司 基于智能移动设备的二代身份证识别方法及装置
CN105046184A (zh) * 2015-07-22 2015-11-11 福建新大陆自动识别技术有限公司 基于畸变图像校正的二维码解码方法和系统

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8098936B2 (en) * 2007-01-12 2012-01-17 Seiko Epson Corporation Method and apparatus for detecting objects in an image
CN101414356B (zh) * 2007-10-17 2010-09-15 中国科学院自动化研究所 基于模板匹配的信息填涂卡识别方法
CN101625760A (zh) * 2009-07-28 2010-01-13 谭洪舟 一种证件图像倾斜校正的办法
US8600167B2 (en) * 2010-05-21 2013-12-03 Hand Held Products, Inc. System for capturing a document in an image signal
US10402898B2 (en) * 2011-05-04 2019-09-03 Paypal, Inc. Image-based financial processing
US9418304B2 (en) * 2011-06-29 2016-08-16 Qualcomm Incorporated System and method for recognizing text information in object
CN102306415B (zh) * 2011-08-01 2013-06-26 广州广电运通金融电子股份有限公司 便携式有价文件识别装置
CN103106663B (zh) * 2013-02-19 2015-12-09 公安部第三研究所 计算机系统中基于图像处理实现sim卡缺陷检测的方法
CN104217444B (zh) * 2013-06-03 2018-06-05 支付宝(中国)网络技术有限公司 定位卡片区域的方法和设备
US8837833B1 (en) * 2013-06-30 2014-09-16 Google Inc. Payment card OCR with relaxed alignment
CN103679702B (zh) * 2013-11-20 2016-08-31 华中科技大学 一种基于图像边缘矢量的匹配方法
CN103679638A (zh) * 2013-12-25 2014-03-26 广州广电运通金融电子股份有限公司 残缺或变形的四边形图像的校正方法
CN104268872B (zh) * 2014-09-25 2017-05-17 北京航空航天大学 基于一致性的边缘检测方法
CN105117680B (zh) * 2015-05-04 2019-06-14 小米科技有限责任公司 一种识别信息卡的信息的方法和装置
CN104933401A (zh) * 2015-05-08 2015-09-23 小米科技有限责任公司 一种图像识别的方法和装置
WO2016207875A1 (en) * 2015-06-22 2016-12-29 Photomyne Ltd. System and method for detecting objects in an image

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1055446A (ja) * 1996-08-09 1998-02-24 Omron Corp 物体認識装置
CN1794267A (zh) * 2005-12-29 2006-06-28 兆日科技(深圳)有限公司 用于防伪信息识别过程中矩形框定位的方法
US20090185715A1 (en) * 2008-01-18 2009-07-23 Mvtec Software Gmbh System and method for deformable object recognition
CN103488984A (zh) * 2013-10-11 2014-01-01 从兴技术有限公司 基于智能移动设备的二代身份证识别方法及装置
CN105046184A (zh) * 2015-07-22 2015-11-11 福建新大陆自动识别技术有限公司 基于畸变图像校正的二维码解码方法和系统

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116681721A (zh) * 2023-06-07 2023-09-01 东南大学 一种基于视觉的直线轨迹检测与跟踪方法
CN116681721B (zh) * 2023-06-07 2023-12-29 东南大学 一种基于视觉的直线轨迹检测与跟踪方法

Also Published As

Publication number Publication date
US20180018512A1 (en) 2018-01-18
CN106845508A (zh) 2017-06-13
CN106845508B (zh) 2019-05-17
US10410053B2 (en) 2019-09-10

Similar Documents

Publication Publication Date Title
WO2017096759A1 (zh) 一种检测图像中信息卡的方法、装置和系统
US10943140B2 (en) Image processing to detect a rectangular object
WO2019100814A1 (zh) 辅助物品的图像合规的方法、装置和电子设备
KR101899530B1 (ko) 분산 광학 문자 인식 및 분산 기계 언어번역을 위한 기법들
CN110869944B (zh) 使用移动设备读取测试卡
US11048913B2 (en) Focusing method, device and computer apparatus for realizing clear human face
KR101856119B1 (ko) 분산 광학 문자 인식 및 분산 기계 언어번역을 위한 기법들
WO2017067275A1 (zh) 一种文档图片显示方法、装置及终端
US9734591B2 (en) Image data processing method and electronic device supporting the same
US10339334B2 (en) Augmented reality captcha
US20170118451A1 (en) Information processing apparatus, image projection system, and computer program product
US11017552B2 (en) Measurement method and apparatus
WO2019200807A1 (zh) 图像合成装置、方法及计算机可读存储介质
US10803617B2 (en) Method and system for detecting and correcting an orientation of an image
US20190005323A1 (en) Information processing apparatus for tracking processing
US10834281B2 (en) Document size detecting by matching between image of entire document and read size image
US20220408165A1 (en) Interactive broadcast media content provider with direct audience interaction
US9983569B2 (en) System and method for representing a field of capture as physical media
WO2021098346A1 (zh) 人体朝向检测方法、装置、电子设备和计算机存储介质
US10877641B2 (en) Image adjustment method, apparatus, device and computer readable storage medium
US20230237687A1 (en) Product identification apparatus, product identification method, and non-transitory computer-readable medium
WO2021073576A1 (zh) 一种智能验车的方法及系统、计算机设备与存储介质
KR20160008407A (ko) 문자 인식 장치 및 방법
WO2022027191A1 (zh) 平面矫正方法及装置、计算机可读介质和电子设备
CN110795711A (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: 16871964

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 29/10/2018)

122 Ep: pct application non-entry in european phase

Ref document number: 16871964

Country of ref document: EP

Kind code of ref document: A1