CN112801165B - Card review method and device - Google Patents
Card review method and device Download PDFInfo
- Publication number
- CN112801165B CN112801165B CN202110090570.4A CN202110090570A CN112801165B CN 112801165 B CN112801165 B CN 112801165B CN 202110090570 A CN202110090570 A CN 202110090570A CN 112801165 B CN112801165 B CN 112801165B
- Authority
- CN
- China
- Prior art keywords
- image
- card
- detected
- deviation
- characteristic information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/74—Image or video pattern matching; Proximity measures in feature spaces
- G06V10/75—Organisation 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/751—Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/10—Office automation; Time management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/02—Banking, e.g. interest calculation or account maintenance
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/22—Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/44—Local 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
- G06V10/443—Local 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 by matching or filtering
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Strategic Management (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Multimedia (AREA)
- Economics (AREA)
- Human Resources & Organizations (AREA)
- Entrepreneurship & Innovation (AREA)
- Marketing (AREA)
- General Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- General Health & Medical Sciences (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Medical Informatics (AREA)
- Evolutionary Computation (AREA)
- Databases & Information Systems (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Development Economics (AREA)
- Technology Law (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域Technical field
本申请涉及卡片审核技术领域,尤其涉及一种卡片审核方法及装置。This application relates to the technical field of card auditing, and in particular to a card auditing method and device.
背景技术Background technique
随着银行卡产业的发展和成熟,各种形式的实体卡片设计层出不穷。在当前推广流程中,主要通过人工审核的方式对各个发卡银行提交的卡面设计进行审核,但是人工审核的效率较低。With the development and maturity of the bank card industry, various forms of physical card designs emerge in endlessly. In the current promotion process, the card design submitted by each card-issuing bank is mainly reviewed through manual review, but the efficiency of manual review is low.
为了提高审核效率,目前可能使用的机器视觉算法,主要对银行卡的卡号、文字等语义信息进行识别,而对于银行卡的尺寸信息、卡面上的各个元素的标准位置信息等非语义信息如何识别并没有涉及。In order to improve the efficiency of review, the machine vision algorithms that may be used at present mainly identify semantic information such as card numbers and text of bank cards, but what about non-semantic information such as the size information of bank cards and the standard position information of each element on the card surface? Identification is not involved.
因此,现在亟需一种卡片审核方法,可以实现对卡片上的非语义信息的审核。Therefore, there is an urgent need for a card review method that can review non-semantic information on cards.
发明内容Contents of the invention
本发明实施例提供一种卡片审核方法及装置,可以实现对卡片上的非语义信息的审核,提高卡片审核的准确性。Embodiments of the present invention provide a card review method and device, which can review non-semantic information on cards and improve the accuracy of card review.
第一方面,本发明实施例提供一种卡片审核方法,该方法包括:In a first aspect, an embodiment of the present invention provides a card review method, which method includes:
获取待检测图像中各个元素的特征信息;待检测图像为采集待审核卡片的图像或根据送检方提供的待审核卡片的卡面设计图像得到的;特征信息包括尺寸信息和位置信息;Obtain the characteristic information of each element in the image to be detected; the image to be detected is obtained by collecting the image of the card to be audited or based on the card surface design image of the card to be audited provided by the party submitting the inspection; the characteristic information includes size information and position information;
构建待审核卡片的卡片类型对应的标准图像;Construct a standard image corresponding to the card type of the card to be reviewed;
根据标准图像中各个元素的特征信息和待检测图像中各个元素的特征信息,确定待审核卡片的审核结果。Based on the characteristic information of each element in the standard image and the characteristic information of each element in the image to be detected, the audit result of the card to be audited is determined.
上述方法中,获取待检测图像中各个元素的特征信息,其中特征信息包括尺寸信息和位置信息,构建待审核卡片的卡片类型对应的标准图像,然后根据标准图像中各个元素的特征信息和待检测图像中各个元素的特征信息,确定待审核卡片的审核结果,从而可以实现对待审核卡片的尺寸信息和位置信息等非语义信息进行审核,有助于提高审核准确性。In the above method, the characteristic information of each element in the image to be detected is obtained, where the characteristic information includes size information and position information, a standard image corresponding to the card type of the card to be reviewed is constructed, and then based on the characteristic information of each element in the standard image and the information to be detected The characteristic information of each element in the image determines the audit result of the card to be audited, so that non-semantic information such as size information and position information of the card to be audited can be audited, which helps to improve the accuracy of the audit.
可选的,构建待审核卡片的类型对应的标准图像,包括:Optionally, build standard images corresponding to the types of cards to be reviewed, including:
从模板库包括的N个模板中获取每个模板的第一元素的元素图像;所述N为大于1的整数;Obtain the element image of the first element of each template from N templates included in the template library; the N is an integer greater than 1;
针对N个模板中每个模板的第一元素的元素图像,执行:将元素图像与待检测图像进行匹配,得到待检测图像中与元素图像的匹配程度最高的第一区域;每个模板对应一个第一区域,每个第一区域对应一个匹配值;For the element image of the first element of each template in N templates, execute: match the element image with the image to be detected, and obtain the first area in the image to be detected that has the highest matching degree with the element image; each template corresponds to one The first area, each first area corresponds to a matching value;
从N个第一区域中确定出匹配值最大的第一区域;Determine the first area with the largest matching value from the N first areas;
以匹配值最大的第一区域作为定位锚点,根据待审核卡片的类型、以及匹配值最大的第一区域的特征信息,构建待审核卡片的类型对应的标准图像。Using the first area with the largest matching value as the positioning anchor point, a standard image corresponding to the type of card to be reviewed is constructed based on the type of card to be reviewed and the feature information of the first area with the largest matching value.
上述方法中,各个卡片类型的模板中的第一元素的位置信息和尺寸信息固定,可以通过将模板中的第一元素的元素图像与待检测图像进行匹配,可以准确的定位待检测图像中的第一元素的位置,从而构建出适合验证待审核卡片的检测数据的标准图像,有助于提高审核的准确性。In the above method, the position information and size information of the first element in the template of each card type are fixed. By matching the element image of the first element in the template with the image to be detected, the element in the image to be detected can be accurately positioned. The position of the first element is used to construct a standard image suitable for verifying the detection data of the card to be reviewed, which helps to improve the accuracy of the review.
可选的,将元素图像与待检测图像进行匹配,得到待检测图像中与元素图像的匹配程度最高的第一区域,包括:Optionally, match the element image with the image to be detected to obtain the first region in the image to be detected that has the highest matching degree with the element image, including:
将元素图像的最小外接矩形作为滑动窗口,遍历待检测图像中的所有区域,得到与最小外接矩形的特征信息匹配程度最高的区域;Use the minimum circumscribed rectangle of the element image as a sliding window, traverse all areas in the image to be detected, and obtain the area with the highest degree of matching with the feature information of the minimum circumscribed rectangle;
将与最小外接矩形的特征信息匹配程度最高的区域,确定为待检测图像中与元素图像的匹配程度最高的第一区域。The area with the highest degree of matching with the feature information of the smallest circumscribed rectangle is determined as the first area with the highest degree of matching with the element image in the image to be detected.
上述方法中,以元素图像的最小外接矩形作为滑动窗口,遍历待检测图像中的所有区域,可以快速的得到待检测图像中与该元素图像匹配程度最高的区域。In the above method, the smallest circumscribed rectangle of the element image is used as a sliding window to traverse all areas in the image to be detected, and the area in the image to be detected that matches the element image with the highest degree can be quickly obtained.
可选的,获取待检测图像中各个元素的特征信息,包括:Optionally, obtain the characteristic information of each element in the image to be detected, including:
对待检测图像进行处理,得到灰度图像;Process the image to be detected to obtain a grayscale image;
根据灰度图像中沿长轴方向上的各像素点的灰度值、以及沿短轴方向上的各像素点的灰度值,确定待检测图像中的块状区域的特征信息;Determine the characteristic information of the block area in the image to be detected based on the grayscale value of each pixel along the long axis direction and the grayscale value of each pixel along the short axis direction in the grayscale image;
检测待检测图像中的轮廓线,得到待审核卡片的轮廓线的特征信息。Detect the contour lines in the image to be detected and obtain the characteristic information of the contour lines of the card to be reviewed.
上述方法中,待检测图像中的各个元素主要为块状区域和轮廓线,通过检测块状区域和轮廓线,可以准确的得到待检测图像中的各个元素的特征信息。In the above method, each element in the image to be detected is mainly block-shaped areas and contour lines. By detecting block-shaped areas and contour lines, the characteristic information of each element in the image to be detected can be accurately obtained.
可选的,根据标准图像中各个元素的特征信息和待检测图像中各个元素的特征信息,确定待审核卡片的审核结果,包括:Optionally, determining the audit result of the card to be audited according to the feature information of each element in the standard image and the feature information of each element in the image to be detected includes:
针对标准图像中的每个元素,执行:For each element in the standard image, do:
根据标准图像中元素的尺寸信息与待检测图像中元素的尺寸信息,确定元素的比例偏差;Determine the proportional deviation of the elements based on the size information of the elements in the standard image and the size information of the elements in the image to be detected;
根据标准图像中元素的位置信息与待检测图像中元素的位置信息,确定元素的位置偏差;Determine the position deviation of the element based on the position information of the element in the standard image and the position information of the element in the image to be detected;
根据各个元素的比例偏差和各个元素的位置偏差,确定待审核卡片的审核结果。Based on the proportion deviation of each element and the position deviation of each element, the review result of the card to be reviewed is determined.
上述方法中,通过确定各个元素的比例偏差和各个元素的位置偏差,可以实现通过量化的方式确定待审核卡片的审核结果。In the above method, by determining the proportion deviation of each element and the position deviation of each element, the review result of the card to be reviewed can be determined in a quantitative manner.
可选的,根据各个元素的比例偏差和各个元素的位置偏差,确定待审核卡片的审核结果,包括:Optionally, determine the review result of the card to be reviewed based on the proportion deviation of each element and the position deviation of each element, including:
若每个元素的比例偏差小于第一阈值,且每个元素的位置偏差小于第二阈值,则确定待审核卡片通过审核。If the proportion deviation of each element is less than the first threshold, and the position deviation of each element is less than the second threshold, it is determined that the card to be reviewed passes the review.
可选的,根据各个元素的比例偏差和各个元素的位置偏差,确定待审核卡片的审核结果,包括:Optionally, determine the review result of the card to be reviewed based on the proportion deviation of each element and the position deviation of each element, including:
根据各个元素的偏差、以及各个元素对应的权重系数,确定待检测图像与标准图像的总偏差;According to the deviation of each element and the weight coefficient corresponding to each element, the total deviation between the image to be detected and the standard image is determined;
若总偏差小于第三阈值,则确定待审核卡片通过审核。If the total deviation is less than the third threshold, it is determined that the card to be reviewed passes the review.
第二方面,本发明实施例提供一种卡片审核装置,该装置包括:In a second aspect, an embodiment of the present invention provides a card verification device, which includes:
获取模块,用于获取待检测图像中各个元素的特征信息;所述待检测图像为采集待审核卡片的图像或根据送检方提供的待审核卡片的卡面设计图像得到的;所述特征信息包括尺寸信息和位置信息;The acquisition module is used to obtain the characteristic information of each element in the image to be detected; the image to be detected is obtained by collecting the image of the card to be audited or based on the card surface design image of the card to be audited provided by the party submitting the inspection; the characteristic information Includes size information and location information;
构建模块,用于构建所述待审核卡片的类型对应的标准图像;A building module used to build a standard image corresponding to the type of card to be reviewed;
确定模块,用于根据所述标准图像中各个元素的特征信息和所述待检测图像中各个元素的特征信息,确定所述待审核卡片的审核结果。A determination module, configured to determine the review result of the card to be reviewed based on the feature information of each element in the standard image and the feature information of each element in the image to be detected.
第三方面,本申请实施例还提供一种计算设备,包括:存储器,用于存储程序;处理器,用于调用所述存储器中存储的程序,按照获得的程序执行如第一方面的各种可能的设计中所述的方法。In a third aspect, embodiments of the present application further provide a computing device, including: a memory for storing a program; a processor for calling the program stored in the memory, and executing various methods of the first aspect according to the obtained program. The approach described in Possible Designs.
第四方面,本申请实施例还提供一种计算机可读非易失性存储介质,包括计算机可读程序,当计算机读取并执行所述计算机可读程序时,使得计算机执行如第一方面的各种可能的设计中所述的方法。In a fourth aspect, embodiments of the present application also provide a computer-readable non-volatile storage medium, including a computer-readable program. When the computer reads and executes the computer-readable program, the computer is caused to execute the steps of the first aspect. Various possible designs are described in the approach.
本申请的这些实现方式或其他实现方式在以下实施例的描述中会更加简明易懂。These implementations or other implementations of the present application will be more concise and understandable in the description of the following embodiments.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings needed to describe the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. Those of ordinary skill in the art can also obtain other drawings based on these drawings without exerting any creative effort.
图1为本发明实施例提供的一种卡片审核方法的流程示意图;Figure 1 is a schematic flow chart of a card review method provided by an embodiment of the present invention;
图2为本发明实施例提供的最小外接矩形示意图;Figure 2 is a schematic diagram of the minimum circumscribed rectangle provided by the embodiment of the present invention;
图3为本发明实施例提供的直角坐标系下的银行卡标准构建示意图;Figure 3 is a schematic diagram of the bank card standard construction in the rectangular coordinate system provided by the embodiment of the present invention;
图4为本发明实施例提供的银行卡在直角坐标系下的示意图;Figure 4 is a schematic diagram of the bank card provided by the embodiment of the present invention in a rectangular coordinate system;
图5为本发明实施例提供的直方图检测结果示意图;Figure 5 is a schematic diagram of the histogram detection results provided by the embodiment of the present invention;
图6为本发明实施例提供的待测直线示意图;Figure 6 is a schematic diagram of a straight line to be measured provided by an embodiment of the present invention;
图7为本发明实施例提供的霍夫变换示意图;Figure 7 is a schematic diagram of the Hough transform provided by an embodiment of the present invention;
图8为本发明实施例提供的卡片轮廓示意图;Figure 8 is a schematic diagram of the outline of a card provided by an embodiment of the present invention;
图9为本发明实施例提供的一种卡片审核装置示意图。Figure 9 is a schematic diagram of a card verification device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
下文中所用的词语“示例性”的意思为“用作例子、实施例或说明性”。作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" as used below means "serving as an example, example, or illustrative." Any embodiment described as "exemplary" is not necessarily to be construed as superior or superior to other embodiments.
文中的术语“第一”、“第二”仅用于描述目的,而不能理解为明示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,在本发明实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。此外,术语“包括”以及它们任何变形,意图在于覆盖不排他的保护。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first" and "second" in this article are only used for descriptive purposes and cannot be understood to express or imply relative importance or implicitly indicate the number of indicated technical features. Therefore, the features defined as “first” and “second” may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present invention, unless otherwise specified, “plurality” The meaning is two or more. Furthermore, the term "includes" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes Other steps or units inherent to such processes, methods, products or devices.
以下对本发明实施例中的部分用语进行解释说明,以便于本领域技术人员理解。Some terms used in the embodiments of the present invention are explained below to facilitate understanding by those skilled in the art.
最小外接矩形:是指以二维坐标表示的若干二维形状(例如点、直线、多边形)的最大范围,即以给定的二维形状各顶点中的最大横坐标、最小横坐标、最大纵坐标、最小纵坐标定下边界的矩形。这样的一个矩形包含给定的二维形状,且边与坐标轴平行。最小外接矩形是最小外接框(minimum bounding box)的二维形式。Minimum circumscribed rectangle: refers to the maximum range of several two-dimensional shapes (such as points, lines, polygons) represented by two-dimensional coordinates, that is, the maximum abscissa, minimum abscissa, and maximum vertical coordinate of each vertex of a given two-dimensional shape. The coordinates and the minimum vertical coordinate determine the rectangle of the lower boundary. Such a rectangle contains the given two-dimensional shape with sides parallel to the coordinate axes. The minimum bounding rectangle is the two-dimensional form of the minimum bounding box.
像素点:是指在由一个数字序列表示的图像中的一个最小单位,也称为像素。像素是整个图像中不可分割的单位或者是元素。每一个点阵图像包含了一定量的像素,这些像素决定图像在屏幕上所呈现的大小。一张图片由很多的像素点组成。例如图片尺寸是500×338的,表示图片是由一个500×338的像素点矩阵构成的,这张图片的宽度是500个像素点的长度,高度是338个像素点的长度,共有500×338=149000个像素点。把鼠标放在一个图片上,这个时候会显示尺寸和大小,这里的尺寸就是像素。Pixel point: refers to the smallest unit in an image represented by a sequence of numbers, also called a pixel. A pixel is an indivisible unit or element of the entire image. Each bitmap image contains a certain number of pixels, which determine the size of the image on the screen. A picture is composed of many pixels. For example, the picture size is 500×338, which means that the picture is composed of a 500×338 pixel matrix. The width of this picture is 500 pixels in length and the height is 338 pixels in length. A total of 500×338 =149000 pixels. Put the mouse on an image, and the size and size will be displayed. The size here is pixels.
为了解决相关技术中的技术问题,本发明实施例提供了一种卡片审核方法及装置。本发明实施例提供的卡片审核方法可以应用于银行卡识别场景、新设计的银行卡审核场景等。In order to solve the technical problems in related technologies, embodiments of the present invention provide a card verification method and device. The card review method provided by the embodiment of the present invention can be applied to bank card identification scenarios, newly designed bank card review scenarios, etc.
图1示出了本发明一个实施例提供的卡片审核方法的流程图。该卡片审核方法可以由卡片审核装置执行,如图1所示,该方法包括如下步骤:Figure 1 shows a flow chart of a card review method provided by an embodiment of the present invention. The card review method can be executed by a card review device, as shown in Figure 1. The method includes the following steps:
步骤101,获取待检测图像中各个元素的特征信息。Step 101: Obtain feature information of each element in the image to be detected.
此处,待检测图像为采集待审核卡片的图像或根据送检方提供的待审核卡片的卡面设计图像得到的,具体实施中,可以采集待审核卡片的正面和反面中的任一面的图像得到的,也可以是采集正面和反两面的图像得到的。Here, the image to be detected is obtained by collecting the image of the card to be audited or based on the card surface design image of the card to be audited provided by the party submitting the inspection. In the specific implementation, the image of either front or back of the card to be audited can be collected. The obtained image can also be obtained by collecting images of the front and back sides.
本发明实施例中,待审核卡片可以包括但不限于银行卡、购物卡等,下文中以待审核卡片为银行卡为例进行说明。示例性的,银行卡上包括但不限于以下各个元素:芯片、磁条、卡号、姓名、卡片有效期、银联logo、发卡银行的名称、卡片的轮廓线等。In the embodiment of the present invention, the cards to be reviewed may include but are not limited to bank cards, shopping cards, etc. The following description takes the card to be reviewed as a bank card as an example. For example, the bank card includes but is not limited to the following elements: chip, magnetic stripe, card number, name, card validity period, UnionPay logo, name of the issuing bank, card outline, etc.
在步骤101中,特征信息包括尺寸信息和位置信息,将待检测图像置于直角坐标系XOY下,元素的位置信息可以采用该元素在待检测图像上的位置坐标表示,例如,以元素在待检测图像上的左上角的坐标表示。元素的尺寸信息可以采用元素在X轴的长度和在Y轴的长度表示。In step 101, the feature information includes size information and position information. The image to be detected is placed under the rectangular coordinate system XOY. The position information of the element can be expressed by the position coordinates of the element on the image to be detected. For example, Detects the coordinate representation of the upper left corner on the image. The size information of an element can be expressed by the length of the element on the X-axis and the length on the Y-axis.
如果元素的形状不是一个矩形,例如元素是一个圆角矩形,又例如元素为一个平行四边形,这种情况下可以采用元素的最小外接矩形的位置信息和尺寸信息作为元素的特征信息。以元素为银联logo为例,如图2所示,银联logo的位置信息可以采用银联logo的最小外接矩形(图2中虚线矩形框)左上角的A点坐标(x,y)表示。元素的尺寸信息可以采用银联logo的最小外接矩形(图2中虚线矩形框)在X轴的width和在Y轴的长度height表示。在该示例中,银联logo的特征信息可以表示为[(x,y),width,height]。If the shape of the element is not a rectangle, for example, the element is a rounded rectangle, or if the element is a parallelogram, in this case, the position information and size information of the element's smallest enclosing rectangle can be used as the element's feature information. Taking the element as the UnionPay logo as an example, as shown in Figure 2, the location information of the UnionPay logo can be represented by the coordinates (x, y) of point A in the upper left corner of the smallest external rectangle of the UnionPay logo (the dotted rectangular box in Figure 2). The size information of the element can be expressed by the width of the X-axis and the length of the Y-axis of the UnionPay logo's smallest enclosing rectangle (the dotted rectangle in Figure 2). In this example, the characteristic information of the UnionPay logo can be expressed as [(x,y),width,height].
步骤102,构建待审核卡片的卡片类型对应的标准图像。Step 102: Construct a standard image corresponding to the card type of the card to be reviewed.
步骤103,根据标准图像中各个元素的特征信息和待检测图像中各个元素的特征信息,确定待审核卡片的审核结果。Step 103: Determine the review result of the card to be reviewed based on the feature information of each element in the standard image and the feature information of each element in the image to be detected.
需要说明的是,上述步骤101和步骤102可以不分先后顺序,可以步骤101在步骤102前,也可以步骤101在步骤102在前。It should be noted that the above-mentioned step 101 and step 102 may be in no particular order. Step 101 may precede step 102, or step 101 may precede step 102.
上述方法中,获取待检测图像中各个元素的特征信息,其中特征信息包括尺寸信息和位置信息,构建待审核卡片的卡片类型对应的标准图像,然后根据标准图像中各个元素的特征信息和待检测图像中各个元素的特征信息,确定待审核卡片的审核结果,从而可以实现对待审核卡片的尺寸信息和位置信息等非语义信息进行审核,有助于提高审核准确性。In the above method, the characteristic information of each element in the image to be detected is obtained, where the characteristic information includes size information and position information, a standard image corresponding to the card type of the card to be reviewed is constructed, and then based on the characteristic information of each element in the standard image and the information to be detected The characteristic information of each element in the image determines the audit result of the card to be audited, so that non-semantic information such as size information and position information of the card to be audited can be audited, which helps to improve the accuracy of the audit.
具体实施中,卡片审核装置中存储有模板库,模板库中可以包括多种卡片类型的模板,每个卡片类型对应至少一个模板,以模板库中包括N个模板为例,N为大于1的整数。每个模板包括各个元素的位置和尺寸的标准,可以根据模板制作对应的卡片类型对应的标准图像。In a specific implementation, a template library is stored in the card review device. The template library can include templates of multiple card types. Each card type corresponds to at least one template. For example, the template library includes N templates, where N is greater than 1. integer. Each template includes standards for the position and size of each element, and standard images corresponding to the corresponding card types can be produced based on the template.
上述步骤102中,构建待审核卡片的类型对应的标准图像,包括:从模板库包括的N个模板中获取每个模板的第一元素的元素图像;针对N个模板中每个模板的第一元素的元素图像,执行:将元素图像与待检测图像进行匹配,得到待检测图像中与元素图像的匹配程度最高的第一区域;每个模板对应一个第一区域,每个第一区域对应一个匹配值。从N个第一区域中确定出匹配值最大的第一区域;以匹配值最大的第一区域作为定位锚点,根据待审核卡片的类型、以及匹配值最大的第一区域的特征信息,构建待审核卡片的类型对应的标准图像。In the above step 102, constructing a standard image corresponding to the type of card to be reviewed includes: obtaining the element image of the first element of each template from N templates included in the template library; targeting the first element of each template in the N templates Element image of the element, execution: match the element image with the image to be detected, and obtain the first area in the image to be detected that has the highest matching degree with the element image; each template corresponds to a first area, and each first area corresponds to a Match value. Determine the first area with the largest matching value from the N first areas; use the first area with the largest matching value as the positioning anchor point, and construct a A standard image corresponding to the type of card to be reviewed.
本申请实施例中,第一元素可以是从各个卡片类型的模板中选取位置信息和尺寸信息都比较固定的元素,例如银行卡上的银联logo。In the embodiment of this application, the first element may be an element whose position information and size information are relatively fixed selected from the templates of each card type, such as the UnionPay logo on a bank card.
具体实施中,以第一元素为银联logo为例,银联logo图像的获取方式可以为从已有的标准Logo图像中截取图像,例如命名为Image1,分辨率选择为600*800。同时,可以使用图像金字塔(例如高斯金字塔)的插值方法,对Image1进行缩放操作,以便与待检测图像中的各个区域在尺寸维度上进行匹配,倍数分别取1/4倍,1倍,4倍。由于高斯核是线性核,所以使用高斯金字塔对图像进行模糊等操作不会引入其他的噪声。在其他一些实施例中,可以使用线性插值的方法,相对于图像金字塔的差值方式来说,可以提高计算速度。In the specific implementation, taking the first element as the UnionPay logo as an example, the UnionPay logo image can be obtained by intercepting the image from an existing standard logo image, for example, naming it Image1, and selecting the resolution as 600*800. At the same time, the interpolation method of the image pyramid (such as Gaussian pyramid) can be used to scale Image1 to match each area in the image to be detected in the size dimension. The multiples are 1/4 times, 1 times, and 4 times respectively. . Since the Gaussian kernel is a linear kernel, using Gaussian pyramid to blur the image will not introduce other noise. In some other embodiments, a linear interpolation method can be used, which can increase the calculation speed compared to the image pyramid difference method.
在一个示例中,以待检测图像为银行卡图像,第一元素的元素图像为银联logo图像为例,以N取值为10为例,从10个模板中的每个模板中获取到银联logo图像,这样可以获取到模板1对应的银联logo图像、模板2对应的银联logo图像、……、模板N对应的银联logo图像等N个银联logo图像,将每个银联logo图像都与银行卡图像进行匹配,以模板1对应的银联logo图像与银行卡图像进行匹配为例来说明,银行卡图像存在多个区域,模板1对应的银联logo图像与银行卡图像上的所有的区域进行匹配,从匹配结果中确定出与模板1对应的银联logo图像的匹配程度最高的区域,即第一区域,同时得到模板1对应的银联logo图像与第一区域的匹配值。依此类推,得到与模板n对应的银联logo图像匹配程度最高的第一区域、以及模板n对应的银联logo图像与第一区域的匹配值,n取遍2至10。从得到的这10个第一区域中确定出匹配值最大的第一区域,这个匹配值最大的第一区域就可以看作是待检测图像中的第一元素所在的区域。然后以匹配值最大的第一区域作为定位锚点,根据待审核卡片的类型、以及匹配值最大的第一区域的特征信息,构建待审核卡片的类型对应的标准图像。In an example, take the image to be detected as a bank card image, the element image of the first element as the UnionPay logo image, and the N value as 10 as an example, and obtain the UnionPay logo from each of the 10 templates. image, so that you can obtain N UnionPay logo images corresponding to template 1, UnionPay logo image corresponding to template 2,..., UnionPay logo image corresponding to template N, etc., and combine each UnionPay logo image with the bank card image. For matching, take the matching of the UnionPay logo image corresponding to template 1 and the bank card image as an example to illustrate. There are multiple areas in the bank card image. The UnionPay logo image corresponding to template 1 is matched with all areas on the bank card image. From From the matching results, the area with the highest degree of matching with the UnionPay logo image corresponding to template 1 is determined, that is, the first area. At the same time, the matching value of the UnionPay logo image corresponding to template 1 and the first area is obtained. By analogy, the first region with the highest degree of matching with the UnionPay logo image corresponding to template n is obtained, as well as the matching value between the UnionPay logo image corresponding to template n and the first region, where n ranges from 2 to 10. The first area with the largest matching value is determined from the obtained 10 first areas. The first area with the largest matching value can be regarded as the area where the first element in the image to be detected is located. Then, the first area with the largest matching value is used as the positioning anchor point, and based on the type of card to be reviewed and the feature information of the first area with the largest matching value, a standard image corresponding to the type of card to be reviewed is constructed.
上述方法中,通过将模板中的第一元素的元素图像与待检测图像进行匹配,可以准确的定位待检测图像中的第一元素的位置,从而构建出适合验证待审核卡片的检测数据的标准图像,有助于提高审核的准确性。In the above method, by matching the element image of the first element in the template with the image to be detected, the position of the first element in the image to be detected can be accurately located, thereby constructing a standard suitable for verifying the detection data of the card to be reviewed. Images to help improve review accuracy.
基于上述实施例,将元素图像与待检测图像进行匹配,得到待检测图像中与元素图像的匹配程度最高的第一区域,包括:将元素图像的最小外接矩形作为滑动窗口,遍历待检测图像中的所有区域,得到与最小外接矩形的特征信息匹配程度最高的区域;将与最小外接矩形的特征信息匹配程度最高的区域,确定为待检测图像中与元素图像的匹配程度最高的第一区域。Based on the above embodiment, matching the element image with the image to be detected to obtain the first area in the image to be detected that has the highest matching degree with the element image includes: using the smallest circumscribed rectangle of the element image as a sliding window, traversing the image to be detected of all areas, the area with the highest degree of matching with the feature information of the minimum circumscribed rectangle is obtained; the area with the highest degree of matching with the feature information of the minimum circumscribed rectangle is determined as the first area in the image to be detected that has the highest degree of matching with the element image.
例如,第一元素为银联logo,元素图像为银联logo图像,银联logo图像的最小外接矩形作为滑动窗口在银行卡图像上遍历,可以得到与该最小外接矩形匹配程度最高的区域,该最小外接矩形以图2中的虚线矩形框为例,这样第一区域可以为图2中的银联logo所在的区域。然后,使用待审核卡片的类型、A点的坐标信息(x,y)以及尺寸信息[width,height],确定该待审核卡片的类型所需要达到的标准图像的坐标和尺寸信息。如图3所示,以第一区域作为定位锚点,即以银联logo为定位锚点,根据所需要达到的标准图像的坐标和尺寸信息,重建银行卡的各个元素,从而构建待审核卡片的类型对应的标准图像。For example, the first element is the UnionPay logo, the element image is the UnionPay logo image, and the minimum circumscribed rectangle of the UnionPay logo image is traversed on the bank card image as a sliding window, and the area with the highest degree of matching with the minimum circumscribed rectangle can be obtained. The minimum circumscribed rectangle Taking the dotted rectangular box in Figure 2 as an example, the first area can be the area where the UnionPay logo in Figure 2 is located. Then, use the type of card to be reviewed, the coordinate information (x, y) of point A, and the size information [width, height] to determine the coordinates and size information of the standard image that the type of card to be reviewed needs to meet. As shown in Figure 3, the first area is used as the positioning anchor point, that is, the UnionPay logo is used as the positioning anchor point. According to the coordinates and size information of the standard image that needs to be achieved, each element of the bank card is reconstructed, thereby constructing the card to be reviewed. The standard image corresponding to the type.
上述方法中,以元素图像的最小外接矩形作为滑动窗口,遍历待检测图像中的所有区域,可以快速的得到待检测图像中与该元素图像匹配程度最高的区域。In the above method, the smallest circumscribed rectangle of the element image is used as a sliding window to traverse all areas in the image to be detected, and the area in the image to be detected that matches the element image with the highest degree can be quickly obtained.
具体实施过程中,步骤102中,获取待检测图像中各个元素的特征信息,包括:对待检测图像进行处理,得到灰度图像;根据灰度图像中沿长轴方向上的各像素点的灰度值、以及沿短轴方向上的各像素点的灰度值,确定待检测图像中的块状区域的特征信息;检测待检测图像中的轮廓线,得到待审核卡片的轮廓线的特征信息。During the specific implementation process, in step 102, the characteristic information of each element in the image to be detected is obtained, including: processing the image to be detected to obtain a grayscale image; according to the grayscale of each pixel along the long axis direction in the grayscale image value and the gray value of each pixel along the short axis direction to determine the characteristic information of the block area in the image to be detected; detect the contour line in the image to be detected and obtain the characteristic information of the contour line of the card to be reviewed.
其中,对待检测图像进行处理,可以包括对待检测图像进行灰度化处理,得到灰度图像。可选的,还可以对待检测图像进行高斯滤波操作,以便去除待检测图像中的部分干扰像素点。The processing of the image to be detected may include grayscale processing of the image to be detected to obtain a grayscale image. Optionally, Gaussian filtering can also be performed on the image to be detected in order to remove some interfering pixels in the image to be detected.
然后,可以采用直方图检测的方法检测块状区域。以待检测图像为银行卡图像为例,如图4所示,将该银行卡图像置于直角坐标系XOY下,沿长轴方向可以为图4中的X轴方向,沿短轴方向可以为图4中的Y轴方向。需要说明的是,银行卡在X轴方向的长度又可以看作上文中的width,银行卡在Y轴方向的长度又可以看作上文中的height。Then, the histogram detection method can be used to detect blocky areas. Taking the image to be detected as a bank card image as an example, as shown in Figure 4, the bank card image is placed under the rectangular coordinate system XOY. The long axis direction can be the X axis direction in Figure 4, and the short axis direction can be Y-axis direction in Figure 4. It should be noted that the length of the bank card in the X-axis direction can be regarded as the width mentioned above, and the length of the bank card in the Y-axis direction can be regarded as the height mentioned above.
绘制银行卡图像在Y轴方向上各个像素点的像素值之和Sum函数的曲线,如图5所示的直方图检测结果,即绘制在Y轴方向上各个像素点的像素值之和Sum函数的曲线,图5中的X轴上数值表示图4中银行卡图像沿Y轴方向的尺寸范围0-260,图5的Y轴上数值表示尺寸范围中的任一值对应的灰度值之和。从图5中截取峰值的起点和终点投影到X轴上的值,可以确定出图4中的银行卡磁条在Y轴的位置和height值。Draw the curve of the Sum function of the sum of the pixel values of each pixel point in the Y-axis direction of the bank card image. The histogram detection result shown in Figure 5 is the sum function of the Sum function of the sum of the pixel values of each pixel point in the Y-axis direction. curve, the value on the X-axis in Figure 5 represents the size range of the bank card image in Figure 4 along the Y-axis direction, 0-260, and the value on the Y-axis in Figure 5 represents the grayscale value corresponding to any value in the size range. and. From Figure 5, the starting point and end point of the peak value are projected onto the X-axis, and the position and height value of the bank card magnetic stripe on the Y-axis in Figure 4 can be determined.
同样的,绘制银行卡图像在X轴方向上各个像素点的像素值之和Sum函数的曲线,然后可以确定出图4中的银行卡磁条在x轴的位置和width值。Similarly, draw the curve of the Sum function of the sum of pixel values of each pixel of the bank card image in the X-axis direction, and then determine the position and width value of the bank card magnetic stripe on the x-axis in Figure 4.
通过上述示例,可以得到待检测图像的块状区域的特征信息。Through the above example, the characteristic information of the block area of the image to be detected can be obtained.
对于银行卡的尺寸,可以使用霍夫直线检测的方法确定,霍夫变换算法通过一种投票算法在图像中寻找具有特定形状的目标。霍夫变换算法在一个参数空间中通过计算累计结果的局部最大值得到一个符合该特定形状的集合作为霍夫变换结果。需要检测直线时,为了对所有直线进行一般表示,使用极坐标系,从而极坐标系表示图上的每一个点将是一系列不同初相、幅度,且周期均为的正弦曲线,所有正弦曲线交点处的将代表x-y空间中的这条直线。示例的,例如将图6中的白色直线进行霍夫变换后获得如图7所示的图像,其中的交点即为图6中标定的白色直线。For the size of the bank card, the Hough line detection method can be used to determine the size. The Hough transform algorithm uses a voting algorithm to find targets with specific shapes in the image. The Hough transform algorithm calculates the local maximum value of the cumulative result in a parameter space to obtain a set that conforms to the specific shape as the Hough transform result. When it is necessary to detect straight lines, in order to generally represent all straight lines, the polar coordinate system is used, so that each point on the polar coordinate system represents a series of sinusoids with different initial phases, amplitudes, and the same period. All sinusoids The intersection point will represent this straight line in x-y space. For example, after Hough transforming the white straight line in Figure 6, the image shown in Figure 7 is obtained, and the intersection point is the white straight line calibrated in Figure 6.
如图8所示,在采用霍夫变换算法检测出银行卡的轮廓直线之后,我们将最长的直线延长获取交点,以交点的坐标位置来确认位置信息。As shown in Figure 8, after using the Hough transform algorithm to detect the straight line outline of the bank card, we extend the longest straight line to obtain the intersection point, and use the coordinate position of the intersection point to confirm the position information.
通过上述方法,可以完成对于待检测图像上的例如卡片的尺寸、芯片、磁条、轮廓线等规则图形的测定,获取真实的待审核卡片的各个元素的特征信息。Through the above method, it is possible to complete the measurement of regular graphics on the image to be detected, such as the size of the card, the chip, the magnetic stripe, and the contour line, and obtain the characteristic information of each element of the real card to be reviewed.
上述方法中,待检测图像中的各个元素主要为块状区域和轮廓线,通过检测块状区域和轮廓线,可以准确的得到待检测图像中的各个元素的特征信息。In the above method, each element in the image to be detected is mainly block-shaped areas and contour lines. By detecting block-shaped areas and contour lines, the characteristic information of each element in the image to be detected can be accurately obtained.
具体实施过程中,步骤103中,根据标准图像中各个元素的特征信息和待检测图像中各个元素的特征信息,确定待审核卡片的审核结果,包括:针对标准图像中的每个元素,执行:根据标准图像中元素的尺寸信息与待检测图像中元素的尺寸信息,确定元素的比例偏差;根据标准图像中元素的位置信息与待检测图像中元素的位置信息,确定元素的位置偏差;根据各个元素的比例偏差和各个元素的位置偏差,确定待审核卡片的审核结果。During the specific implementation process, in step 103, the audit result of the card to be audited is determined based on the characteristic information of each element in the standard image and the characteristic information of each element in the image to be detected, including: for each element in the standard image, execute: According to the size information of the elements in the standard image and the size information of the elements in the image to be detected, the proportion deviation of the elements is determined; according to the position information of the elements in the standard image and the position information of the elements in the image to be detected, the position deviation of the elements is determined; according to each The proportion deviation of elements and the position deviation of each element determine the review result of the card to be reviewed.
上述方法中,通过确定各个元素的比例偏差和各个元素的位置偏差,可以实现通过量化的方式确定待审核卡片的审核结果。In the above method, by determining the proportion deviation of each element and the position deviation of each element, the review result of the card to be reviewed can be determined in a quantitative manner.
基于上述实施例,根据各个元素的比例偏差和各个元素的位置偏差,确定待审核卡片的审核结果,可以有多种实现方式。Based on the above embodiments, there are multiple implementation methods for determining the audit result of the card to be audited based on the proportion deviation of each element and the position deviation of each element.
作为一种可能的实现方式,若每个元素的比例偏差小于第一阈值,且每个元素的位置偏差小于第二阈值,则确定待审核卡片通过审核。若每个元素的比例偏差大于或等于第一阈值,或者,每个元素的位置偏差大于或等于第二阈值,则确定待审核卡片未通过审核。As a possible implementation, if the proportional deviation of each element is less than the first threshold, and the position deviation of each element is less than the second threshold, it is determined that the card to be reviewed passes the review. If the proportion deviation of each element is greater than or equal to the first threshold, or the position deviation of each element is greater than or equal to the second threshold, it is determined that the card to be reviewed has failed the review.
示例性的,每个元素以最小外接矩形的形式来测定坐标偏差,待检测图像中每个元素的对应的特征信息为[(x,y),w,h],标准图像中每个元素的特征信息为[(X,Y),W,H]。二者之间的偏差值的计算主要包括两部分,尺寸中心点(即最小外接矩形的左上角的坐标点)的偏差和尺寸比例的偏差。其中,中心点的偏差直接根据曼哈顿距离进行,尺寸比例的偏差取两者差值的平均值。For example, the coordinate deviation of each element is measured in the form of a minimum circumscribed rectangle. The corresponding feature information of each element in the image to be detected is [(x, y), w, h], and the corresponding feature information of each element in the standard image is The feature information is [(X,Y),W,H]. The calculation of the deviation value between the two mainly includes two parts, the deviation of the size center point (that is, the coordinate point of the upper left corner of the minimum circumscribed rectangle) and the deviation of the size ratio. Among them, the deviation of the center point is directly based on the Manhattan distance, and the deviation of the size ratio is the average of the differences between the two.
每个元素的偏差定义为:位置偏差、比例偏差两部分,其中,位置偏差为|x-X|,|y-Y|,比例偏差为w/h–W/H。|x-X|,|y-Y|,w/h–W/H这三个偏差值中有任何值一个大于0,则将该偏差值P置为0,反之则置为1,从而保证有图上该元素的位置和比例发生偏差时均能得到验证反馈。The deviation of each element is defined as: position deviation and proportional deviation, where the positional deviation is |x-X|, |y-Y|, and the proportional deviation is w/h–W/H. If any of the three deviation values |x-X|, |y-Y|, w/h–W/H is greater than 0, the deviation value P is set to 0, otherwise it is set to 1, thereby ensuring that the deviation value P in the figure is Verification feedback can be obtained when the position and proportion of elements deviate.
作为另一种可能的实现方式,根据各个元素的偏差、以及各个元素对应的权重系数,确定待检测图像与标准图像的总偏差;若总偏差小于第三阈值,则确定待审核卡片通过审核。若总偏差大于或等于第三阈值,则确定待审核卡片未通过审核。As another possible implementation method, the total deviation between the image to be detected and the standard image is determined based on the deviation of each element and the weight coefficient corresponding to each element; if the total deviation is less than the third threshold, it is determined that the card to be reviewed passes the review. If the total deviation is greater than or equal to the third threshold, it is determined that the card to be reviewed has failed the review.
以待检测图像包括区芯片、Logo区、卡尺寸、卡尺寸等四个元素为例,根据不同的卡片类型,将这四个元素分别配置不同的权重。作为一个示例,根据卡型的不同,w的值可以取0和1,如果当前卡片类型设计有该元素,则置为1,反之则置为0。Taking the image to be detected as an example, including four elements such as area chip, logo area, card size, and card size, these four elements are configured with different weights according to different card types. As an example, depending on the card type, the value of w can be 0 and 1. If the current card type is designed with this element, it is set to 1, otherwise it is set to 0.
示例性的,设定四个元素的偏差分别为:芯片区偏差P1、Logo区偏差P2,卡尺寸偏差P3以及卡尺寸偏差P4,四个元素对应的权重分别为w_1,w_2,w_3,w_4,计算总偏差为P=w_1*P1+w_2*P2+w_3*P3+w_4*P4。For example, the deviations of the four elements are set as: chip area deviation P1, Logo area deviation P2, card size deviation P3 and card size deviation P4. The corresponding weights of the four elements are w_1, w_2, w_3, w_4, respectively. The total deviation is calculated as P=w_1*P1+w_2*P2+w_3*P3+w_4*P4.
上述方法中,通过确定各个元素的比例偏差和各个元素的位置偏差,可以实现通过量化的方式确定待审核卡片的审核结果。In the above method, by determining the proportion deviation of each element and the position deviation of each element, the review result of the card to be reviewed can be determined in a quantitative manner.
下述为本发明装置实施例,对于装置实施例中未详尽描述的细节,可以参考上述一一对应的方法实施例。The following are device embodiments of the present invention. For details that are not described in detail in the device embodiments, please refer to the above one-to-one corresponding method embodiments.
基于同样的构思,本发明实施例提供一种卡片审核装置,图9为本申请实施例提供的一种卡片审核装置示意图,如图9示,包括:Based on the same concept, an embodiment of the present invention provides a card verification device. Figure 9 is a schematic diagram of a card verification device provided by an embodiment of the present application. As shown in Figure 9, it includes:
获取模块901,用于获取待检测图像中各个元素的特征信息;待检测图像为采集待审核卡片的图像或根据送检方提供的待审核卡片的卡面设计图像得到的;特征信息包括尺寸信息和位置信息;The acquisition module 901 is used to acquire the characteristic information of each element in the image to be detected; the image to be detected is an image of the card to be reviewed or is obtained based on the card surface design image of the card to be reviewed provided by the inspection party; the characteristic information includes size information and position information;
构建模块902,用于构建待审核卡片的卡片类型对应的标准图像;Building module 902, used to build a standard image corresponding to the card type of the card to be reviewed;
确定模块903,用于根据标准图像中各个元素的特征信息和待检测图像中各个元素的特征信息,确定待审核卡片的审核结果。The determination module 903 is used to determine the audit result of the card to be audited based on the characteristic information of each element in the standard image and the characteristic information of each element in the image to be detected.
可选的,构建模块902,具体用于:Optional, building module 902, specifically used for:
从模板库包括的N个模板中获取每个模板的第一元素的元素图像;N为大于1的整数;Obtain the element image of the first element of each template from the N templates included in the template library; N is an integer greater than 1;
针对N个模板中每个模板的第一元素的元素图像,执行:将元素图像与待检测图像进行匹配,得到待检测图像中与元素图像的匹配程度最高的第一区域;每个模板对应一个第一区域,每个第一区域对应一个匹配值;For the element image of the first element of each template in N templates, execute: match the element image with the image to be detected, and obtain the first area in the image to be detected that has the highest matching degree with the element image; each template corresponds to one The first area, each first area corresponds to a matching value;
从N个第一区域中确定出匹配值最大的第一区域;Determine the first area with the largest matching value from the N first areas;
以匹配值最大的第一区域作为定位锚点,根据待审核卡片的类型、以及匹配值最大的第一区域的特征信息,构建待审核卡片的类型对应的标准图像。Using the first area with the largest matching value as the positioning anchor point, a standard image corresponding to the type of card to be reviewed is constructed based on the type of card to be reviewed and the feature information of the first area with the largest matching value.
可选的,构建模块902,具体用于:将元素图像的最小外接矩形作为滑动窗口,遍历待检测图像中的所有区域,得到与最小外接矩形的特征信息匹配程度最高的区域;Optionally, the building module 902 is specifically used to: use the minimum circumscribed rectangle of the element image as a sliding window, traverse all areas in the image to be detected, and obtain the area with the highest degree of matching with the feature information of the minimum circumscribed rectangle;
将与最小外接矩形的特征信息匹配程度最高的区域,确定为待检测图像中与元素图像的匹配程度最高的第一区域。The area with the highest degree of matching with the feature information of the smallest circumscribed rectangle is determined as the first area with the highest degree of matching with the element image in the image to be detected.
可选的,获取模块901,具体用于:Optional, obtain module 901, specifically used for:
对待检测图像进行处理,得到灰度图像;Process the image to be detected to obtain a grayscale image;
根据灰度图像中沿长轴方向上的各像素点的灰度值、以及沿短轴方向上的各像素点的灰度值,确定待检测图像中的块状区域的特征信息;Determine the characteristic information of the block area in the image to be detected based on the grayscale value of each pixel along the long axis direction and the grayscale value of each pixel along the short axis direction in the grayscale image;
检测待检测图像中的轮廓线,得到待审核卡片的轮廓线的特征信息。Detect the contour lines in the image to be detected and obtain the characteristic information of the contour lines of the card to be reviewed.
可选的,确定模块903,具体用于:Optional, determine module 903, specifically used for:
针对标准图像中的每个元素,执行:For each element in the standard image, do:
根据标准图像中元素的尺寸信息与待检测图像中元素的尺寸信息,确定元素的比例偏差;Determine the proportional deviation of the elements based on the size information of the elements in the standard image and the size information of the elements in the image to be detected;
根据标准图像中元素的位置信息与待检测图像中元素的位置信息,确定元素的位置偏差;Determine the position deviation of the element based on the position information of the element in the standard image and the position information of the element in the image to be detected;
根据各个元素的比例偏差和各个元素的位置偏差,确定待审核卡片的审核结果。Based on the proportion deviation of each element and the position deviation of each element, the review result of the card to be reviewed is determined.
可选的,确定模块903,具体用于:Optional, determine module 903, specifically used for:
若每个元素的比例偏差小于第一阈值,且每个元素的位置偏差小于第二阈值,则确定待审核卡片通过审核。If the proportion deviation of each element is less than the first threshold, and the position deviation of each element is less than the second threshold, it is determined that the card to be reviewed passes the review.
可选的,确定模块903,具体用于:Optional, determine module 903, specifically used for:
根据各个元素的偏差、以及各个元素对应的权重系数,确定待检测图像与标准图像的总偏差;According to the deviation of each element and the weight coefficient corresponding to each element, the total deviation between the image to be detected and the standard image is determined;
若总偏差小于第三阈值,则确定待审核卡片通过审核。If the total deviation is less than the third threshold, it is determined that the card to be reviewed passes the review.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will understand that embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the present application. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce a use A device for realizing the functions specified in one process or multiple processes of the flowchart and/or one block or multiple blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions The device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device. Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. In this way, if these modifications and variations of the present application fall within the scope of the claims of the present application and equivalent technologies, the present application is also intended to include these modifications and variations.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110090570.4A CN112801165B (en) | 2021-01-22 | 2021-01-22 | Card review method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110090570.4A CN112801165B (en) | 2021-01-22 | 2021-01-22 | Card review method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112801165A CN112801165A (en) | 2021-05-14 |
CN112801165B true CN112801165B (en) | 2024-03-22 |
Family
ID=75811300
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110090570.4A Active CN112801165B (en) | 2021-01-22 | 2021-01-22 | Card review method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112801165B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113792267B (en) * | 2021-08-09 | 2023-03-14 | 中国人民银行数字货币研究所 | Method and device for checking digital copyright of card surface picture of payment mechanism |
CN116242843A (en) * | 2023-01-17 | 2023-06-09 | 深圳职业技术学院 | Defect detection method, terminal and storage medium for paper box package |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE19539801A1 (en) * | 1995-10-26 | 1997-04-30 | Ibm | Security system for transactions with smart cards |
KR101660476B1 (en) * | 2015-11-19 | 2016-10-14 | 권해원 | Metod for recognizing payment information in printed credit card |
CN108510036A (en) * | 2018-03-27 | 2018-09-07 | 武汉天喻信息产业股份有限公司 | A kind of card face image generating method based on parametrization |
CN110674819A (en) * | 2019-12-03 | 2020-01-10 | 捷德(中国)信息科技有限公司 | Card surface picture detection method, device, equipment and storage medium |
CN110674818A (en) * | 2019-12-03 | 2020-01-10 | 捷德(中国)信息科技有限公司 | Card surface detection method, device, equipment and medium |
CN111199240A (en) * | 2018-11-16 | 2020-05-26 | 马上消费金融股份有限公司 | Training method of bank card identification model, and bank card identification method and device |
CN111415243A (en) * | 2020-03-24 | 2020-07-14 | 支付宝(杭州)信息技术有限公司 | Method and device for assisting international bank card audit |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11049372B2 (en) * | 2007-06-13 | 2021-06-29 | CPI Card Group—Colorado, Inc. | System and methods for generating user interfaces for custom card design session |
-
2021
- 2021-01-22 CN CN202110090570.4A patent/CN112801165B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE19539801A1 (en) * | 1995-10-26 | 1997-04-30 | Ibm | Security system for transactions with smart cards |
KR101660476B1 (en) * | 2015-11-19 | 2016-10-14 | 권해원 | Metod for recognizing payment information in printed credit card |
CN108510036A (en) * | 2018-03-27 | 2018-09-07 | 武汉天喻信息产业股份有限公司 | A kind of card face image generating method based on parametrization |
CN111199240A (en) * | 2018-11-16 | 2020-05-26 | 马上消费金融股份有限公司 | Training method of bank card identification model, and bank card identification method and device |
CN110674819A (en) * | 2019-12-03 | 2020-01-10 | 捷德(中国)信息科技有限公司 | Card surface picture detection method, device, equipment and storage medium |
CN110674818A (en) * | 2019-12-03 | 2020-01-10 | 捷德(中国)信息科技有限公司 | Card surface detection method, device, equipment and medium |
CN111415243A (en) * | 2020-03-24 | 2020-07-14 | 支付宝(杭州)信息技术有限公司 | Method and device for assisting international bank card audit |
Also Published As
Publication number | Publication date |
---|---|
CN112801165A (en) | 2021-05-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103942824B (en) | Linear feature extracting method for three-dimensional point cloud | |
Dubská et al. | PClines—line detection using parallel coordinates | |
US20130156292A1 (en) | Computing device and method for extracting data of product for use in construction of point cloud | |
US20140161359A1 (en) | Method for detecting a straight line in a digital image | |
US10621740B2 (en) | 3D modeling method based on point cloud data | |
CN110428414B (en) | Method and device for identifying number of notes in image | |
CN112801165B (en) | Card review method and device | |
CN111539238B (en) | Two-dimensional code image restoration method and device, computer equipment and storage medium | |
CN111222507B (en) | Automatic identification method for digital meter reading and computer readable storage medium | |
US9928621B2 (en) | Line stylization through graphics processor unit (GPU) textures | |
CN108074237A (en) | Approach for detecting image sharpness, device, storage medium and electronic equipment | |
CN109858542A (en) | A character recognition method and device | |
CN113362420A (en) | Road marking generation method, device, equipment and storage medium | |
US20190371001A1 (en) | Information processing apparatus, method of controlling information processing apparatus, and non-transitory computer-readable storage medium | |
CN112241675A (en) | Object detection model training method and device | |
CN107480710B (en) | Feature point matching result processing method and device | |
CN110135288B (en) | Method and device for quickly checking electronic certificate | |
CN118762376B (en) | CAD table information reading method, device, computer equipment and medium | |
US9514526B2 (en) | Device and method for detecting angle of rotation from normal position of image | |
CN114708230A (en) | Vehicle frame quality detection method, device, equipment and medium based on image analysis | |
CN112464753B (en) | Method and device for detecting key points in image and terminal equipment | |
US7379599B1 (en) | Model based object recognition method using a texture engine | |
CN117876297A (en) | Colloid detection method, colloid detection device, colloid detection equipment and storage medium | |
CN110909816B (en) | Picture identification method and device | |
CN115393172B (en) | Method and equipment for extracting light stripe center in real time based on GPU |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |