WO2019196298A1 - 电子装置、基于证件图片的身份识别方法及存储介质 - Google Patents
电子装置、基于证件图片的身份识别方法及存储介质 Download PDFInfo
- Publication number
- WO2019196298A1 WO2019196298A1 PCT/CN2018/102089 CN2018102089W WO2019196298A1 WO 2019196298 A1 WO2019196298 A1 WO 2019196298A1 CN 2018102089 W CN2018102089 W CN 2018102089W WO 2019196298 A1 WO2019196298 A1 WO 2019196298A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- picture
- image
- pixel
- portrait
- difference
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/172—Classification, e.g. identification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/40—Document-oriented image-based pattern recognition
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/46—Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
- G06V10/469—Contour-based spatial representations, e.g. vector-coding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/48—Extraction of image or video features by mapping characteristic values of the pattern into a parameter space, e.g. Hough transformation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/40—Spoof detection, e.g. liveness detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/95—Pattern authentication; Markers therefor; Forgery detection
Definitions
- the present application relates to the field of communications technologies, and in particular, to an electronic device, an identity recognition method based on a certificate picture, and a storage medium.
- OCR Optical Character Recognition
- OCR refers to an electronic device (for example, a scanner or a digital camera) that checks characters printed on paper, determines its shape by detecting dark and bright patterns, and then translates the shape into characters by character recognition.
- OCR technology for user identification.
- OCR technology to identify the user's ID card during bank card opening and securities account opening can greatly reduce manual entry, reduce costs, and improve work. effectiveness.
- most of the ID card identification software now extracts the text information on the ID card directly through image recognition, and the ID card image may be artificially modified, thereby failing to detect the authenticity of the ID card image. The accuracy of recognition needs to be improved.
- the purpose of the present application is to provide an electronic device, an identification method based on a certificate picture, and a storage medium, aiming at improving the accuracy of identity recognition.
- the present application provides an electronic device including a memory and a processor coupled to the memory, the memory storing a processing system operable on the processor, the processing The system implements the following steps when executed by the processor:
- Processing steps obtaining a portrait image in the ID picture, binarizing the portrait picture to obtain a binarized picture, and processing the binarized picture by using an expansion algorithm to obtain a picture after pixel enhancement;
- a straight line detecting step which uses a preset line detection algorithm to analyze a straight line in a picture after pixel enhancement, and filters out a picture without a line;
- the image analysis step is to obtain the portrait image in the ID image corresponding to the selected image, and save the portrait image in the corresponding document image of the selected image as a copy image of the jpg format twice according to the predetermined compression quality parameter, and analyze the image.
- the difference between the three primary colors of the portrait image and the duplicate image in the ID picture is based on the analysis result.
- the present application further provides an identity recognition method based on a certificate picture, and the identity recognition method based on the certificate picture includes:
- S1 obtaining a portrait image in the ID image, binarizing the portrait image to obtain a binarized image, and processing the binarized image by using an expansion algorithm to obtain a pixel-enhanced image;
- S3 Obtain a portrait image in the ID image corresponding to the selected image, and save the portrait image in the ID image corresponding to the selected image as a copy image of the jpg format twice according to a predetermined compression quality parameter, and analyze the image of the ID The difference between the three primary colors of the portrait image and the duplicate image is based on the analysis result.
- the present application also provides a computer readable storage medium having stored thereon a processing system that, when executed by a processor, implements the steps of the above-described document image based identification method.
- the present application firstly detects a line of a portrait picture of a document to initially determine whether the picture has been tampered with, and filters the portrait picture of the document. Since the document is filtered, it will not be further identified, thus increasing The efficiency and security of the identification of the document information; then according to the jpg compression principle, by comparing the average of the three primary color differences to compare the difference between the original image and the last compressed copy image, thereby further detecting the authenticity of the portrait image of the document, Identify the modified portrait images to improve the accuracy and efficiency of the identification.
- FIG. 1 is a schematic diagram of a hardware architecture of an embodiment of an electronic device according to the present application.
- FIG. 2 is a schematic flowchart of an embodiment of an identification method based on a certificate picture of the present application.
- FIG. 1 is a schematic diagram of a hardware architecture of an embodiment of an electronic device according to the present application.
- the electronic device 1 is an apparatus capable of automatically performing numerical calculation and/or information processing in accordance with an instruction set or stored in advance.
- the electronic device 1 may be a computer, a single network server, a server group composed of multiple network servers, or a cloud-based cloud composed of a large number of hosts or network servers, where cloud computing is a type of distributed computing.
- a super virtual computer consisting of a group of loosely coupled computers.
- the electronic device 1 may include, but is not limited to, a memory 11 communicably connected to each other through a system bus, a processor 12, and a network interface 13, and the memory 11 stores a processing system operable on the processor 12. It should be noted that FIG. 1 only shows the electronic device 1 having the components 11-13, but it should be understood that not all illustrated components are required to be implemented, and more or fewer components may be implemented instead.
- the memory 11 includes a memory and at least one type of readable storage medium.
- the memory provides a cache for the operation of the electronic device 1;
- the readable storage medium may be, for example, a flash memory, a hard disk, a multimedia card, a card type memory (eg, SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM).
- a non-volatile storage medium such as a read only memory (ROM), an electrically erasable programmable read only memory (EEPROM), a programmable read only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, or the like.
- the readable storage medium may be an internal storage unit of the electronic device 1, such as a hard disk of the electronic device 1; in other embodiments, the non-volatile storage medium may also be external to the electronic device 1.
- a storage device such as a plug-in hard disk equipped with an electronic device 1, a smart memory card (SMC), a Secure Digital (SD) card, a flash card, or the like.
- the readable storage medium of the memory 11 is generally used to store an operating system and various types of application software installed in the electronic device 1, such as program code for storing a processing system in an embodiment of the present application. Further, the memory 11 can also be used to temporarily store various types of data that have been output or are to be output.
- the processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments.
- the processor 12 is typically used to control the overall operation of the electronic device 1, such as performing control or processing related to data interaction or communication with other devices.
- the processor 12 is configured to run program code or process data stored in the memory 11, such as running a processing system or the like.
- the network interface 13 may comprise a wireless network interface or a wired network interface, which is typically used to establish a communication connection between the electronic device 1 and other electronic devices.
- the processing system is stored in the memory 11 and includes at least one computer readable instruction stored in the memory 11, the at least one computer readable instruction being executable by the processor 12 to implement the methods of various embodiments of the present application;
- the at least one computer readable instruction can be classified into different logic modules depending on the functions implemented by its various parts.
- Processing steps obtaining a portrait image in the ID picture, binarizing the portrait picture to obtain a binarized picture, and processing the binarized picture by using an expansion algorithm to obtain a picture after pixel enhancement;
- the document image includes a text part and a portrait part.
- the contour of the portrait picture in the document is obtained by the binarization algorithm (ie, the portrait picture of only black and white color): setting a global threshold T, and dividing the portrait picture by T
- Two parts a pixel group larger than T and a pixel group smaller than T, the pixel value of the pixel group larger than T is set to white (or black), and the pixel value of the pixel group smaller than T is set to black (or white).
- the expansion algorithm processes the binarized image.
- the step of processing the binarized image by using the expansion algorithm to obtain the pixel-enhanced image includes:
- the step is mainly to merge all the background pixel points in contact with the portrait into the portrait, so that the boundary of the portrait is expanded to the outside.
- the structural element of the preset size is a 3*3 structural element, and the binarized picture is scanned. For each pixel, the 3*3 structure element is ORed with the pixel of the binarized picture it covers. If both are 0, the pixel is 0; otherwise, it is 1 to obtain the pixel-enhanced picture.
- a straight line detecting step which uses a preset line detection algorithm to analyze a straight line in a picture after pixel enhancement, and filters out a picture without a line;
- the preset line detection algorithm is preferably a Hough transform algorithm or a line detection algorithm based on chain code detection.
- the Hough transform algorithm maps the edge points of the image plane to the parameter space according to the function relationship of the curve to be sought, and accumulates to find the maximum peak point.
- the points and the straight lines are dual relations in the two coordinate systems, that is, the points in the Cartesian coordinate system are lines in the polar coordinate system, and in the Cartesian coordinate system. Lines are points in the polar coordinate system.
- the picture after pixel enhancement can be regarded as a Cartesian coordinate system.
- the line in the picture can be detected and converted into a point in the polar coordinate system corresponding to the transformation.
- Straight line detection first scan the chain code of the primed image, record the duration of each chain code direction, and obtain the chain code statistics, including the starting point coordinates, tracking direction and duration; obtain the statistics of the previous step Data, according to the starting point coordinates, tracking direction and duration of the chain code in the statistical data, whether the line is a straight line satisfying the required line requirement, and after a line detection algorithm based on chain code detection, if there is a straight line (for example, a vertical and horizontal line)
- a tamper-removed picture such as a picture that has been PS
- the certificate is a fake document; if there is no straight line, it is initially determined to be a picture that has not been falsified, and may be filtered to further detect the authenticity of the document.
- a picture with a straight line is detected by a preset line detection algorithm, and the picture with a line is a tamper-removed picture, which can be filtered out.
- the picture with a line is a tamper-removed picture, which can be filtered out.
- the image analysis step is to obtain the portrait image in the ID image corresponding to the selected image, and save the portrait image in the corresponding document image of the selected image as a copy image of the jpg format twice according to the predetermined compression quality parameter, and analyze the image.
- the difference between the three primary colors of the portrait image and the duplicate image in the ID picture is based on the analysis result.
- This embodiment is directed to a document image, such as an ID card, which has a single color and a relatively uniform compression ratio, so the image can be analyzed by a compression method.
- the predetermined compression quality parameter is 75, although other compression quality parameters similar to 75 may be used.
- the portrait image (ie, the original image) in the image corresponding to the selected image is first saved as a copy of the jpg format.
- the image is compressed every time the image is saved as the jpg format, and the process is The picture is converted to YCrCb, and then the CrCb is greatly compressed.
- Each compression will lose some information.
- the copy picture will cause picture noise due to the missing information. As the number of saves increases, the picture will tend to be stable. The amount of noise introduced will be reduced. Then, the copy is again compressed and saved according to the above compression quality parameters to obtain a copy image.
- the step of analyzing the difference between the three primary colors of the portrait image and the duplicate image in the document image includes:
- the difference matrix is divided into partitions of a preset size, the average value of the differences of each partition is calculated, the average value of the differences of the entire difference matrix is calculated, and the average value of the difference values of each partition and the entire difference matrix are obtained.
- the ID picture is a real picture, and if the difference value is not within the preset threshold range, it is determined that the ID picture is a forged picture.
- the partition of the preset size is an 8*8 partition, and the specific algorithms include:
- Idiff uint8(abs(double(ori)-double(temp))*30);
- Idiff uint8(double(idiff)*255/double(me));
- idiff is the difference image (including the three primary colors)
- ori is the three primary color RGB information of the portrait image in the ID picture
- double is the numerical information of the picture information
- temp is the three primary color RGB information of the duplicate picture
- abs is the absolute value
- uint8 is The picture data is transferred to the picture style
- the difference is the largest among the three primary colors of the difference image.
- the ID picture is a real picture, that is, if the portrait picture is obviously too bright, the place is evenly or obviously too dark. , or the portrait image is not obviously too bright or obviously too dark, the portrait image of the document is true, if the difference value is not within the preset threshold range, it is determined that the document image is a forged image, that is, if If the picture is obviously too bright and the place is uneven or obviously too dark, the portrait picture of the document is forged.
- the embodiment is limited to a fixed scene, that is, identifying the authenticity of the portrait image of the document to identify the authenticity of the identity, and after filtering the image without the straight line through the preset line detection algorithm, adding a texture detection method more suitable for the document, And because the portrait image of the document is single color, and the difference image directly selects the mean value of the three primary colors as the final value, the impact on the accuracy is small, but the running efficiency is much improved, which is suitable for mass use.
- the present application firstly detects the line of the portrait picture of the document to initially determine whether the picture has been tampered with, and filters the portrait picture of the document. Since the document is filtered, it will not be further identified, thus increasing The efficiency and security of the identification of the document information; then according to the jpg compression principle, by comparing the average of the three primary color differences to compare the difference between the original image and the last compressed copy image, thereby further detecting the authenticity of the portrait image of the document, Identify the modified portrait images to improve the accuracy and efficiency of the identification.
- FIG. 2 is a schematic flowchart of an embodiment of an identification method based on a certificate picture according to an embodiment of the present invention.
- the method for identifying an identity based on a document picture includes the following steps:
- Step S1 acquiring a portrait image in the ID image, binarizing the portrait image to obtain a binarized image, and processing the binarized image by using an expansion algorithm to obtain a pixel-enhanced image;
- the document image includes a text part and a portrait part.
- the contour of the portrait picture in the document is obtained by the binarization algorithm (ie, the portrait picture of only black and white color): setting a global threshold T, and dividing the portrait picture by T
- Two parts a pixel group larger than T and a pixel group smaller than T, the pixel value of the pixel group larger than T is set to white (or black), and the pixel value of the pixel group smaller than T is set to black (or white).
- the expansion algorithm processes the binarized image.
- the step of processing the binarized image by using the expansion algorithm to obtain the pixel-enhanced image includes:
- the step is mainly to merge all the background pixel points in contact with the portrait into the portrait, so that the boundary of the portrait is expanded to the outside.
- the structural element of the preset size is a 3*3 structural element, and the binarized picture is scanned. For each pixel, the 3*3 structure element is ORed with the pixel of the binarized picture it covers. If both are 0, the pixel is 0; otherwise, it is 1 to obtain the pixel-enhanced picture.
- Step S2 analyzing a straight line in the picture after the pixel enhancement by using a preset line detection algorithm, and filtering out a picture without a line;
- the preset line detection algorithm is preferably a Hough transform algorithm or a line detection algorithm based on chain code detection.
- the Hough transform algorithm maps the edge points of the image plane to the parameter space according to the function relationship of the curve to be sought, and accumulates to find the maximum peak point.
- the points and the straight lines are dual relations in the two coordinate systems, that is, the points in the Cartesian coordinate system are lines in the polar coordinate system, and in the Cartesian coordinate system. Lines are points in the polar coordinate system.
- the picture after pixel enhancement can be regarded as a Cartesian coordinate system.
- the line in the picture can be detected and converted into a point in the polar coordinate system corresponding to the transformation.
- Straight line detection first scan the chain code of the image after prime enhancement, record the duration of each chain code direction, and obtain the statistical data of the chain code, including the starting point coordinates, tracking direction and duration; obtain the statistics of the previous step Data, according to the starting point coordinates, tracking direction and duration of the chain code in the statistical data, whether the line is a straight line satisfying the requirement of the required line, and after a line detection algorithm based on chain code detection, if there is a straight line (for example, a vertical and horizontal line)
- a tamper-removed picture such as a picture that has been PS
- the certificate is a fake document; if there is no straight line, it is initially determined to be a picture that has not been falsified, and may be filtered to further detect the authenticity of the document.
- a picture with a straight line is detected by a preset line detection algorithm, and the picture with a line is a tamper-removed picture, which can be filtered out.
- the picture with a line is a tamper-removed picture, which can be filtered out.
- Step S3 Obtain a portrait image in the ID image corresponding to the selected image, and save the portrait image in the ID image corresponding to the selected image as a copy image in jpg format according to a predetermined compression quality parameter, and analyze the document.
- the portrait image in the picture is different from the three primary colors of the duplicate image, and the identification is performed based on the analysis result.
- This embodiment is directed to a document image, such as an ID card, which has a single color and a relatively uniform compression ratio, so the image can be analyzed by a compression method.
- the predetermined compression quality parameter is 75, although other compression quality parameters similar to 75 may be used.
- the portrait image (ie, the original image) in the image corresponding to the selected image is first saved as a copy of the jpg format.
- the image is compressed every time the image is saved as the jpg format, and the process is The picture is converted to YCrCb, and then the CrCb is greatly compressed.
- Each compression will lose some information.
- the copy picture will cause picture noise due to the missing information. As the number of saves increases, the picture will tend to be stable. The amount of noise introduced will be reduced. Then, the copy is again compressed and saved according to the above compression quality parameters to obtain a copy image.
- the step of analyzing the difference between the three primary colors of the portrait image and the duplicate image in the document image includes:
- the difference matrix is divided into partitions of a preset size, the average value of the differences of each partition is calculated, the average value of the differences of the entire difference matrix is calculated, and the average value of the difference values of each partition and the entire difference matrix are obtained.
- the ID picture is a real picture, and if the difference value is not within the preset threshold range, it is determined that the ID picture is a forged picture.
- the partition of the preset size is an 8*8 partition, and the specific algorithms include:
- Idiff uint8(abs(double(ori)-double(temp))*30);
- Idiff uint8(double(idiff)*255/double(me));
- idiff is the difference image (including the three primary colors)
- ori is the three primary color RGB information of the portrait image in the ID picture
- double is the numerical information of the picture information
- temp is the three primary color RGB information of the duplicate picture
- abs is the absolute value
- uint8 is The picture data is transferred to the picture style
- the difference is the largest among the three primary colors of the difference image.
- the ID picture is a real picture, that is, if the portrait picture is obviously too bright, the place is evenly or obviously too dark. , or the portrait image is not obviously too bright or obviously too dark, the portrait image of the document is true, if the difference value is not within the preset threshold range, it is determined that the document image is a forged image, that is, if If the picture is obviously too bright and the place is uneven or obviously too dark, the portrait picture of the document is forged.
- the embodiment is limited to a fixed scene, that is, identifying the authenticity of the portrait image of the document to identify the authenticity of the identity, and after filtering the image without the straight line through the preset line detection algorithm, adding a texture detection method more suitable for the document, And because the portrait image of the document is single color, and the difference image directly selects the mean value of the three primary colors as the final value, the impact on the accuracy is small, but the running efficiency is much improved, which is suitable for mass use.
- the present application firstly detects the line of the portrait picture of the document to initially determine whether the picture has been tampered with, and filters the portrait picture of the document. Since the document is filtered, it will not be further identified, thus increasing The efficiency and security of the identification of the document information; then according to the jpg compression principle, by comparing the average of the three primary color differences to compare the difference between the original image and the last compressed copy image, thereby further detecting the authenticity of the portrait image of the document, Identify the modified portrait images to improve the accuracy and efficiency of the identification.
- the present application also provides a computer readable storage medium having stored thereon a processing system that, when executed by a processor, implements the steps of the above-described document image based identification method.
- the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better.
- Implementation Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
- the optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Human Computer Interaction (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Image Analysis (AREA)
- Editing Of Facsimile Originals (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
本申请涉及一种电子装置、基于证件图片的身份识别方法及存储介质,该方法包括:获取证件图片中的人像图片,对该人像图片进行二值化得到二值化图片,并利用膨胀算法对二值化图片进行处理,得到像素强化后的图片;利用预设的直线检测算法分析像素强化后的图片中的直线,并筛选出无直线的图片;获取筛选出的图片对应的证件图片中的人像图片,将筛选出的图片对应的证件图片中的人像图片按照预定的压缩质量参数连续两次保存为jpg格式的副本图片,分析该证件图片中的人像图片与副本图片的三原色差异,根据分析结果进行身份识别。本申请能够提高身份识别的准确率。
Description
优先权申明
本申请基于巴黎公约申明享有2018年04月09日递交的申请号为CN 2018103128560、名称为“电子装置、基于证件图片的身份识别方法及存储介质”中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
本申请涉及通信技术领域,尤其涉及一种电子装置、基于证件图片的身份识别方法及存储介质。
光学字符识别(Optical Character Recognition,OCR)是指电子设备(例如,扫描仪或数码相机)检查纸上打印的字符,通过检测暗、亮的模式确定其形状,然后用字符识别方法将形状翻译成计算机文字的过程。目前,大部分的金融机构经常利用OCR技术进行用户身份识别,例如在银行开卡、证券开户中利用OCR技术对用户的身份证进行识别,能够极大的减少了人工录入,降低成本,提高工作效率。然而,现在大部分的身份证识别软件都是通过图像识别直接提取出身份证上面的文字信息,而身份证图片有可能被人为的修改,由此无法对身份证图片的真伪进行检测,身份识别的准确率有待提高。
发明内容
本申请的目的在于提供一种电子装置、基于证件图片的身份识别方法及存储介质,旨在提高身份识别的准确率。
为实现上述目的,本申请提供一种电子装置,所述电子装置包括存储器及与所述存储器连接的处理器,所述存储器中存储有可在所述处理器上运行 的处理系统,所述处理系统被所述处理器执行时实现如下步骤:
处理步骤,获取证件图片中的人像图片,对该人像图片进行二值化得到二值化图片,并利用膨胀算法对二值化图片进行处理,得到像素强化后的图片;
直线检测步骤,利用预设的直线检测算法分析像素强化后的图片中的直线,并筛选出无直线的图片;
图片分析步骤,获取筛选出的图片对应的证件图片中的人像图片,将筛选出的图片对应的证件图片中的人像图片按照预定的压缩质量参数连续两次保存为jpg格式的副本图片,分析该证件图片中的人像图片与副本图片的三原色差异,根据分析结果进行身份识别。
为实现上述目的,本申请还提供一种基于证件图片的身份识别方法,所述基于证件图片的身份识别方法包括:
S1,获取证件图片中的人像图片,对该人像图片进行二值化得到二值化图片,并利用膨胀算法对二值化图片进行处理,得到像素强化后的图片;
S2,利用预设的直线检测算法分析像素强化后的图片中的直线,并筛选出无直线的图片;
S3,获取筛选出的图片对应的证件图片中的人像图片,将筛选出的图片对应的证件图片中的人像图片按照预定的压缩质量参数连续两次保存为jpg格式的副本图片,分析该证件图片中的人像图片与副本图片的三原色差异,根据分析结果进行身份识别。
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有处理系统,所述处理系统被处理器执行时实现上述的基于证件图片的身份识别方法的步骤。
本申请的有益效果是:本申请首先检测证件的人像图片的直线来初步确 定其是否被篡改过的图片,对证件的人像图片进行过滤,由于证件一旦被过滤,将不会进一步识别,因此增加证件信息识别的效率及安全性;然后根据jpg压缩原理,通过计算三原色差值的平均值来对比原图与最后压缩后的副本图片的差异,由此可以进一步检测证件的人像图片的真伪,甄别出被修改的人像图片,提高身份识别的准确率及效率。
图1为本申请电子装置一实施例的硬件架构的示意图;
图2为本申请基于证件图片的身份识别方法一实施例的流程示意图。
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。
参阅图1所示,图1为本申请电子装置一实施例的硬件架构的示意图。其中,电子装置1是一种能够按照事先设定或者存储的指令,自动进行数值 计算和/或信息处理的设备。所述电子装置1可以是计算机、也可以是单个网络服务器、多个网络服务器组成的服务器组或者基于云计算的由大量主机或者网络服务器构成的云,其中云计算是分布式计算的一种,由一群松散耦合的计算机集组成的一个超级虚拟计算机。
在本实施例中,电子装置1可包括,但不仅限于,可通过系统总线相互通信连接的存储器11、处理器12、网络接口13,存储器11存储有可在处理器12上运行的处理系统。需要指出的是,图1仅示出了具有组件11-13的电子装置1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
其中,存储器11包括内存及至少一种类型的可读存储介质。内存为电子装置1的运行提供缓存;可读存储介质可为如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等的非易失性存储介质。在一些实施例中,可读存储介质可以是电子装置1的内部存储单元,例如该电子装置1的硬盘;在另一些实施例中,该非易失性存储介质也可以是电子装置1的外部存储设备,例如电子装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。本实施例中,存储器11的可读存储介质通常用于存储安装于电子装置1的操作系统和各类应用软件,例如存储本申请一实施例中的处理系统的程序代码等。此外,存储器11还可以用于暂时地存储已经输出或者将要输出的各类数据。
所述处理器12在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器12通常用于控制所述电子装置1的总体操作,例如执行与其他设备进行 数据交互或者通信相关的控制和处理等。本实施例中,所述处理器12用于运行所述存储器11中存储的程序代码或者处理数据,例如运行处理系统等。
所述网络接口13可包括无线网络接口或有线网络接口,该网络接口13通常用于在所述电子装置1与其他电子设备之间建立通信连接。
所述处理系统存储在存储器11中,包括至少一个存储在存储器11中的计算机可读指令,该至少一个计算机可读指令可被处理器器12执行,以实现本申请各实施例的方法;以及,该至少一个计算机可读指令依据其各部分所实现的功能不同,可被划为不同的逻辑模块。
在一实施例中,上述处理系统被所述处理器12执行时实现如下步骤:
处理步骤,获取证件图片中的人像图片,对该人像图片进行二值化得到二值化图片,并利用膨胀算法对二值化图片进行处理,得到像素强化后的图片;
其中,证件图片中包括文字部分及人像部分,首先通过二值化算法获取证件中的人像图片的轮廓(即只有黑白颜色的人像图片):设定一个全局的阈值T,用T将人像图片分成两部分:大于T的像素群和小于T的像素群,将大于T的像素群的像素值设定为白色(或者黑色),小于T的像素群的像素值设定为黑色(或者白色)。具体地,设置T=127,计算证件图片中人像图片的每一个像素的三原色平均值I=(R+G+B)/3,如果I>127,则设置该像素为白色,即R=G=B=255;否则设置为黑色,即R=G=B=0,由此将人像图片二值化。
然后,膨胀算法对二值化图片进行处理,在一实施例中,利用膨胀算法对二值化图片进行处理得到像素强化后的图片的步骤包括:
设置预设大小的结构元素,在扫描二值化图片的像素时,将该结构元素与所扫描的每一像素进行或运算,获取运算结果;若该运算结果为0,则将该像素置为0,若该该运算结果为1,则将该像素置为1,以得到像素强化后 的图片。
其中,该步骤主要是将与人像接触的所有背景像素点合并到人像中,使人像的边界向外部扩张,具体地,预设大小的结构元素为3*3的结构元素,扫描二值化图片的每一个像素,用3*3的结构元素与其覆盖的二值化图片的像素进行或运算操作,如果都为0,结果该像素为0;否则为1,以得到像素强化后的图片。
直线检测步骤,利用预设的直线检测算法分析像素强化后的图片中的直线,并筛选出无直线的图片;
本实施例中,预设的直线检测算法优选地为霍夫变换算法或者为基于链码检测的直线检测算法。其中,对于霍夫变换算法,霍夫变换算法把图像平面的边缘点按待求曲线的函数关系映射到参数空间,进行累加后找出最大峰值点。具体地,在直角坐标系和极坐标系的对应关系,点、直线在两个坐标系中是对偶关系,即在直角坐标系中的点是极坐标系中的线,在直角坐标系中的线是极坐标系中的点。根据这一原理,像素强化后的图片可看做直角坐标系,检测该图片中的直线,可以转化为检测对应转换后的极坐标系中的点,极坐标中对应的点用(r,theta)表示:r=cos(theta)*x+sin(theta)*y。经霍夫变换算法检测后,如果有直线(例如纵横线)则为篡改过的图片,例如为PS过的图片,则该证件为假证件;如果没有直线则初步确定为没有篡改过的图片,可将其筛选出来进一步检测该证件的真伪。
对于基于链码检测的直线检测算法,在素强化后的图片中,如果存在直线,则其在链码上表现为在一定范围内只出现一个方向,或者两个方向交替出现,根据该特点进行直线检测,首先对素强化后的图片的链码进行扫描,记录每次链码方向出现的持续长度,得到链码的统计数据,包括起始点坐标、跟踪方向及持续长度;获得上一步的统计数据,根据统计数据中链码的起始点坐标、跟踪方向及持续长度分析该直线是否为满足要求直线要求的直线, 经过基于链码检测的直线检测算法后,如果有直线(例如纵横线)则为篡改过的图片,例如为PS过的图片,则该证件为假证件;如果没有直线则初步确定为没有篡改过的图片,可将其筛选出来进一步检测该证件的真伪。
本实施例通过预设的直线检测算法检测出有直线的图片,该有直线的图片为经过篡改的图片,可将其过滤掉,证件一旦被过滤,将不会进一步识别,提高处理效率,将剩下的证件图片中的人像图片再进一步进行分析,提高证件真伪甄别的准确度。
图片分析步骤,获取筛选出的图片对应的证件图片中的人像图片,将筛选出的图片对应的证件图片中的人像图片按照预定的压缩质量参数连续两次保存为jpg格式的副本图片,分析该证件图片中的人像图片与副本图片的三原色差异,根据分析结果进行身份识别。
本实施例针对的是证件图片,例如身份证等证件,其颜色单一,压缩率较统一,因此可以通过压缩的方法对图片进行分析。在一优选的实施例中,预定的压缩质量参数为75,当然也可以是其他与75相近的压缩质量参数。
具体地,将筛选出来的图片对应的证件图片中的人像图片(即原图)首先保存为jpg格式的副本,根据jpg压缩原理,图片每次保存为jpg格式时都会进行压缩,其过程为将图片转为YCrCb的方式,然后对CrCb进行大幅度压缩,每次压缩都会丢失一部分信息,副本图片由于信息缺失而导致图片噪点的出现,随着保存次数的增加,图片会趋于稳定,每次引入噪点的数量会减少。然后再将副本再按照上述的压缩质量参数进行一次图片压缩保存,得到副本图片。
在一实施例中,上述分析该证件图片中的人像图片与副本图片的三原色差异的步骤包括:
计算证件图片中的人像图片中每一像素与副本图片对应像素的三原色差值,计算每个像素点对应的三原色差值的平均值,以该三原色差值的平均 值组成差值矩阵;
将该差值矩阵分成预设大小的分区,计算每一分区的差值的平均值,计算整个差值矩阵的差值的平均值,获取每一分区的差值的平均值与整个差值矩阵的差值的平均值之间的差异值;
若所有的差异值均处于预设的阈值范围内,则确定该证件图片为真实图片,若有差异值不处于预设的阈值范围内,则确定该证件图片为伪造图片。
其中,预设大小的分区为8*8的分区,具体的算法包括:
idiff=uint8(abs(double(ori)-double(temp))*30);
me=max(max(max(idiff)));
Idiff=uint8(double(idiff)*255/double(me));
其中,idiff为差值图像(包含三原色),ori为证件图片中的人像图片的三原色RGB信息,double是将图片信息数值化,temp为副本图片的三原色RGB信息,abs为求绝对值,uint8为图片数据转图片样式,me为差值图像各像素点三原色中差异最大的,Idiff=uint8(double(idiff)*255/double(me))为归一化处理,即进行255颜色区间的映射处理,使得值都在0-255之间,这样就能很好的用图片展示,并对各种特性进行较大区分。
在通过上述的算法得到差异值后,若所有的差异值均处于预设的阈值范围内,则确定该证件图片为真实图片,即如果人像图片明显过于明亮的地方均匀或明显过于黑暗的地方均匀,或者人像图片中没有明显过于明亮或明显过于黑暗的地方,则该证件的人像图片为真实的,若有差异值不处于预设的阈值范围内,则确定该证件图片为伪造图片,即如果图片明显过于明亮的地方不均匀或明显过于黑暗的地方不均匀,则该证件的人像图片为伪造的。
本实施例是限于固定场景,即识别证件的人像图片的真伪来识别身份的真伪,在通过预设的直线检测算法筛选出没有直线的图片后,加上更适合证件的纹理检测方法,并且由于证件的人像图片颜色单一、差值图像直接选择 三原色差异均值作为最终值,对精确度影响很小,但运行效率提高很多,适合大量使用。
与现有技术相比,本申请首先检测证件的人像图片的直线来初步确定其是否被篡改过的图片,对证件的人像图片进行过滤,由于证件一旦被过滤,将不会进一步识别,因此增加证件信息识别的效率及安全性;然后根据jpg压缩原理,通过计算三原色差值的平均值来对比原图与最后压缩后的副本图片的差异,由此可以进一步检测证件的人像图片的真伪,甄别出被修改的人像图片,提高身份识别的准确率及效率。
如图2所示,图2为本申请基于证件图片的身份识别方法一实施例的流程示意图,该基于证件图片的身份识别方法包括以下步骤:
步骤S1,获取证件图片中的人像图片,对该人像图片进行二值化得到二值化图片,并利用膨胀算法对二值化图片进行处理,得到像素强化后的图片;
其中,证件图片中包括文字部分及人像部分,首先通过二值化算法获取证件中的人像图片的轮廓(即只有黑白颜色的人像图片):设定一个全局的阈值T,用T将人像图片分成两部分:大于T的像素群和小于T的像素群,将大于T的像素群的像素值设定为白色(或者黑色),小于T的像素群的像素值设定为黑色(或者白色)。具体地,设置T=127,计算证件图片中人像图片的每一个像素的三原色平均值I=(R+G+B)/3,如果I>127,则设置该像素为白色,即R=G=B=255;否则设置为黑色,即R=G=B=0,由此将人像图片二值化。
然后,膨胀算法对二值化图片进行处理,在一实施例中,利用膨胀算法对二值化图片进行处理得到像素强化后的图片的步骤包括:
设置预设大小的结构元素,在扫描二值化图片的像素时,将该结构元素 与所扫描的每一像素进行或运算,获取运算结果;若该运算结果为0,则将该像素置为0,若该该运算结果为1,则将该像素置为1,以得到像素强化后的图片。
其中,该步骤主要是将与人像接触的所有背景像素点合并到人像中,使人像的边界向外部扩张,具体地,预设大小的结构元素为3*3的结构元素,扫描二值化图片的每一个像素,用3*3的结构元素与其覆盖的二值化图片的像素进行或运算操作,如果都为0,结果该像素为0;否则为1,以得到像素强化后的图片。
步骤S2,利用预设的直线检测算法分析像素强化后的图片中的直线,并筛选出无直线的图片;
本实施例中,预设的直线检测算法优选地为霍夫变换算法或者为基于链码检测的直线检测算法。其中,对于霍夫变换算法,霍夫变换算法把图像平面的边缘点按待求曲线的函数关系映射到参数空间,进行累加后找出最大峰值点。具体地,在直角坐标系和极坐标系的对应关系,点、直线在两个坐标系中是对偶关系,即在直角坐标系中的点是极坐标系中的线,在直角坐标系中的线是极坐标系中的点。根据这一原理,像素强化后的图片可看做直角坐标系,检测该图片中的直线,可以转化为检测对应转换后的极坐标系中的点,极坐标中对应的点用(r,theta)表示:r=cos(theta)*x+sin(theta)*y。经霍夫变换算法检测后,如果有直线(例如纵横线)则为篡改过的图片,例如为PS过的图片,则该证件为假证件;如果没有直线则初步确定为没有篡改过的图片,可将其筛选出来进一步检测该证件的真伪。
对于基于链码检测的直线检测算法,在素强化后的图片中,如果存在直线,则其在链码上表现为在一定范围内只出现一个方向,或者两个方向交替出现,根据该特点进行直线检测,首先对素强化后的图片的链码进行扫描,记录每次链码方向出现的持续长度,得到链码的统计数据,包括起始点坐标、 跟踪方向及持续长度;获得上一步的统计数据,根据统计数据中链码的起始点坐标、跟踪方向及持续长度分析该直线是否为满足要求直线要求的直线,经过基于链码检测的直线检测算法后,如果有直线(例如纵横线)则为篡改过的图片,例如为PS过的图片,则该证件为假证件;如果没有直线则初步确定为没有篡改过的图片,可将其筛选出来进一步检测该证件的真伪。
本实施例通过预设的直线检测算法检测出有直线的图片,该有直线的图片为经过篡改的图片,可将其过滤掉,证件一旦被过滤,将不会进一步识别,提高处理效率,将剩下的证件图片中的人像图片再进一步进行分析,提高证件真伪甄别的准确度。
步骤S3,获取筛选出的图片对应的证件图片中的人像图片,将筛选出的图片对应的证件图片中的人像图片按照预定的压缩质量参数连续两次保存为jpg格式的副本图片,分析该证件图片中的人像图片与副本图片的三原色差异,根据分析结果进行身份识别。
本实施例针对的是证件图片,例如身份证等证件,其颜色单一,压缩率较统一,因此可以通过压缩的方法对图片进行分析。在一优选的实施例中,预定的压缩质量参数为75,当然也可以是其他与75相近的压缩质量参数。
具体地,将筛选出来的图片对应的证件图片中的人像图片(即原图)首先保存为jpg格式的副本,根据jpg压缩原理,图片每次保存为jpg格式时都会进行压缩,其过程为将图片转为YCrCb的方式,然后对CrCb进行大幅度压缩,每次压缩都会丢失一部分信息,副本图片由于信息缺失而导致图片噪点的出现,随着保存次数的增加,图片会趋于稳定,每次引入噪点的数量会减少。然后再将副本再按照上述的压缩质量参数进行一次图片压缩保存,得到副本图片。
在一实施例中,上述分析该证件图片中的人像图片与副本图片的三原色差异的步骤包括:
计算证件图片中的人像图片中每一像素与副本图片对应像素的三原色差值,计算每个像素点对应的三原色差值的平均值,以该三原色差值的平均值组成差值矩阵;
将该差值矩阵分成预设大小的分区,计算每一分区的差值的平均值,计算整个差值矩阵的差值的平均值,获取每一分区的差值的平均值与整个差值矩阵的差值的平均值之间的差异值;
若所有的差异值均处于预设的阈值范围内,则确定该证件图片为真实图片,若有差异值不处于预设的阈值范围内,则确定该证件图片为伪造图片。
其中,预设大小的分区为8*8的分区,具体的算法包括:
idiff=uint8(abs(double(ori)-double(temp))*30);
me=max(max(max(idiff)));
Idiff=uint8(double(idiff)*255/double(me));
其中,idiff为差值图像(包含三原色),ori为证件图片中的人像图片的三原色RGB信息,double是将图片信息数值化,temp为副本图片的三原色RGB信息,abs为求绝对值,uint8为图片数据转图片样式,me为差值图像各像素点三原色中差异最大的,Idiff=uint8(double(idiff)*255/double(me))为归一化处理,即进行255颜色区间的映射处理,使得值都在0-255之间,这样就能很好的用图片展示,并对各种特性进行较大区分。
在通过上述的算法得到差异值后,若所有的差异值均处于预设的阈值范围内,则确定该证件图片为真实图片,即如果人像图片明显过于明亮的地方均匀或明显过于黑暗的地方均匀,或者人像图片中没有明显过于明亮或明显过于黑暗的地方,则该证件的人像图片为真实的,若有差异值不处于预设的阈值范围内,则确定该证件图片为伪造图片,即如果图片明显过于明亮的地方不均匀或明显过于黑暗的地方不均匀,则该证件的人像图片为伪造的。
本实施例是限于固定场景,即识别证件的人像图片的真伪来识别身份的 真伪,在通过预设的直线检测算法筛选出没有直线的图片后,加上更适合证件的纹理检测方法,并且由于证件的人像图片颜色单一、差值图像直接选择三原色差异均值作为最终值,对精确度影响很小,但运行效率提高很多,适合大量使用。
与现有技术相比,本申请首先检测证件的人像图片的直线来初步确定其是否被篡改过的图片,对证件的人像图片进行过滤,由于证件一旦被过滤,将不会进一步识别,因此增加证件信息识别的效率及安全性;然后根据jpg压缩原理,通过计算三原色差值的平均值来对比原图与最后压缩后的副本图片的差异,由此可以进一步检测证件的人像图片的真伪,甄别出被修改的人像图片,提高身份识别的准确率及效率。
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有处理系统,所述处理系统被处理器执行时实现上述的基于证件图片的身份识别方法的步骤。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。
Claims (20)
- 一种电子装置,其特征在于,所述电子装置包括存储器及与所述存储器连接的处理器,所述存储器中存储有可在所述处理器上运行的处理系统,所述处理系统被所述处理器执行时实现如下步骤:处理步骤,获取证件图片中的人像图片,对该人像图片进行二值化得到二值化图片,并利用膨胀算法对二值化图片进行处理,得到像素强化后的图片;直线检测步骤,利用预设的直线检测算法分析像素强化后的图片中的直线,并筛选出无直线的图片;图片分析步骤,获取筛选出的图片对应的证件图片中的人像图片,将筛选出的图片对应的证件图片中的人像图片按照预定的压缩质量参数连续两次保存为jpg格式的副本图片,分析该证件图片中的人像图片与副本图片的三原色差异,根据分析结果进行身份识别。
- 根据权利要求1所述的电子装置,其特征在于,所述分析该证件图片中的人像图片与副本图片的三原色差异的步骤,具体包括:计算证件图片中的人像图片中每一像素与副本图片对应像素的三原色差值,计算每个像素点对应的三原色差值的平均值,以该三原色差值的平均值组成差值矩阵;将该差值矩阵分成预设大小的分区,计算每一分区的差值的平均值,计算整个差值矩阵的差值的平均值,获取每一分区的差值的平均值与整个差值矩阵的差值的平均值之间的差异值;若所有的差异值均处于预设的阈值范围内,则确定该证件图片为真实图片,若有差异值不处于预设的阈值范围内,则确定该证件图片为伪造图片。
- 根据权利要求1所述的电子装置,其特征在于,所述预设的直线检测算法为霍夫变换算法或者为基于链码检测的直线检测算法。
- 根据权利要求2所述的电子装置,其特征在于,所述预设的直线检测算法为霍夫变换算法或者为基于链码检测的直线检测算法。
- 根据权利要求1所述的电子装置,其特征在于,所述利用膨胀算法对二值化图片进行处理,得到像素强化后的图片的步骤,具体包括:设置预设大小的结构元素,在扫描二值化图片的像素时,将该结构元素与所扫描的每一像素进行或运算,获取运算结果;若该运算结果为0,则将该像素置为0,若该该运算结果为1,则将该像素置为1,以得到像素强化后的图片。
- 根据权利要求2所述的电子装置,其特征在于,所述利用膨胀算法对二值化图片进行处理,得到像素强化后的图片的步骤,具体包括:设置预设大小的结构元素,在扫描二值化图片的像素时,将该结构元素与所扫描的每一像素进行或运算,获取运算结果;若该运算结果为0,则将该像素置为0,若该该运算结果为1,则将该像素置为1,以得到像素强化后的图片。
- 根据权利要求1或2所述的电子装置,其特征在于,所述预定的压缩质量参数为75。
- 一种基于证件图片的身份识别方法,其特征在于,所述基于证件图片的身份识别方法包括:S1,获取证件图片中的人像图片,对该人像图片进行二值化得到二值化图片,并利用膨胀算法对二值化图片进行处理,得到像素强化后的图片;S2,利用预设的直线检测算法分析像素强化后的图片中的直线,并筛选出无直线的图片;S3,获取筛选出的图片对应的证件图片中的人像图片,将筛选出的图片对应的证件图片中的人像图片按照预定的压缩质量参数连续两次保存为jpg格式的副本图片,分析该证件图片中的人像图片与副本图片的三原色差异, 根据分析结果进行身份识别。
- 根据权利要求8所述的基于证件图片的身份识别方法,其特征在于,所述分析该证件图片中的人像图片与副本图片的三原色差异的步骤,具体包括:计算证件图片中的人像图片中每一像素与副本图片对应像素的三原色差值,计算每个像素点对应的三原色差值的平均值,以该三原色差值的平均值组成差值矩阵;将该差值矩阵分成预设大小的分区,计算每一分区的差值的平均值,计算整个差值矩阵的差值的平均值,获取每一分区的差值的平均值与整个差值矩阵的差值的平均值之间的差异值;若所有的差异值均处于预设的阈值范围内,则确定该证件图片为真实图片,若有差异值不处于预设的阈值范围内,则确定该证件图片为伪造图片。
- 根据权利要求8所述的基于证件图片的身份识别方法,其特征在于,所述预设的直线检测算法为霍夫变换算法或者为基于链码检测的直线检测算法。
- 根据权利要求9所述的基于证件图片的身份识别方法,其特征在于,所述预设的直线检测算法为霍夫变换算法或者为基于链码检测的直线检测算法。
- 根据权利要求8所述的基于证件图片的身份识别方法,其特征在于,所述利用膨胀算法对二值化图片进行处理,得到像素强化后的图片的步骤,具体包括:设置预设大小的结构元素,在扫描二值化图片的像素时,将该结构元素与所扫描的每一像素进行或运算,获取运算结果;若该运算结果为0,则将该像素置为0,若该该运算结果为1,则将该像素置为1,以得到像素强化后的图片。
- 根据权利要求9所述的基于证件图片的身份识别方法,其特征在于,所述利用膨胀算法对二值化图片进行处理,得到像素强化后的图片的步骤,具体包括:设置预设大小的结构元素,在扫描二值化图片的像素时,将该结构元素与所扫描的每一像素进行或运算,获取运算结果;若该运算结果为0,则将该像素置为0,若该该运算结果为1,则将该像素置为1,以得到像素强化后的图片。
- 根据权利要求8或9所述的基于证件图片的身份识别方法,其特征在于,所述预定的压缩质量参数为75。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有处理系统,所述处理系统被处理器执行时实现步骤:处理步骤,获取证件图片中的人像图片,对该人像图片进行二值化得到二值化图片,并利用膨胀算法对二值化图片进行处理,得到像素强化后的图片;直线检测步骤,利用预设的直线检测算法分析像素强化后的图片中的直线,并筛选出无直线的图片;图片分析步骤,获取筛选出的图片对应的证件图片中的人像图片,将筛选出的图片对应的证件图片中的人像图片按照预定的压缩质量参数连续两次保存为jpg格式的副本图片,分析该证件图片中的人像图片与副本图片的三原色差异,根据分析结果进行身份识别。
- 根据权利要求15所述的计算机可读存储介质,其特征在于,所述分析该证件图片中的人像图片与副本图片的三原色差异的步骤,具体包括:计算证件图片中的人像图片中每一像素与副本图片对应像素的三原色差值,计算每个像素点对应的三原色差值的平均值,以该三原色差值的平均值组成差值矩阵;将该差值矩阵分成预设大小的分区,计算每一分区的差值的平均值,计算整个差值矩阵的差值的平均值,获取每一分区的差值的平均值与整个差值矩阵的差值的平均值之间的差异值;若所有的差异值均处于预设的阈值范围内,则确定该证件图片为真实图片,若有差异值不处于预设的阈值范围内,则确定该证件图片为伪造图片。
- 根据权利要求15所述的计算机可读存储介质,其特征在于,所述预设的直线检测算法为霍夫变换算法或者为基于链码检测的直线检测算法。
- 根据权利要求16所述的计算机可读存储介质,其特征在于,所述预设的直线检测算法为霍夫变换算法或者为基于链码检测的直线检测算法。
- 根据权利要求15所述的计算机可读存储介质,其特征在于,所述利用膨胀算法对二值化图片进行处理,得到像素强化后的图片的步骤,具体包括:设置预设大小的结构元素,在扫描二值化图片的像素时,将该结构元素与所扫描的每一像素进行或运算,获取运算结果;若该运算结果为0,则将该像素置为0,若该该运算结果为1,则将该像素置为1,以得到像素强化后的图片。
- 根据权利要求16所述的计算机可读存储介质,其特征在于,所述利用膨胀算法对二值化图片进行处理,得到像素强化后的图片的步骤,具体包括:设置预设大小的结构元素,在扫描二值化图片的像素时,将该结构元素与所扫描的每一像素进行或运算,获取运算结果;若该运算结果为0,则将该像素置为0,若该该运算结果为1,则将该像素置为1,以得到像素强化后的图片。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810312856.0A CN108805001B (zh) | 2018-04-09 | 2018-04-09 | 电子装置、基于证件图片的身份识别方法及存储介质 |
CN201810312856.0 | 2018-04-09 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019196298A1 true WO2019196298A1 (zh) | 2019-10-17 |
Family
ID=64095473
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/102089 WO2019196298A1 (zh) | 2018-04-09 | 2018-08-24 | 电子装置、基于证件图片的身份识别方法及存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108805001B (zh) |
WO (1) | WO2019196298A1 (zh) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111275042A (zh) * | 2020-01-21 | 2020-06-12 | 支付宝实验室(新加坡)有限公司 | 伪造证件的识别方法、装置及电子设备 |
CN113129254A (zh) * | 2019-12-31 | 2021-07-16 | 深圳云天励飞技术有限公司 | 单色调图片检测方法、装置、设备及存储介质 |
CN113989512A (zh) * | 2020-07-27 | 2022-01-28 | 北京市天元网络技术股份有限公司 | 分光器端口识别方法及装置 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101493927A (zh) * | 2009-02-27 | 2009-07-29 | 西北工业大学 | 基于边缘方向特征的图像可信度检测方法 |
CN101901470A (zh) * | 2010-02-10 | 2010-12-01 | 桂林电子科技大学 | 基于能量域半脆弱水印的图像篡改检测及恢复方法 |
CN102136063A (zh) * | 2011-03-15 | 2011-07-27 | 西安电子科技大学 | 基于泽尼克矩的快速图像比对方法 |
CN103249574A (zh) * | 2010-08-17 | 2013-08-14 | 株式会社伪物识别技术研究所 | 一般人利用印刷的微细识别标记可容易鉴定真伪的验证方法 |
CN105141842A (zh) * | 2015-08-31 | 2015-12-09 | 广州市幸福网络技术有限公司 | 一种防篡改的证照相机系统及方法 |
WO2018032270A1 (en) * | 2016-08-15 | 2018-02-22 | Qualcomm Incorporated | Low complexity tamper detection in video analytics |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100664394B1 (ko) * | 2005-05-14 | 2007-01-05 | 와이즈큐브 주식회사 | 이미지 스캐너 |
KR101125799B1 (ko) * | 2010-04-26 | 2012-03-27 | 한국조폐공사 | 사진 이미지를 이용한 위조 방지용 id 증명서 |
CN102129555A (zh) * | 2011-03-23 | 2011-07-20 | 北京深思洛克软件技术股份有限公司 | 基于第二代身份证进行身份验证的方法及系统 |
CN103426016B (zh) * | 2013-08-14 | 2017-04-12 | 湖北微模式科技发展有限公司 | 一种第二代身份证真伪鉴别方法与装置 |
CN107464237A (zh) * | 2017-08-04 | 2017-12-12 | 平安科技(深圳)有限公司 | 图像篡改检测方法、电子装置及可读存储介质 |
CN107862303B (zh) * | 2017-11-30 | 2019-04-26 | 平安科技(深圳)有限公司 | 表格类图像的信息识别方法、电子装置及可读存储介质 |
-
2018
- 2018-04-09 CN CN201810312856.0A patent/CN108805001B/zh active Active
- 2018-08-24 WO PCT/CN2018/102089 patent/WO2019196298A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101493927A (zh) * | 2009-02-27 | 2009-07-29 | 西北工业大学 | 基于边缘方向特征的图像可信度检测方法 |
CN101901470A (zh) * | 2010-02-10 | 2010-12-01 | 桂林电子科技大学 | 基于能量域半脆弱水印的图像篡改检测及恢复方法 |
CN103249574A (zh) * | 2010-08-17 | 2013-08-14 | 株式会社伪物识别技术研究所 | 一般人利用印刷的微细识别标记可容易鉴定真伪的验证方法 |
CN102136063A (zh) * | 2011-03-15 | 2011-07-27 | 西安电子科技大学 | 基于泽尼克矩的快速图像比对方法 |
CN105141842A (zh) * | 2015-08-31 | 2015-12-09 | 广州市幸福网络技术有限公司 | 一种防篡改的证照相机系统及方法 |
WO2018032270A1 (en) * | 2016-08-15 | 2018-02-22 | Qualcomm Incorporated | Low complexity tamper detection in video analytics |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113129254A (zh) * | 2019-12-31 | 2021-07-16 | 深圳云天励飞技术有限公司 | 单色调图片检测方法、装置、设备及存储介质 |
CN111275042A (zh) * | 2020-01-21 | 2020-06-12 | 支付宝实验室(新加坡)有限公司 | 伪造证件的识别方法、装置及电子设备 |
CN113989512A (zh) * | 2020-07-27 | 2022-01-28 | 北京市天元网络技术股份有限公司 | 分光器端口识别方法及装置 |
Also Published As
Publication number | Publication date |
---|---|
CN108805001A (zh) | 2018-11-13 |
CN108805001B (zh) | 2019-12-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20200410074A1 (en) | Identity authentication method and apparatus, electronic device, and storage medium | |
US20210383150A1 (en) | Iterative recognition-guided thresholding and data extraction | |
KR102324706B1 (ko) | 얼굴인식 잠금해제 방법 및 장치, 기기, 매체 | |
Scherhag et al. | Detection of face morphing attacks based on PRNU analysis | |
US11302109B2 (en) | Range and/or polarity-based thresholding for improved data extraction | |
US9754164B2 (en) | Systems and methods for classifying objects in digital images captured using mobile devices | |
WO2020082731A1 (zh) | 电子装置、证件识别方法及存储介质 | |
Kraetzer et al. | Modeling attacks on photo-ID documents and applying media forensics for the detection of facial morphing | |
Spreeuwers et al. | Towards robust evaluation of face morphing detection | |
WO2019200802A1 (zh) | 合同影像图片的识别方法、电子装置及可读存储介质 | |
JP5934174B2 (ja) | 印刷文書を認証するための方法及びプログラム | |
CN111191568A (zh) | 翻拍图像识别方法、装置、设备及介质 | |
TW201944294A (zh) | 身份驗證方法和裝置、電子裝置、電腦程式和儲存介質 | |
WO2019196298A1 (zh) | 电子装置、基于证件图片的身份识别方法及存储介质 | |
JP2001186340A (ja) | 偽造検出方法 | |
Wang et al. | Image copy-move forgery detection based on dynamic threshold with dense points | |
US20190102617A1 (en) | System and method of training a classifier for determining the category of a document | |
WO2019071663A1 (zh) | 电子装置、虚拟样本生成方法及存储介质 | |
William et al. | Robust image forgery detection using point feature analysis | |
CN113033562A (zh) | 一种图像处理方法、装置、设备及存储介质 | |
CN116503871A (zh) | 字符分割的预处理方法、终端设备和计算机可读存储介质 | |
Srivastava et al. | Local binary pattern based technique for content based image copy detection | |
CN111860314A (zh) | 基于图像识别的电子证照验证方法、装置和系统 | |
Kumar et al. | A review of image features extraction techniques and their applications in image forensic | |
Lourembam et al. | A robust image copy detection method using machine learning |
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: 18914827 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 25/01/2021) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18914827 Country of ref document: EP Kind code of ref document: A1 |