[go: up one dir, main page]

CN118397664A - Method and device for detecting fingerprint residues of shell - Google Patents

Method and device for detecting fingerprint residues of shell Download PDF

Info

Publication number
CN118397664A
CN118397664A CN202410861975.7A CN202410861975A CN118397664A CN 118397664 A CN118397664 A CN 118397664A CN 202410861975 A CN202410861975 A CN 202410861975A CN 118397664 A CN118397664 A CN 118397664A
Authority
CN
China
Prior art keywords
fingerprint
area
image
target
target area
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.)
Granted
Application number
CN202410861975.7A
Other languages
Chinese (zh)
Other versions
CN118397664B (en
Inventor
刘添鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202410861975.7A priority Critical patent/CN118397664B/en
Publication of CN118397664A publication Critical patent/CN118397664A/en
Application granted granted Critical
Publication of CN118397664B publication Critical patent/CN118397664B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/12Fingerprints or palmprints
    • G06V40/1347Preprocessing; Feature extraction
    • G06V40/1359Extracting features related to ridge properties; Determining the fingerprint type, e.g. whorl or loop
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Image Input (AREA)
  • Collating Specific Patterns (AREA)

Abstract

本申请实施例公开了一种壳体指纹残留的检测方法及装置,该方法可包括:获取指纹图像,所述指纹图像为针对目标壳体表面上的指纹进行拍摄得到的图像;对所述指纹图像进行图像处理,确定所述指纹图像中的目标区域、以及所述目标区域中采集有指纹纹路的指纹区域;基于所述指纹区域的像素信息与所述目标区域的像素信息,确定所述指纹区域与目标区域的对比度;基于所述指纹区域的面积和所述对比度,判断所述目标壳体的指纹残留性能。采用本申请实施例可以有效地利用图像中的更多信息确定指纹残留性能,并提高壳体指纹残留的检测方案的客观性和准确性。

The embodiment of the present application discloses a method and device for detecting fingerprint residue on a shell, the method may include: obtaining a fingerprint image, the fingerprint image being an image obtained by photographing a fingerprint on the surface of a target shell; performing image processing on the fingerprint image to determine a target area in the fingerprint image and a fingerprint area in the target area where fingerprint patterns are collected; determining the contrast between the fingerprint area and the target area based on the pixel information of the fingerprint area and the pixel information of the target area; judging the fingerprint residue performance of the target shell based on the area of the fingerprint area and the contrast. The embodiment of the present application can effectively use more information in the image to determine the fingerprint residue performance, and improve the objectivity and accuracy of the detection scheme of fingerprint residue on the shell.

Description

一种壳体指纹残留的检测方法及装置A method and device for detecting fingerprint residue on housing

技术领域Technical Field

本申请涉及指纹识别技术领域,尤其涉及一种壳体指纹残留的检测方法及装置。The present application relates to the field of fingerprint recognition technology, and in particular to a method and device for detecting fingerprint residue on a housing.

背景技术Background technique

指纹识别技术领域是一门涉及图像处理、模式识别和信息安全等多学科交叉的领域,旨在通过识别个体独特的指纹图像来进行信息识别。在该领域中,壳体的指纹残留测试主要用于对材料的抗指纹性能、抗脏污性能进行检测。Fingerprint recognition technology is a multidisciplinary field involving image processing, pattern recognition and information security, and aims to identify information by identifying an individual's unique fingerprint image. In this field, the fingerprint residue test of the shell is mainly used to test the material's anti-fingerprint and anti-fouling properties.

目前,壳体指纹残留的检测主要通过工作人员观察指纹图像来判断壳体的抗指纹性能,不同的工作人员可能对壳体上的指纹残留有不同的判断标准,且未能充分利用图像中的其他信息,导致测试结果的客观性和准确性有限。需要提供一种壳体指纹残留的检测方法,可以有效地利用图像中的更多信息确定指纹残留性能,并提高壳体指纹残留的检测方案的客观性和准确性。At present, the detection of fingerprint residue on the shell is mainly judged by staff observing the fingerprint image to determine the anti-fingerprint performance of the shell. Different staff may have different judgment criteria for fingerprint residue on the shell, and fail to make full use of other information in the image, resulting in limited objectivity and accuracy of the test results. It is necessary to provide a detection method for fingerprint residue on the shell, which can effectively use more information in the image to determine the fingerprint residue performance and improve the objectivity and accuracy of the detection scheme of fingerprint residue on the shell.

发明内容Summary of the invention

本申请实施例所要解决的技术问题在于,提供一种壳体指纹残留的检测方法及装置,可以有效地利用图像中的更多信息确定指纹残留性能,并提高壳体指纹残留的检测方案的客观性和准确性。The technical problem to be solved by the embodiments of the present application is to provide a method and device for detecting fingerprint residues on a shell, which can effectively use more information in an image to determine fingerprint residue performance and improve the objectivity and accuracy of the detection scheme for fingerprint residues on the shell.

第一方面,本申请实施例提供了一种壳体指纹残留的检测方法,可包括:获取指纹图像,所述指纹图像为针对目标壳体表面上的指纹进行拍摄得到的图像;对所述指纹图像进行图像处理,确定所述指纹图像中的目标区域、以及所述目标区域中采集有指纹纹路的指纹区域;基于所述指纹区域的像素信息与所述目标区域的像素信息,确定所述指纹区域与所述目标区域的对比度;基于所述指纹区域的面积和所述对比度,判断所述目标壳体的指纹残留性能。In a first aspect, an embodiment of the present application provides a method for detecting fingerprint residue on a shell, which may include: acquiring a fingerprint image, wherein the fingerprint image is an image obtained by photographing a fingerprint on the surface of a target shell; performing image processing on the fingerprint image to determine a target area in the fingerprint image and a fingerprint area in the target area where fingerprint patterns are collected; determining a contrast ratio between the fingerprint area and the target area based on pixel information of the fingerprint area and pixel information of the target area; and judging the fingerprint residue performance of the target shell based on the area of the fingerprint area and the contrast ratio.

在现有的壳体指纹残留的检测方法中,通常是通过工作人员观察指纹图像的指纹清晰度、指纹可见性等肉眼可见的数据来评估壳体的抗指纹性能,这种方法仅仅基于工作人员的主观判断,缺乏对图像中其他信息的充分利用,导致壳体残留指纹的检测结果的客观性和准确性较低。针对该技术问题,本申请实施例中提供了一种更为客观的壳体指纹残留的检测方法,可以在基于指纹图像确定目标区域、以及目标区域中的包括指纹纹路的指纹区域后,将指纹区域放入目标区域中进行比对,得到指纹区域与目标区域的对比度,最后将上述对比度与指纹区域的面积与预设的标准值进行对比,以客观的判断目标壳体的指纹残留性能(即抗指纹性能和抗脏污性能),相较于现有技术中通过工作人员主观的判断壳体的指纹残留性能,本申请实施例中可以通过客观的比较指纹图像中的数据信息来进行指纹残留性能的判断,即本申请实施例中可以通过上述对比度判断指纹区域与目标区域之间的颜色或亮度差异程度(例如在对比不同材质的壳体上的指纹残留性能时,因为颜色差异较大,因此通过指纹区域与目标区域的RGB通道值的对比度,可以更准确的判断不同壳体之间的指纹残留性能的差异,或者,在比较相同材质的壳体上的指纹残留性能时,因为颜色差异较小,而灰度信息中包含更多的特征信息,因此通过指纹区域与目标区域的灰度值的对比度,可以更准确的判断不同壳体之间的指纹残留性能的差异),并通过上述指纹区域的面积判断指纹残留的数量或密度,从而更准确且更客观的判断指纹残留性能,提高了壳体指纹残留的检测的准确性和客观性。In the existing detection methods of fingerprint residues on shells, the anti-fingerprint performance of the shell is usually evaluated by staff observing the fingerprint clarity, fingerprint visibility and other visible data of the fingerprint image. This method is only based on the subjective judgment of the staff and lacks full use of other information in the image, resulting in low objectivity and accuracy of the detection results of residual fingerprints on the shell. In response to this technical problem, a more objective detection method of fingerprint residues on the shell is provided in the embodiment of the present application. After determining the target area based on the fingerprint image and the fingerprint area including the fingerprint lines in the target area, the fingerprint area is placed in the target area for comparison to obtain the contrast between the fingerprint area and the target area. Finally, the above contrast and the area of the fingerprint area are compared with the preset standard value to objectively judge the fingerprint residue performance (i.e., anti-fingerprint performance and anti-fouling performance) of the target shell. Compared with the prior art in which the fingerprint residue performance of the shell is judged subjectively by the staff, the fingerprint residue performance can be judged by objectively comparing the data information in the fingerprint image in the embodiment of the present application, that is, the fingerprint area can be judged by the above contrast. The degree of color or brightness difference between the target areas (for example, when comparing the fingerprint residue performance on shells of different materials, because the color difference is large, the difference in fingerprint residue performance between different shells can be more accurately judged by the contrast of RGB channel values between the fingerprint area and the target area, or, when comparing the fingerprint residue performance on shells of the same material, because the color difference is small and the grayscale information contains more feature information, the difference in fingerprint residue performance between different shells can be more accurately judged by the contrast of grayscale values between the fingerprint area and the target area), and the number or density of fingerprint residues can be judged by the area of the above fingerprint area, so as to more accurately and objectively judge the fingerprint residue performance, thereby improving the accuracy and objectivity of the detection of fingerprint residues on the shell.

在一种可能的实现方式中,若所述像素信息包括RGB通道值;所述基于所述指纹区域的像素信息与所述指纹图像的像素信息,确定所述指纹区域与目标区域的对比度,包括;确定所述指纹区域的RGB通道值中的每个通道值之和,和所述目标区域的RGB通道值中的每个通道值之和;将所述指纹区域的RGB通道值中的每个通道值之和,与所述目标区域的RGB通道值中的每个通道值之和进行对比,得到每个通道的对比度。本申请实施例中可以通过将指纹区域与目标区域的RGB通道值中每个通道值之和进行对比,以获取指纹区域与目标区域的颜色差异信息,指纹区域与目标区域的颜色差异程度越大,则指纹残留程度越高;进一步地,在对比不同材质的壳体上的指纹残留性能时,因为不同材质的壳体通常具有明显的颜色差异,因此通过指纹区域与目标区域的RGB通道值的对比度,可以更准确的判断不同壳体之间的指纹残留性能的差异,从而在对比不同材质的壳体时提高了壳体指纹残留测试结果的准确性。In a possible implementation, if the pixel information includes RGB channel values; the determination of the contrast between the fingerprint area and the target area based on the pixel information of the fingerprint area and the pixel information of the fingerprint image includes: determining the sum of each channel value in the RGB channel values of the fingerprint area and the sum of each channel value in the RGB channel values of the target area; comparing the sum of each channel value in the RGB channel values of the fingerprint area with the sum of each channel value in the RGB channel values of the target area to obtain the contrast of each channel. In the embodiment of the present application, the color difference information between the fingerprint area and the target area can be obtained by comparing the sum of each channel value in the RGB channel values of the fingerprint area and the target area. The greater the color difference between the fingerprint area and the target area, the higher the fingerprint residue degree; further, when comparing the fingerprint residue performance on the shells of different materials, because the shells of different materials usually have obvious color differences, the difference in fingerprint residue performance between different shells can be more accurately judged by the contrast of the RGB channel values of the fingerprint area and the target area, thereby improving the accuracy of the shell fingerprint residue test results when comparing shells of different materials.

在一种可能的实现方式中,所述对所述指纹图像进行图像处理,确定所述指纹图像中的目标区域、以及所述目标区域中采集有指纹纹路的指纹区域,包括;基于所述指纹图像的拍摄参数确定所述目标区域;将所述目标区域的图像转化为第一灰度图像;对所述第一灰度图像进行图像特征增强处理,得到第二灰度图像;对所述第二灰度图像进行二值化处理,以确定所述目标区域中符合指纹特征的指纹区域。本申请实施例中可以在通过拍摄参数确定指纹图像中的目标区域后,将目标区域的图像转化为灰度图像,对其进行图像特征增强处理,有效地去除噪声并突出指纹特征,以及通过二值化处理将去噪处理后灰度图像中的像素值转化为黑白两种颜色,将黑色像素值中符合指纹特征的区域确定为指纹区域,准确定位出含有指纹纹路的指纹区域,进而提高了壳体指纹残留检测的客观性和结果的准确性。In a possible implementation, the image processing of the fingerprint image to determine the target area in the fingerprint image and the fingerprint area in the target area where the fingerprint lines are collected includes: determining the target area based on the shooting parameters of the fingerprint image; converting the image of the target area into a first grayscale image; performing image feature enhancement processing on the first grayscale image to obtain a second grayscale image; and binarizing the second grayscale image to determine the fingerprint area in the target area that meets the fingerprint features. In the embodiment of the present application, after determining the target area in the fingerprint image by shooting parameters, the image of the target area can be converted into a grayscale image, and image feature enhancement processing can be performed on it to effectively remove noise and highlight fingerprint features, and the pixel values in the grayscale image after denoising processing can be converted into black and white colors by binarization processing, and the area in the black pixel value that meets the fingerprint features is determined as the fingerprint area, and the fingerprint area containing fingerprint lines is accurately located, thereby improving the objectivity of the shell fingerprint residue detection and the accuracy of the results.

在一种可能的实现方式中,所述对所述指纹图像进行图像处理,确定所述指纹图像中的目标区域、以及所述目标区域中采集有指纹纹路的指纹区域,包括;基于所述指纹图像的拍摄参数确定所述目标区域;将所述目标区域的图像转换为第三灰度图像;基于拍摄光源和所述第三灰度图像的面积对所述第三灰度图像进行分区处理,得到多个子区域;对所述第三灰度图像中的每个子区域分别进行图像特征增强处理,得到第四灰度图像;通过对所述第四灰度图像进行二值化处理,并将二值化处理后所述第四灰度图像中的每个子区域共有的连通区域进行合并,以确定所述指纹区域。本申请实施例中通过将图像分为多个子区域后、针对每个子区域进行阈值分割、共有连通区域合并处理,以减少光源不均匀带来的误差影响,进一步提升了提取指纹区域的准确性。具体地,本申请实施例中首先通过指纹图像中的拍摄参数确定目标区域,并在将目标区域的图像转化为灰度图像后,将该灰度图像分成多个子区域,以针对每个子区域进行独立的处理,降低了光源不均匀性带来的误差;进一步地,通过对每个子区域进行阈值分割和特征增强处理(例如去噪处理和形态学处理),以突出指纹纹路的特征,提高了指纹区域的识别准确度;最后,通过合并共有的连通区域,得到连续且完整的指纹区域,减少了光源不均匀带来的影响的同时,还确保了壳体指纹残留的检测结果的准确性。In a possible implementation, the image processing of the fingerprint image to determine the target area in the fingerprint image and the fingerprint area in the target area where the fingerprint lines are collected includes: determining the target area based on the shooting parameters of the fingerprint image; converting the image of the target area into a third grayscale image; partitioning the third grayscale image based on the shooting light source and the area of the third grayscale image to obtain multiple sub-areas; performing image feature enhancement processing on each sub-area in the third grayscale image to obtain a fourth grayscale image; binarizing the fourth grayscale image and merging the connected areas shared by each sub-area in the fourth grayscale image after the binarization processing to determine the fingerprint area. In the embodiment of the present application, after dividing the image into multiple sub-areas, threshold segmentation is performed for each sub-area, and the shared connected areas are merged to reduce the error caused by uneven light sources, thereby further improving the accuracy of extracting the fingerprint area. Specifically, in the embodiment of the present application, the target area is first determined by the shooting parameters in the fingerprint image, and after the image of the target area is converted into a grayscale image, the grayscale image is divided into multiple sub-areas, so that each sub-area is processed independently, thereby reducing the error caused by the unevenness of the light source; further, by performing threshold segmentation and feature enhancement processing (such as denoising and morphological processing) on each sub-area, the characteristics of the fingerprint pattern are highlighted, thereby improving the recognition accuracy of the fingerprint area; finally, by merging the shared connected areas, a continuous and complete fingerprint area is obtained, which reduces the impact of the uneven light source while ensuring the accuracy of the detection result of the fingerprint residue on the shell.

在一种可能的实现方式中,若所述像素信息包括灰度值;所述基于所述指纹区域的像素信息与所述目标区域的像素信息,确定所述指纹区域与目标区域的对比度,包括;确定所述指纹区域的灰度值之和和所述目标区域的灰度值之和;将所述指纹区域的灰度值之和与所述目标区域的灰度值之和的对比结果确定为所述对比度。本申请实施例中可以通过比较指纹区域的灰度值之和与目标区域的灰度值之和,若指纹区域与目标区域的灰度差异程度越大,则指纹残留程度越高;进一步地,在对相同壳体材质进行测试时,因为相同材质的壳体之间的颜色差异较小,而灰度信息中包含更多的特征信息,因此可以通过比较不同壳体之间灰度差异信息判断指纹残留性能之间的差异,因此通过上述灰度差异信息可以更准确且更客观的判断相同壳体材质之间指纹残留性能的差异。In a possible implementation, if the pixel information includes a grayscale value; the determination of the contrast between the fingerprint area and the target area based on the pixel information of the fingerprint area and the pixel information of the target area includes: determining the sum of the grayscale values of the fingerprint area and the sum of the grayscale values of the target area; and determining the contrast as the comparison result of the sum of the grayscale values of the fingerprint area and the sum of the grayscale values of the target area. In the embodiment of the present application, by comparing the sum of the grayscale values of the fingerprint area with the sum of the grayscale values of the target area, if the greater the grayscale difference between the fingerprint area and the target area, the higher the fingerprint residue degree; further, when testing the same shell material, because the color difference between shells of the same material is small, and the grayscale information contains more feature information, the difference between the fingerprint residue performance can be judged by comparing the grayscale difference information between different shells. Therefore, the difference in fingerprint residue performance between the same shell materials can be more accurately and objectively judged through the above grayscale difference information.

在一种可能的实现方式中,所述对所述指纹图像进行图像处理,确定所述指纹图像中的目标区域、以及所述目标区域中采集有指纹纹路的指纹区域,包括;基于拍摄参数确定所述目标区域;将所述目标区域的图像转化为第一灰度图像;从所述第一灰度图像中提取出背景区域,将所述第一灰度图像中的所述背景区域去除;对去除背景区域后的第一灰度图像进行图像特征增强处理,得到第二灰度图像;对所述第二灰度图像进行二值化处理,以确定所述目标区域中符合指纹特征的指纹区域。在对相同材质的壳体进行指纹残留检测时,因为相同材质的壳体之间的颜色差异较小,而灰度信息中包含更多的特征信息,因此可以通过在图像处理(例如图像灰度计算、图像特征增强处理和二值化处理等)过程中增加背景提取和移除步骤,以去除图像中的颜色信息,且有效地减少非指纹区域的干扰,并在进行后续图像处理时基于灰度信息中包含的特征信息更准确的判断相同材质的壳体之间的差异,以提高壳体指纹残留的检测方案的客观性和准确性。In a possible implementation, the fingerprint image is processed to determine the target area in the fingerprint image and the fingerprint area in the target area where the fingerprint pattern is collected, including: determining the target area based on shooting parameters; converting the image of the target area into a first grayscale image; extracting the background area from the first grayscale image and removing the background area in the first grayscale image; performing image feature enhancement processing on the first grayscale image after removing the background area to obtain a second grayscale image; and binarizing the second grayscale image to determine the fingerprint area in the target area that meets the fingerprint feature. When performing fingerprint residue detection on shells of the same material, because the color difference between shells of the same material is small, and the grayscale information contains more feature information, the background extraction and removal steps can be added in the image processing (such as image grayscale calculation, image feature enhancement processing and binarization processing, etc.) process to remove the color information in the image and effectively reduce the interference of non-fingerprint areas, and more accurately judge the difference between shells of the same material based on the feature information contained in the grayscale information when performing subsequent image processing, so as to improve the objectivity and accuracy of the detection scheme of fingerprint residue on the shell.

在一种可能的实现方式中,所述对所述指纹图像进行图像处理,确定所述指纹图像中的目标区域、以及所述目标区域中采集有指纹纹路的指纹区域,包括;基于拍摄参数确定所述目标区域;将所述目标区域的图像转换为第三灰度图像;基于拍摄光源和所述第三灰度图像的面积对所述第三灰度图像进行分区处理,得到多个子区域;从所述第三灰度图像中的每个子区域中提取出背景区域,将所述第三灰度图像中的每个子区域中的所述背景区域去除;对去除背景区域后的所述第三灰度图像中的每个子区域分别进行图像特征增强处理,得到第四灰度图像;通过对所述第四灰度图像进行二值化处理,并将二值化处理后所述第四灰度图像中的每个子区域共有的连通区域进行合并,以确定所述指纹区域。本申请实施例中可以通过自适应分区、阈值分割、共有连通区域合并等图像处理方式,减少光源不均匀时所导致的误差,并在上述图像处理的过程中增加背景提取和移除步骤,以去除颜色信息,且在进行后续图像处理时基于灰度信息中包含的特征信息更准确的判断相同材质的壳体之间的差异,进而提高了壳体指纹残留的检测方案的客观性和准确性。In a possible implementation, the image processing of the fingerprint image to determine the target area in the fingerprint image and the fingerprint area in the target area where fingerprint lines are collected includes: determining the target area based on shooting parameters; converting the image of the target area into a third grayscale image; partitioning the third grayscale image based on the shooting light source and the area of the third grayscale image to obtain multiple sub-areas; extracting the background area from each sub-area in the third grayscale image, and removing the background area in each sub-area in the third grayscale image; performing image feature enhancement processing on each sub-area in the third grayscale image after removing the background area to obtain a fourth grayscale image; and determining the fingerprint area by binarizing the fourth grayscale image and merging the connected areas shared by each sub-area in the fourth grayscale image after the binarization processing. In the embodiment of the present application, the error caused by uneven light source can be reduced through image processing methods such as adaptive partitioning, threshold segmentation, and common connected area merging, and background extraction and removal steps are added in the above image processing process to remove color information. In the subsequent image processing, the difference between shells of the same material can be more accurately judged based on the feature information contained in the grayscale information, thereby improving the objectivity and accuracy of the detection scheme for fingerprint residues on the shell.

在一种可能的实现方式中,所述图像特征增强处理包括;通过图像滤波对对应的灰度图像进行去噪处理;对去噪处理后的灰度图像进行形态学处理。本申请实施例中可以通过图像滤波降低图像中的噪声,提高图像的质量和清晰度;进一步地,还可以通过形态学处理进一步地修补图像中不完整的结构和形状,增强图像中指纹区域的特征,以在后续的图像处理过程中更准确的提取指纹区域,进而提高了壳体指纹残留的检测方案的准确性。In a possible implementation, the image feature enhancement process includes: performing denoising on the corresponding grayscale image through image filtering; and performing morphological processing on the grayscale image after denoising. In the embodiment of the present application, image filtering can be used to reduce the noise in the image and improve the quality and clarity of the image; further, morphological processing can be used to further repair the incomplete structure and shape in the image and enhance the features of the fingerprint area in the image, so as to more accurately extract the fingerprint area in the subsequent image processing process, thereby improving the accuracy of the detection scheme for fingerprint residues on the shell.

在一种可能的实现方式中,所述对去噪处理后的灰度图像进行形态学处理,包括;将去噪处理后的灰度图像中的均匀背景区域去除,以得到前景区域;去除所述前景区域中的周边区域,以得到周边区域去除后的图像;所述均匀背景包括光源均匀和/或纹理均匀,所述周边区域为所述前景区域中除像素值集中的连通区域之外的区域;对周边区域去除后的图像进行形态学处理。本申请实施例中,在形态学处理之前,可以将去噪处理后的灰度图像中的均匀背景(例如光源均匀和/或纹理均匀的背景)区域去除,并基于该灰度图像中连通区域的重心集中度实现更准确的指纹区域识别,即确定指纹纹路所在的区域,并剔除该区域之外的大块噪声;进一步地,如果未检测到前景区域内的连通区域,则可判断指纹残留度较弱。此外,还可以通过图像分割或形态学处理等方法确定指纹纹路所在区域的包络,并剔除包络外的噪声,进一步优化目标区域的图像的质量。In a possible implementation, the morphological processing of the grayscale image after denoising includes: removing the uniform background area in the grayscale image after denoising to obtain the foreground area; removing the peripheral area in the foreground area to obtain the image after the peripheral area is removed; the uniform background includes uniform light source and/or uniform texture, and the peripheral area is the area in the foreground area except the connected area where the pixel values are concentrated; the image after the peripheral area is removed is morphologically processed. In the embodiment of the present application, before morphological processing, the uniform background area (for example, the background with uniform light source and/or uniform texture) in the grayscale image after denoising can be removed, and more accurate fingerprint area recognition can be achieved based on the centroid concentration of the connected area in the grayscale image, that is, determining the area where the fingerprint lines are located, and removing the large block noise outside the area; further, if the connected area in the foreground area is not detected, it can be judged that the fingerprint residue is weak. In addition, the envelope of the area where the fingerprint lines are located can be determined by image segmentation or morphological processing, and the noise outside the envelope can be removed to further optimize the image quality of the target area.

在一种可能的实现方式中,所述基于所述指纹区域的面积和所述对比度,判断所述目标壳体的指纹残留性能,包括;若所述指纹区域的面积小于预设面积、且所述对比度小于预设对比度,则判断所述目标壳体的指纹残留度低。相较于现有技术中通过工作人员主观的判断壳体的指纹残留性能,本申请实施例中可以通过将指纹区域的面积、以及指纹区域与目标区域的颜色或灰度对比度等信息,与预设的标准值(例如指纹区域的标准面积、或标准对比度值)进行对比,从而更客观的判断指纹残留性能,以提升壳体指纹残留的检测方案的准确性和客观性。In a possible implementation, the fingerprint residual performance of the target shell is judged based on the area of the fingerprint area and the contrast, including: if the area of the fingerprint area is smaller than a preset area, and the contrast is smaller than a preset contrast, then the fingerprint residual degree of the target shell is judged to be low. Compared with the prior art in which the fingerprint residual performance of the shell is judged subjectively by the staff, in the embodiment of the present application, the fingerprint residual performance can be judged more objectively by comparing the area of the fingerprint area, and the color or grayscale contrast between the fingerprint area and the target area with a preset standard value (such as the standard area of the fingerprint area, or the standard contrast value), so as to improve the accuracy and objectivity of the detection scheme of the fingerprint residue on the shell.

在一种可能的实现方式中,在对多个壳体的指纹残留性能进行测试与比较时,不同壳体对应的指纹图像可以为通过相同的拍摄条件拍摄所得到的图像,例如相同的拍摄光源、拍摄手法、拍摄设备等条件,可以在后续对比不同壳体的指纹残留性能差异时得到更客观、更准确的对比结果,避免了因为拍摄条件不同导致的数据异常等影响。In one possible implementation, when testing and comparing the fingerprint residual performance of multiple shells, the fingerprint images corresponding to different shells can be images obtained by taking pictures under the same shooting conditions, such as the same shooting light source, shooting technique, shooting equipment and other conditions. In the subsequent comparison of the fingerprint residual performance differences of different shells, more objective and accurate comparison results can be obtained, avoiding the influence of data anomalies caused by different shooting conditions.

第二方面,本申请实施例中提供了一种壳体指纹残留的检测装置,可包括:In a second aspect, an embodiment of the present application provides a detection device for fingerprint residue on a housing, which may include:

获取指纹图像单元,用于获取指纹图像,所述指纹图像为针对目标壳体表面上的指纹进行拍摄得到的图像;A fingerprint image acquisition unit, used to acquire a fingerprint image, wherein the fingerprint image is an image obtained by photographing the fingerprint on the surface of the target housing;

确定指纹区域单元,用于对所述指纹图像进行图像处理,确定所述指纹图像中的目标区域、以及所述目标区域中采集有指纹纹路的指纹区域;A fingerprint area determination unit is used to perform image processing on the fingerprint image to determine a target area in the fingerprint image and a fingerprint area in the target area where fingerprint patterns are collected;

确定对比度单元,基于所述指纹区域的像素信息与所述目标区域的像素信息,确定所述指纹区域与目标区域的对比度;a contrast determination unit, which determines the contrast between the fingerprint area and the target area based on the pixel information of the fingerprint area and the pixel information of the target area;

判断指纹残留性能单元,基于所述指纹区域的面积和所述对比度,判断所述目标壳体的指纹残留性能。The fingerprint residual performance judging unit judges the fingerprint residual performance of the target housing based on the area of the fingerprint region and the contrast.

在一种可能的实现方式中,若所述像素信息包括RGB通道值;所述确定对比度单元,具体用于:In a possible implementation manner, if the pixel information includes RGB channel values; the contrast determination unit is specifically configured to:

确定所述指纹区域的RGB通道值中的每个通道值之和,和所述目标区域的RGB通道值中的每个通道值之和;Determine the sum of each channel value in the RGB channel values of the fingerprint area and the sum of each channel value in the RGB channel values of the target area;

将所述指纹区域的RGB通道值中的每个通道值之和,与所述目标区域的RGB通道值中的每个通道值之和进行对比,得到每个通道的对比度。The sum of each channel value in the RGB channel values of the fingerprint area is compared with the sum of each channel value in the RGB channel values of the target area to obtain the contrast of each channel.

在一种可能的实现方式中,所述确定指纹区域单元,具体用于:In a possible implementation manner, the fingerprint area determination unit is specifically used to:

基于所述指纹图像的拍摄参数确定所述目标区域;Determining the target area based on shooting parameters of the fingerprint image;

将所述目标区域的图像转化为第一灰度图像;Converting the image of the target area into a first grayscale image;

对所述第一灰度图像进行图像特征增强处理,得到第二灰度图像;Performing image feature enhancement processing on the first grayscale image to obtain a second grayscale image;

对所述第二灰度图像进行二值化处理,以确定所述目标区域中符合指纹特征的指纹区域。The second grayscale image is binarized to determine a fingerprint region in the target region that meets the fingerprint feature.

在一种可能的实现方式中,所述确定指纹区域单元,具体用于:In a possible implementation manner, the fingerprint area determination unit is specifically used to:

基于所述指纹图像的拍摄参数确定所述目标区域;Determining the target area based on shooting parameters of the fingerprint image;

将所述目标区域的图像转换为第三灰度图像;Converting the image of the target area into a third grayscale image;

基于拍摄光源和所述第三灰度图像的面积对所述第三灰度图像进行分区处理,得到多个子区域;Performing partition processing on the third grayscale image based on the shooting light source and the area of the third grayscale image to obtain a plurality of sub-areas;

对所述第三灰度图像中的每个子区域分别进行图像特征增强处理,得到第四灰度图像;Performing image feature enhancement processing on each sub-region in the third grayscale image to obtain a fourth grayscale image;

通过对所述第四灰度图像进行二值化处理,并将二值化处理后所述第四灰度图像中的每个子区域共有的连通区域进行合并,以确定所述指纹区域。The fingerprint region is determined by binarizing the fourth grayscale image and merging the connected regions shared by each subregion in the fourth grayscale image after the binarization process.

在一种可能的实现方式中,若所述像素信息包括灰度值;所述确定对比度单元,具体用于:In a possible implementation manner, if the pixel information includes a grayscale value; the contrast determination unit is specifically configured to:

确定所述指纹区域的灰度值之和和所述目标区域的灰度值之和;Determining the sum of the grayscale values of the fingerprint area and the sum of the grayscale values of the target area;

将所述指纹区域的灰度值之和与所述目标区域的灰度值之和的对比结果确定为所述对比度。A comparison result of the sum of the grayscale values of the fingerprint area and the sum of the grayscale values of the target area is determined as the contrast.

在一种可能的实现方式中,所述确定指纹区域单元,具体用于:In a possible implementation manner, the fingerprint area determination unit is specifically used to:

基于拍摄参数确定所述目标区域;determining the target area based on shooting parameters;

将所述目标区域的图像转化为第一灰度图像;Converting the image of the target area into a first grayscale image;

从所述第一灰度图像中提取出背景区域,将所述第一灰度图像中的所述背景区域去除;Extracting a background area from the first grayscale image, and removing the background area from the first grayscale image;

对去除背景区域后的第一灰度图像进行图像特征增强处理,得到第二灰度图像;Performing image feature enhancement processing on the first grayscale image after removing the background area to obtain a second grayscale image;

对所述第二灰度图像进行二值化处理,以确定所述目标区域中符合指纹特征的指纹区域。The second grayscale image is binarized to determine a fingerprint region in the target region that meets the fingerprint feature.

在一种可能的实现方式中,所述确定指纹区域单元,具体用于:In a possible implementation manner, the fingerprint area determination unit is specifically used to:

基于拍摄参数确定所述目标区域;determining the target area based on shooting parameters;

将所述目标区域的图像转换为第三灰度图像;Converting the image of the target area into a third grayscale image;

基于拍摄光源和所述第三灰度图像的面积对所述第三灰度图像进行分区处理,得到多个子区域;Performing partition processing on the third grayscale image based on the shooting light source and the area of the third grayscale image to obtain a plurality of sub-areas;

从所述第三灰度图像中的每个子区域中提取出背景区域,将所述第三灰度图像中的每个子区域中的所述背景区域去除;Extracting a background region from each sub-region in the third grayscale image, and removing the background region from each sub-region in the third grayscale image;

对去除背景区域后的所述第三灰度图像中的每个子区域分别进行图像特征增强处理,得到第四灰度图像;Performing image feature enhancement processing on each sub-region in the third grayscale image after removing the background region, to obtain a fourth grayscale image;

通过对所述第四灰度图像进行二值化处理,并将二值化处理后所述第四灰度图像中的每个子区域共有的连通区域进行合并,以确定所述指纹区域。The fingerprint region is determined by binarizing the fourth grayscale image and merging the connected regions shared by each subregion in the fourth grayscale image after the binarization process.

在一种可能的实现方式中,所述确定指纹区域单元,具体用于:In a possible implementation manner, the fingerprint area determination unit is specifically used to:

通过图像滤波对对应的灰度图像进行去噪处理;De-noising the corresponding grayscale image through image filtering;

对去噪处理后的灰度图像进行形态学处理。Perform morphological processing on the denoised grayscale image.

在一种可能的实现方式中,所述确定指纹区域单元,具体用于:In a possible implementation manner, the fingerprint area determination unit is specifically used to:

将去噪处理后的灰度图像中的均匀背景区域去除,以得到前景区域;The uniform background area in the denoised grayscale image is removed to obtain the foreground area;

去除所述前景区域中的周边区域,以得到周边区域去除后的图像;所述均匀背景包括光源均匀和/或纹理均匀,所述周边区域为所述前景区域中除像素值集中的连通区域之外的区域;Removing the peripheral area in the foreground area to obtain an image after the peripheral area is removed; the uniform background includes uniform light source and/or uniform texture, and the peripheral area is an area in the foreground area excluding the connected area where the pixel values are concentrated;

对周边区域去除后的图像进行形态学处理。Morphological processing is performed on the image after the peripheral area is removed.

在一种可能的实现方式中,所述判断指纹残留性能单元,具体用于:In a possible implementation, the fingerprint residual performance determination unit is specifically configured to:

若所述指纹区域的面积小于预设面积、且所述对比度小于预设对比度,则判断所述目标壳体的指纹残留度低。If the area of the fingerprint region is smaller than the preset area, and the contrast is smaller than the preset contrast, it is determined that the fingerprint residue of the target housing is low.

第三方面,本申请实施例提供一种计算机存储介质,用于储存为上述第二方面提供的一种壳体指纹残留的检测装置中所用的计算机软件指令,其包含用于执行上述方面所设计的程序。In a third aspect, an embodiment of the present application provides a computer storage medium for storing computer software instructions used in a housing fingerprint residue detection device provided in the second aspect, which includes a program designed for executing the above aspect.

第四方面,本申请实施例提供了一种计算机程序,该计算机程序包括指令,当该计算机程序被计算机执行时,使得计算机可以执行上述第二方面中的壳体指纹残留的检测装置中所执行的流程。In a fourth aspect, an embodiment of the present application provides a computer program, which includes instructions. When the computer program is executed by a computer, the computer can execute the process executed in the detection device for detecting fingerprint residue on a shell in the second aspect.

第五方面,本申请提供一种电子设备,该电子设备包括处理器、显示屏和传感器,该处理器为上述第二方面中的任意一种实现方式所涉及的处理器,该显示屏为上述第二方面中的任意一种实现方式所涉及的显示屏,该传感器为上述第二方面中的任意一种实现方式所涉及的传感器。该电子设备还可以包括通信接口,用于该终端与其它设备或通信网络通信。In a fifth aspect, the present application provides an electronic device, the electronic device comprising a processor, a display screen and a sensor, the processor being the processor involved in any one of the implementations in the second aspect, the display screen being the display screen involved in any one of the implementations in the second aspect, and the sensor being the sensor involved in any one of the implementations in the second aspect. The electronic device may also include a communication interface for the terminal to communicate with other devices or a communication network.

第六方面,本申请提供一种智能手机,该智能手机具有实现上述第一方面中的任意一种壳体指纹残留的检测方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。In a sixth aspect, the present application provides a smart phone having the function of implementing any one of the detection methods for fingerprint residue on a housing in the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本申请实施例或背景技术中的技术方案,下面将对本申请实施例或背景技术中所需要使用的附图进行说明。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.

图1A是本申请实施例提供的一种壳体指纹残留的检测方案的流程示意图。FIG1A is a schematic flow chart of a solution for detecting fingerprint residue on a housing provided in an embodiment of the present application.

图1B为本申请实施例中提供的一种拍摄场景示意图。FIG. 1B is a schematic diagram of a shooting scene provided in an embodiment of the present application.

图1C为本申请实施例中提供的一种不同材质壳体指纹残留性能判断示意图。FIG. 1C is a schematic diagram of determining fingerprint residue performance of housings of different materials provided in an embodiment of the present application.

图2A为本申请实施例中提供的另一种壳体指纹残留测试方案的流程示意图。FIG. 2A is a schematic diagram of a flow chart of another housing fingerprint residue testing solution provided in an embodiment of the present application.

图2B为本申请实施例中提供的一种图像灰度计算场景一的流程图。FIG. 2B is a flowchart of an image grayscale calculation scenario 1 provided in an embodiment of the present application.

图2C为本申请实施例中提供的一张目标区域确定示意图。FIG. 2C is a schematic diagram of target area determination provided in an embodiment of the present application.

图2D为本申请实施例中提供的一种反相计算示意图。FIG. 2D is a schematic diagram of an inversion calculation provided in an embodiment of the present application.

图3A为本申请实施例中提供的一种图像灰度计算场景二的流程图。FIG3A is a flowchart of a second image grayscale calculation scenario provided in an embodiment of the present application.

图3B为本申请实施例中提供的一种光源不均匀示意图。FIG. 3B is a schematic diagram of an uneven light source provided in an embodiment of the present application.

图4A为本申请实施例中提供的一种图像灰度计算场景三的流程图。FIG. 4A is a flowchart of a third image grayscale calculation scenario provided in an embodiment of the present application.

图4B为本申请实施例中提供的一种均匀背景提取示意图。FIG. 4B is a schematic diagram of uniform background extraction provided in an embodiment of the present application.

图5A为本申请实施例中提供的一种图像灰度计算场景四的流程图。FIG5A is a flowchart of a fourth image grayscale calculation scenario provided in an embodiment of the present application.

图6A为本申请实施例中提供的一种图像转灰度计算以及背景提取场景一的流程图。FIG. 6A is a flowchart of an image-to-grayscale calculation and background extraction scenario 1 provided in an embodiment of the present application.

图7A为本申请实施例中提供的一种图像转灰度计算场景二的流程图。FIG. 7A is a flowchart of a second image-to-grayscale calculation scenario provided in an embodiment of the present application.

图8A为本申请实施例中提供的一种图像转灰度计算场景三的流程图。FIG8A is a flowchart of a third image-to-grayscale calculation scenario provided in an embodiment of the present application.

图9A为本申请实施例中提供的一种图像灰度计算场景四的流程图。FIG9A is a flowchart of a fourth image grayscale calculation scenario provided in an embodiment of the present application.

图10是本申请实施例提供的一种壳体指纹残留的检测装置的结构示意图。FIG. 10 is a schematic structural diagram of a device for detecting fingerprint residue on a housing provided in an embodiment of the present application.

图11是本申请实施例提供的一种电子设备的硬件结构示意图。FIG. 11 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例进行描述。The embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. 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 includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

在本说明书中使用的术语“部件”、“模块”、“系统”等用于表示计算机相关的实体、硬件、固件、硬件和软件的组合、软件、或执行中的软件。例如,部件可以是但不限于,在处理器上运行的进程、处理器、对象、可执行文件、执行线程、程序和/或计算机。通过图示,在计算设备上运行的应用和计算设备都可以是部件。一个或多个部件可驻留在进程和/或执行线程中,部件可位于一个计算机上和/或分布在2个或更多个计算机之间。此外,这些部件可从在上面存储有各种数据结构的各种计算机可读介质执行。例如,部件可根据具有一个或多个数据分组(例如来自与本地系统、分布式系统和/或网络间的另一部件交互的二个部件的数据,例如通过信号与其它系统交互的互联网)的信号通过本地和/或远程进程来通信。The terms "component", "module", "system", etc. used in this specification are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process, a processor, an object, an executable file, an execution thread, a program and/or a computer running on a processor. By way of illustration, both applications and computing devices running on a computing device can be components. One or more components may reside in a process and/or an execution thread, and a component may be located on a computer and/or distributed between two or more computers. In addition, these components may be executed from various computer-readable media having various data structures stored thereon. For example, a component may communicate through a local and/or remote process according to a signal having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system and/or a network, such as the Internet interacting with other systems through signals).

首先,对本申请中的部分用语进行解释说明,以便于本领域技术人员理解。First, some terms in this application are explained to facilitate understanding by those skilled in the art.

(1)指纹连通域(Fingerprint Connected Domain),指的是图像中连通且具有明显边界的指纹区域。它是指纹识别技术中的关键部分,涉及指纹图像的结构、特征及其相互关系。指纹连通域的提取通常包括特征提取、边缘检测、连通区域分析等步骤,旨在有效地识别和定位指纹图像中的指纹区域。(1) Fingerprint connected domain refers to the fingerprint area in the image that is connected and has obvious boundaries. It is a key part of fingerprint recognition technology and involves the structure, features and their mutual relationship of the fingerprint image. The extraction of fingerprint connected domain usually includes feature extraction, edge detection, connected region analysis and other steps, aiming to effectively identify and locate the fingerprint area in the fingerprint image.

(2)指纹图像预处理(Fingerprint Image Preprocessing)是指在进行指纹识别或指纹特征提取之前对原始指纹图像进行的一系列处理步骤。这些步骤旨在改善图像质量、增强指纹特征、减少噪声和干扰,以提高后续指纹识别算法的准确性和性能。(2) Fingerprint image preprocessing refers to a series of processing steps performed on the original fingerprint image before fingerprint recognition or fingerprint feature extraction. These steps are aimed at improving image quality, enhancing fingerprint features, and reducing noise and interference to improve the accuracy and performance of subsequent fingerprint recognition algorithms.

(3)二值化(Binarization),指的是将图像转换为仅有黑白两种颜色的过程。涉及对灰度图像或彩色图像的阈值处理,二值化过程通常包括选定阈值、应用阈值分割图像以及生成二值图像等阶段,目的是简化图像数据,突出感兴趣的对象轮廓。(3) Binarization refers to the process of converting an image into only black and white colors. It involves threshold processing of grayscale images or color images. The binarization process usually includes the stages of selecting a threshold, applying the threshold to segment the image, and generating a binary image. The purpose is to simplify the image data and highlight the contours of the object of interest.

(4)RGB通道(RGB Channels),指的是图像处理和计算机视觉中使用的红、绿、蓝三个独立的颜色通道。涉及将图像的每个像素分解为红、绿、蓝三种基色的强度值,RGB通道的处理过程通常包括颜色分离、通道操作以及颜色合成等阶段,目的是实现精确的颜色控制和图像增强。(4) RGB channels refer to the three independent color channels of red, green, and blue used in image processing and computer vision. It involves decomposing each pixel of the image into the intensity values of the three primary colors of red, green, and blue. The processing of RGB channels usually includes color separation, channel operation, and color synthesis, with the aim of achieving precise color control and image enhancement.

(5)图像灰度值(Image Grayscale Value),指的是在灰度图像中,每个像素点所具有的亮度值。涉及将彩色图像转换为单一亮度层次的过程。图像灰度值的处理通常包括灰度转换、直方图分析和灰度增强等阶段,目的是简化图像数据并突出重要的视觉信息。(5) Image Grayscale Value refers to the brightness value of each pixel in a grayscale image. It involves the process of converting a color image into a single brightness level. The processing of image grayscale values usually includes grayscale conversion, histogram analysis, and grayscale enhancement, with the aim of simplifying image data and highlighting important visual information.

(6)残留指纹面积(Residual Fingerprint Area),指的是在表面上留下的可检测到的指纹纹路所覆盖的区域。涉及测量和分析指纹在各种表面上的残留程度,残留指纹面积的计算过程通常包括指纹图像采集、图像处理、区域分割及面积计算等阶段,目的是精确地量化指纹的覆盖范围。(6) Residual Fingerprint Area refers to the area covered by the detectable fingerprint pattern left on the surface. It involves measuring and analyzing the degree of fingerprint residue on various surfaces. The calculation process of residual fingerprint area usually includes fingerprint image acquisition, image processing, region segmentation and area calculation, with the purpose of accurately quantifying the coverage of fingerprints.

(7)连通区域(Connected Components),指的是在二值图像中,由相邻且具有相同像素值的像素集合组成的区域。涉及识别和标记图像中连续的像素群体。连通区域的处理过程通常包括图像二值化、连通性检测、区域标记和特征提取等阶段,目的是分割和分析图像中的不同对象。(7) Connected components refer to the regions in a binary image that are composed of adjacent pixels with the same pixel value. It involves identifying and marking continuous groups of pixels in an image. The processing of connected components usually includes image binarization, connectivity detection, region labeling, and feature extraction, with the goal of segmenting and analyzing different objects in the image.

首先,分析并提出本申请所具体要解决的技术问题。在现有技术中,关于壳体指纹残留的检测的技术,可以包括如下方案:First, the technical problems to be solved by this application are analyzed and proposed. In the prior art, the technology for detecting fingerprint residues on the housing may include the following solutions:

方案:现有的壳体指纹残留的检测通常为对从指纹图像中提取出的指纹区域进行测试,且需要在相同环境、相同光源照度和非反光条件下进行。Solution: The existing detection of fingerprint residue on the shell usually tests the fingerprint area extracted from the fingerprint image, and needs to be performed under the same environment, the same light source illumination and non-reflective conditions.

上述方案目前为市面上的通用技术,但是也存在以下多个缺点:The above solution is currently a common technology on the market, but it also has the following disadvantages:

缺点1:准确率有限。现有的壳体指纹残留的检测技术主要依赖于工作人员对指纹图像中指纹所在区域的人眼识别,并通过指纹清晰度、指纹可见性等肉眼可见的数据来评估壳体的抗指纹性能,而没有充分利用指纹图像中可能提供的更深层次的信息。例如,残留指纹的面积、指纹区域的灰度值和RGB通道值、指纹图像中的目标区域的灰度值和RGB通道值等。因此,仅仅依赖于工作人员通过人员识别进行检测可能无法更深层次的检测指纹残留的特征,导致检测结果的准确性有限,无法提供准确的评估。Disadvantage 1: Limited accuracy. Existing detection technology for fingerprint residue on housings mainly relies on the staff's visual recognition of the fingerprint area in the fingerprint image, and evaluates the housing's anti-fingerprint performance through data visible to the naked eye such as fingerprint clarity and fingerprint visibility, without fully utilizing the deeper information that may be provided in the fingerprint image. For example, the area of the residual fingerprint, the grayscale value and RGB channel value of the fingerprint area, the grayscale value and RGB channel value of the target area in the fingerprint image, etc. Therefore, relying solely on staff to perform detection through personnel identification may not be able to detect the characteristics of fingerprint residues at a deeper level, resulting in limited accuracy of the detection results and an inability to provide accurate evaluation.

缺点2:缺乏客观性。现有的壳体残留指纹的测试方案通常为工作人员主观判断,而并非是基于客观的数据检测指纹残留度,且在比较相同材质和不同材质的壳体时,因为材质的不同,导致特性信息差异较大,无法客观的比较不同壳体之间的差异,因此影响了壳体指纹残留的检测方案的客观性。Disadvantage 2: Lack of objectivity. Existing testing schemes for residual fingerprints on housings are usually based on subjective judgments by staff, rather than on objective data to detect the residual fingerprints. When comparing housings of the same material and different materials, the difference in characteristic information is large due to the difference in materials, and the difference between different housings cannot be objectively compared, thus affecting the objectivity of the detection scheme for residual fingerprints on the housing.

为了解决当前壳体指纹残留的检测方案不满足实际业务需求的问题,达到满足用户与实际业务所需的目标,综合考虑现有技术存在的缺点,本申请实际要解决的技术问题包括如下两个方面中的一方面或多个方面:In order to solve the problem that the current detection scheme of fingerprint residue on the shell does not meet the actual business needs and achieve the goal of meeting the needs of users and actual business, the technical problems to be solved by this application include one or more of the following two aspects, taking into account the shortcomings of the existing technology:

1.提高壳体指纹残留的检测方案的准确性(缺点1)。现有的壳体指纹残留的检测方法主要通过人眼可见的数据判断指纹残留性能,而未能充分利用指纹图像中可能提供的更深层次的信息,导致检测结果的准确性不足。因此,需要一种可以更深层次利用指纹图像中的信息,并基于上述信息判断指纹残留性能的壳体指纹残留的检测方法,以提高检测结果的准确性。1. Improve the accuracy of the detection scheme for fingerprint residue on the shell (disadvantage 1). The existing detection method for fingerprint residue on the shell mainly judges the fingerprint residue performance through data visible to the human eye, but fails to make full use of the deeper information that may be provided in the fingerprint image, resulting in insufficient accuracy of the detection result. Therefore, a detection method for fingerprint residue on the shell is needed that can make deeper use of the information in the fingerprint image and judge the fingerprint residue performance based on the above information to improve the accuracy of the detection result.

2.提高壳体指纹残留的检测方案的客观性(缺点2)。现有的壳体指纹残留的检测方案主要通过工作人员主观判断,且在对相同材质和不同材质的壳体进行测试时没有针对性处理,导致不同壳体的检测结果之间的差异较小,对比结果不够客观。因此,需要一种可以基于客观的数据判断指纹残留性能,且对壳体的材质相同或不同进行针对性处理的壳体指纹残留的检测方法,以提高检测结果的客观性。2. Improve the objectivity of the detection scheme for fingerprint residue on the shell (disadvantage 2). The existing detection scheme for fingerprint residue on the shell is mainly based on subjective judgment of the staff, and there is no targeted treatment when testing shells of the same material and different materials, resulting in small differences between the detection results of different shells, and the comparison results are not objective enough. Therefore, a detection method for fingerprint residue on the shell is needed that can judge the fingerprint residue performance based on objective data and perform targeted treatment on shells of the same or different materials to improve the objectivity of the detection results.

结合本申请实施例中提供的壳体指纹残留的检测方法,对本申请中提出的技术问题进行具体分析和解决,可参见图1A,图1A是本申请实施例提供的一种壳体指纹残留的检测方案的流程示意图,该方法可以包括以下步骤S100-步骤S103。In combination with the detection method of fingerprint residue on the shell provided in the embodiment of the present application, the technical problems raised in the present application are specifically analyzed and solved. Please refer to Figure 1A. Figure 1A is a flow chart of a detection scheme for fingerprint residue on the shell provided in the embodiment of the present application. The method may include the following steps S100-S103.

步骤S100:获取指纹图像。Step S100: Acquire a fingerprint image.

具体地,所述指纹图像为针对目标壳体表面上的指纹进行拍摄得到的图像。在本申请实施例中,壳体可以是由不同壳料、或材料构成的结构,其中,壳体可以包括玻璃背板、屏幕背板、触控板等需要对壳料(或材料)的抗指纹性能、抗脏污性能进行定量定性判断的结构。Specifically, the fingerprint image is an image obtained by photographing the fingerprint on the surface of the target housing. In the embodiment of the present application, the housing may be a structure composed of different shell materials or materials, wherein the housing may include a glass back panel, a screen back panel, a touch panel, and other structures that require quantitative and qualitative judgment of the anti-fingerprint performance and anti-fouling performance of the shell material (or material).

在一种可能的实现方式中,在对多个壳体的指纹残留性能进行测试与比较时,基于每个壳体拍摄的指纹图像可以通过相同的拍摄条件进行,例如相同的拍摄光源、拍摄手法、拍摄设备等条件,可以在后续对比不同壳体的指纹残留性能差异时得到更客观、更准确的对比结果,避免了因为拍摄条件不同导致的数据异常等影响。本申请实施例中,为了在固定拍摄环境下进行残留指纹的客观评价,拍摄条件可以选用均匀光源下的垂直拍摄,以最大限度地避免因反光造成的影响。示例性地,本申请实施例提供了一种在实验室环境中进行指纹图像的拍摄和处理,请参见图1B,图1B为本申请实施例中提供的一种拍摄场景示意图,图1B中可以包括图卡支架01-A、均匀光源01-B、残留指纹壳体01-C和拍摄设备01-D,假设拍摄场地为相机评估与测量(Camera Assessment and Measurement,CMA)实验室,拍摄设备包括两台均匀光源01-B和一部用于拍摄的手机或相机(即拍摄设备01-D),其中手机设置为专业模式进行拍摄,具体拍摄方法如下:将残留指纹的壳体或整机垂直放置于均匀光源的中间位置,即使用图卡支架01-A固定残留指纹壳体01-C,确保其垂直放置在均匀光源的中间拍摄设备01-D位于残留指纹壳体01-C前方40厘米处,垂直对准残留指纹壳体01-C进行拍摄,且两个均匀光源01-B分别布置在壳体的两侧,光源调节至D65 1000lux的亮度,确保拍摄环境光源均匀。综上,本申请实施例通过在固定拍摄环境中,使用均匀光源和专业拍摄设备,垂直拍摄残留指纹壳体或整机,确保了拍摄图像的质量和一致性,并通过精确调节光源和拍摄参数,最大限度地减少了反光和阴影对图像的影响,从而提高了指纹图像处理和分析的准确性和可靠性。In a possible implementation, when testing and comparing the residual fingerprint performance of multiple shells, the fingerprint images taken based on each shell can be taken under the same shooting conditions, such as the same shooting light source, shooting technique, shooting equipment and other conditions, so that more objective and accurate comparison results can be obtained when comparing the residual fingerprint performance differences of different shells in the subsequent comparison, avoiding the influence of data anomalies caused by different shooting conditions. In the embodiment of the present application, in order to objectively evaluate the residual fingerprint under a fixed shooting environment, the shooting condition can be selected as vertical shooting under a uniform light source to minimize the influence caused by reflections. Exemplarily, an embodiment of the present application provides a method for photographing and processing fingerprint images in a laboratory environment. Please refer to Figure 1B. Figure 1B is a schematic diagram of a photographing scene provided in an embodiment of the present application. Figure 1B may include a picture card bracket 01-A, a uniform light source 01-B, a residual fingerprint housing 01-C and a photographing device 01-D. Assume that the photographing site is a camera assessment and measurement (CMA) laboratory, and the photographing device includes two uniform light sources 01-B and a mobile phone or camera for photographing (i.e., the photographing device 01-D). The mobile phone is set to professional mode for photographing. The specific photographing method is as follows: the housing or the whole machine of the residual fingerprint is vertically placed in the middle of the uniform light source, that is, the residual fingerprint housing 01-C is fixed with the picture card bracket 01-A to ensure that it is vertically placed in the middle of the uniform light source. The photographing device 01-D is located 40 cm in front of the residual fingerprint housing 01-C, and is vertically aligned with the residual fingerprint housing 01-C for photographing, and the two uniform light sources 01-B are respectively arranged on both sides of the housing, and the light source is adjusted to a brightness of D65 1000lux to ensure that the light source of the shooting environment is uniform. In summary, the embodiments of the present application ensure the quality and consistency of the captured images by using a uniform light source and professional shooting equipment in a fixed shooting environment to vertically shoot the residual fingerprint housing or the entire machine, and by precisely adjusting the light source and shooting parameters, minimize the impact of reflections and shadows on the image, thereby improving the accuracy and reliability of fingerprint image processing and analysis.

步骤S101:对所述指纹图像进行图像处理,确定所述指纹图像中的目标区域、以及所述目标区域中采集有指纹纹路的指纹区域。Step S101: performing image processing on the fingerprint image to determine a target area in the fingerprint image and a fingerprint area in the target area where fingerprint patterns are collected.

具体地,本申请实施例中,系统首先接收指纹图像,指纹图像可以是包含指纹纹路的图像。系统可以对该指纹图像进行预处理操作,以增强图像质量,方便后续的指纹区域识别。预处理操作可以包括图像灰度化、图像滤波去噪、直方图均衡和二值化处理等一个或多个步骤,以更准确的确定目标区域和指纹区域。Specifically, in the embodiment of the present application, the system first receives a fingerprint image, which may be an image containing fingerprint lines. The system may perform a preprocessing operation on the fingerprint image to enhance the image quality and facilitate subsequent fingerprint area identification. The preprocessing operation may include one or more steps such as image graying, image filtering and denoising, histogram equalization, and binarization processing to more accurately determine the target area and the fingerprint area.

在一种可能的实现方式中,所述对所述指纹图像进行图像处理,确定所述指纹图像中的目标区域、以及所述目标区域中采集有指纹纹路的指纹区域,包括;基于所述指纹图像的拍摄参数确定所述目标区域;将所述目标区域的图像转化为第一灰度图像;对所述第一灰度图像进行图像特征增强处理,得到第二灰度图像;对所述第二灰度图像进行二值化处理,以确定所述目标区域中符合指纹特征的指纹区域。具体地,本申请实施例中可以在通过拍摄参数确定指纹图像中的目标区域后(例如,假设指纹图像的像素面积为1200*1200,工作人员或系统可以基于拍摄设备、拍摄距离和拍摄条件,将指纹图像中指纹最集中的区域确定为目标区域,例如指纹图像中一块像素面积为500*500的区域,该区域中包括指纹纹路所在的指纹区域),将目标区域的图像转化为灰度图像,并对该灰度图像进行图像特征增强处理(例如去噪处理和形态学处理),以及对上述图像特征增强处理后的灰度图像进行二值化处理(即基于预设的阈值将灰度图像中的像素值转化为黑白两种颜色),最后将黑色像素值中符合指纹特征的区域确定为指纹区域,以及基于该指纹区域在后续更准确地评估指纹残留性能。关于本申请实施例中的图像处理对应的具体场景描述可参见下文图2B-图2D中对应的实施例,本申请实施例中不作赘述。In a possible implementation, the image processing of the fingerprint image to determine the target area in the fingerprint image and the fingerprint area in the target area where fingerprint lines are collected includes: determining the target area based on the shooting parameters of the fingerprint image; converting the image of the target area into a first grayscale image; performing image feature enhancement processing on the first grayscale image to obtain a second grayscale image; and binarizing the second grayscale image to determine the fingerprint area in the target area that meets the fingerprint features. Specifically, in the embodiment of the present application, after determining the target area in the fingerprint image through shooting parameters (for example, assuming that the pixel area of the fingerprint image is 1200*1200, the staff or system can determine the area with the most concentrated fingerprints in the fingerprint image as the target area based on the shooting device, shooting distance and shooting conditions, such as an area with a pixel area of 500*500 in the fingerprint image, which includes the fingerprint area where the fingerprint lines are located), the image of the target area is converted into a grayscale image, and the grayscale image is subjected to image feature enhancement processing (such as denoising and morphological processing), and the grayscale image after the above image feature enhancement processing is binarized (that is, the pixel values in the grayscale image are converted into black and white colors based on a preset threshold), and finally the area in the black pixel value that meets the fingerprint characteristics is determined as the fingerprint area, and the fingerprint residual performance is more accurately evaluated based on the fingerprint area in the subsequent. For the specific scene description corresponding to the image processing in the embodiment of the present application, please refer to the corresponding embodiments in Figures 2B-2D below, which will not be repeated in the embodiment of the present application.

在一种可能的实现方式中,所述对所述指纹图像进行图像处理,确定所述指纹图像中的目标区域、以及所述目标区域中采集有指纹纹路的指纹区域,包括;基于所述指纹图像的拍摄参数确定所述目标区域;将所述目标区域的图像转换为第三灰度图像;基于拍摄光源和所述第三灰度图像的面积对所述第三灰度图像进行分区处理,得到多个子区域;对所述第三灰度图像中的每个子区域分别进行图像特征增强处理,得到第四灰度图像;通过对所述第四灰度图像进行二值化处理,并将二值化处理后所述第四灰度图像中的每个子区域共有的连通区域进行合并,以确定所述指纹区域。本申请实施例中通过将图像分为多个子区域后、针对每个子区域进行阈值分割、共有连通区域合并处理,以减少光源不均匀带来的误差影响,进一步提升了提取指纹区域的准确性。具体地,通过基于指纹图像确定目标区域后(例如,假设指纹图像的像素面积为1200*1200,工作人员或系统可以基于拍摄设备、拍摄距离和拍摄条件,将指纹图像中指纹最集中的区域确定为目标区域,例如指纹图像中一块像素面积为500*500的区域,该区域中包括指纹纹路所在的指纹区域),对目标区域的图像进行图像灰度计算得到灰度图像,并基于灰度图像的拍摄光源和拍摄面积将该灰度图像分为多个子区域;进一步地,可以在对上述多个子区域分别进行图像特征增强处理(例如去噪处理和/或形态学处理)后,通过二值化处理对图像特征增强处理后的多个子区域进行阈值分割,得到对应的第四灰度图像,其中,上述第四灰度图像中每个子区域的连通区域中可以包括多个不连续的指纹区域,可以通过将共有的连通区域进行合并,以准确定位和提取出指纹区域,减少了光源不均匀带来的误差影响。关于本申请实施例中的光源不均匀情况下图像处理对应的具体场景描述可参见下文图3A-图5A中对应的实施例,本申请实施例中不作赘述。In a possible implementation, the image processing of the fingerprint image to determine the target area in the fingerprint image and the fingerprint area in the target area where the fingerprint lines are collected includes: determining the target area based on the shooting parameters of the fingerprint image; converting the image of the target area into a third grayscale image; partitioning the third grayscale image based on the shooting light source and the area of the third grayscale image to obtain multiple sub-areas; performing image feature enhancement processing on each sub-area in the third grayscale image to obtain a fourth grayscale image; binarizing the fourth grayscale image and merging the connected areas shared by each sub-area in the fourth grayscale image after the binarization processing to determine the fingerprint area. In the embodiment of the present application, after dividing the image into multiple sub-areas, threshold segmentation is performed for each sub-area, and the shared connected areas are merged to reduce the error caused by uneven light sources, thereby further improving the accuracy of extracting the fingerprint area. Specifically, after determining the target area based on the fingerprint image (for example, assuming that the pixel area of the fingerprint image is 1200*1200, the staff or the system can determine the area with the most concentrated fingerprints in the fingerprint image as the target area based on the shooting equipment, shooting distance and shooting conditions, such as an area with a pixel area of 500*500 in the fingerprint image, which includes the fingerprint area where the fingerprint lines are located), the image grayscale of the target area is calculated to obtain a grayscale image, and the grayscale image is divided into multiple sub-areas based on the shooting light source and shooting area of the grayscale image; further, after performing image feature enhancement processing (such as denoising processing and/or morphological processing) on the above-mentioned multiple sub-areas respectively, threshold segmentation is performed on the multiple sub-areas after the image feature enhancement processing through binarization processing to obtain a corresponding fourth grayscale image, wherein the connected area of each sub-area in the above-mentioned fourth grayscale image may include multiple discontinuous fingerprint areas, and the common connected areas can be merged to accurately locate and extract the fingerprint area, thereby reducing the error caused by uneven light source. For the description of the specific scene corresponding to the image processing under the condition of uneven light source in the embodiments of the present application, please refer to the corresponding embodiments in Figures 3A to 5A below, which will not be described in detail in the embodiments of the present application.

在一种可能的实现方式中,所述对所述指纹图像进行图像处理,确定所述指纹图像中的目标区域、以及所述目标区域中采集有指纹纹路的指纹区域,包括;基于拍摄参数确定所述目标区域;将所述目标区域的图像转化为第一灰度图像;从所述第一灰度图像中提取出背景区域,将所述第一灰度图像中的所述背景区域去除;对去除背景区域后的第一灰度图像进行图像特征增强处理,得到第二灰度图像;对所述第二灰度图像进行二值化处理,以确定所述目标区域中符合指纹特征的指纹区域。本申请实施例中通过对指纹图像中的目标区域进行图像处理,包括灰度转化、背景区域提取、图像特征增强和二值化处理,从而确定目标区域中采集有指纹纹路的指纹区域,其中,在将目标区域的图像转换为灰度图像后,通过提取背景区域并将其去除,可以去除颜色信息,且有效地减少非指纹区域的干扰,并在进行后续图像处理后通过比较灰度信息更准确的判断相同材质的壳体之间的差异,使得后续的图像特征增强和二值化处理更加集中于指纹区域,以提高对相同材质的壳体指纹残留性能差异的准确度和客观性。关于本申请实施例中的背景提取后、且光源均匀情况下图像处理对应的具体场景描述可参见下文中图6A对应的实施例,本申请实施例中不作赘述。In a possible implementation, the image processing of the fingerprint image to determine the target area in the fingerprint image and the fingerprint area in the target area where fingerprint lines are collected includes: determining the target area based on shooting parameters; converting the image of the target area into a first grayscale image; extracting the background area from the first grayscale image and removing the background area from the first grayscale image; performing image feature enhancement processing on the first grayscale image after removing the background area to obtain a second grayscale image; and binarizing the second grayscale image to determine the fingerprint area in the target area that meets the fingerprint features. In the embodiment of the present application, the target area in the fingerprint image is subjected to image processing, including grayscale conversion, background area extraction, image feature enhancement and binarization processing, so as to determine the fingerprint area in the target area where the fingerprint pattern is collected, wherein, after the image of the target area is converted into a grayscale image, the background area is extracted and removed, the color information can be removed, and the interference of the non-fingerprint area can be effectively reduced, and after subsequent image processing, the difference between shells of the same material can be more accurately judged by comparing the grayscale information, so that the subsequent image feature enhancement and binarization processing are more concentrated on the fingerprint area, so as to improve the accuracy and objectivity of the difference in the residual performance of the shells of the same material. For the specific scene description corresponding to the image processing after the background extraction and the uniform light source in the embodiment of the present application, please refer to the embodiment corresponding to Figure 6A below, which will not be repeated in the embodiment of the present application.

在一种可能的实现方式中,所述对所述指纹图像进行图像处理,确定所述指纹图像中的目标区域、以及所述目标区域中采集有指纹纹路的指纹区域,包括;基于拍摄参数确定所述目标区域;将所述目标区域的图像转换为第三灰度图像;基于拍摄光源和所述第三灰度图像的面积对所述第三灰度图像进行分区处理,得到多个子区域;从所述第三灰度图像中的每个子区域中提取出背景区域,将所述第三灰度图像中的每个子区域中的所述背景区域去除;对去除背景区域后的所述第三灰度图像中的每个子区域分别进行图像特征增强处理,得到第四灰度图像;通过对所述第四灰度图像进行二值化处理,并将二值化处理后所述第四灰度图像中的每个子区域共有的连通区域进行合并,以确定所述指纹区域。本申请实施例中通过自适应分区、阈值分割、共有连通区域合并等方式,减少光源不均匀时所导致的误差,并提升壳体进行指纹残留的检测方案的准确性。具体地,本申请实施例中基于拍摄参数确定指纹图像中的目标区域后(例如,假设指纹图像的像素面积为1200*1200,工作人员或系统可以基于拍摄设备、拍摄距离和拍摄条件,将指纹图像中指纹最集中的区域确定为目标区域,例如指纹图像中一块像素面积为500*500的区域,该区域中包括指纹纹路所在的指纹区域),通过对目标区域的图像进行背景提取,去除颜色信息,得到灰度图像后,可以通过对该灰度图像进行自适应分区处理得到多个子区域,并在进行后续图像处理后通过比较灰度信息更准确的判断相同材质的壳体之间的差异;进一步地,可以对背景提取后的多个子区域分别进行图像特征增强、阈值分割(即对图像特征增强后的多个灰度图像进行二值化处理)和连通区域合并等步骤,以减少光源不均匀带来的误差影响,使得最终确定的指纹区域更加准确。综上,本申请实施例中通过对目标区域的图像进行自适应分区、阈值分割和共有连通区域合并减少了光源不均匀的影响,且通过对图像特征增强前的多个灰度图像进行背景提取,减少了非指纹区域的干扰,进而提高了对相同材质的壳体指纹残留性能差异的准确度和客观性。关于本申请实施例中的背景提取后、且光源不均匀情况下图像处理对应的具体场景描述可参见下文中图7A-图9A对应的实施例,本申请实施例中不作赘述。In a possible implementation, the fingerprint image is processed to determine the target area in the fingerprint image and the fingerprint area in the target area where the fingerprint lines are collected, including: determining the target area based on shooting parameters; converting the image of the target area into a third grayscale image; partitioning the third grayscale image based on the shooting light source and the area of the third grayscale image to obtain multiple sub-areas; extracting the background area from each sub-area in the third grayscale image, and removing the background area in each sub-area in the third grayscale image; performing image feature enhancement processing on each sub-area in the third grayscale image after removing the background area to obtain a fourth grayscale image; binarizing the fourth grayscale image and merging the connected areas shared by each sub-area in the fourth grayscale image after the binarization processing to determine the fingerprint area. In the embodiment of the present application, the error caused by uneven light source is reduced by adaptive partitioning, threshold segmentation, and merging of shared connected areas, and the accuracy of the fingerprint residue detection scheme of the shell is improved. Specifically, in the embodiment of the present application, after determining the target area in the fingerprint image based on the shooting parameters (for example, assuming that the pixel area of the fingerprint image is 1200*1200, the staff or system can determine the area with the most concentrated fingerprints in the fingerprint image as the target area based on the shooting equipment, shooting distance and shooting conditions, such as an area with a pixel area of 500*500 in the fingerprint image, which includes the fingerprint area where the fingerprint lines are located), by performing background extraction on the image of the target area, removing color information, and obtaining a grayscale image, multiple sub-areas can be obtained by adaptively partitioning the grayscale image, and after subsequent image processing, the difference between shells of the same material can be more accurately judged by comparing the grayscale information; further, the multiple sub-areas after background extraction can be subjected to image feature enhancement, threshold segmentation (that is, binarization of the multiple grayscale images after image feature enhancement) and connected area merging, etc., to reduce the error caused by uneven light source, so that the fingerprint area finally determined is more accurate. In summary, in the embodiments of the present application, the influence of uneven light sources is reduced by adaptively partitioning, threshold segmenting, and merging common connected areas of the image of the target area, and the interference of non-fingerprint areas is reduced by background extraction of multiple grayscale images before image feature enhancement, thereby improving the accuracy and objectivity of the difference in residual performance of fingerprints on shells of the same material. For the specific scene description corresponding to image processing after background extraction and uneven light sources in the embodiments of the present application, please refer to the embodiments corresponding to Figures 7A-9A below, which will not be repeated in the embodiments of the present application.

在一种可能的实现方式中,所述图像特征增强处理包括;通过图像滤波对对应的灰度图像进行去噪处理;对去噪处理后的灰度图像进行形态学处理。本申请实施例中通过图像滤波可以有效地降低图像中的噪声,提高图像的质量和清晰度;并通过形态学处理进一步地改善图像的结构和形状,增强图像中指纹区域的特征,以在后续的图像处理过程中更准确的提取指纹区域,进而提高了壳体指纹残留的检测方案的准确性。In a possible implementation, the image feature enhancement process includes: performing denoising on the corresponding grayscale image through image filtering; and performing morphological processing on the grayscale image after denoising. In the embodiment of the present application, image filtering can effectively reduce the noise in the image and improve the quality and clarity of the image; and morphological processing can further improve the structure and shape of the image and enhance the features of the fingerprint area in the image, so as to more accurately extract the fingerprint area in the subsequent image processing process, thereby improving the accuracy of the detection scheme of the fingerprint residue on the shell.

在一种可能的实现方式中,所述对去噪处理后的灰度图像进行形态学处理,包括;将去噪处理后的灰度图像中的均匀背景区域去除,以得到前景区域;去除所述前景区域中的周边区域,以得到周边区域去除后的图像;所述均匀背景包括光源均匀和/或纹理均匀,所述周边区域为所述前景区域中除像素值集中的连通区域之外的区域;对周边区域去除后的图像进行形态学处理。本申请实施例中,在对去噪处理后的灰度图像进行形态学处理之前,可以通过将经过去噪处理后的灰度图像中的均匀背景(例如光源均匀和/或纹理均匀的背景)区域去除,并基于该灰度图像中连通区域的重心集中度实现更准确的指纹区域识别,即确定指纹纹路所在的区域,并剔除该区域之外的大块噪声;进一步地,如果未检测到前景区域内的连通区域,则可判断指纹残留度较弱。此外,还可以通过图像分割或形态学处理等方法确定指纹纹路所在区域的包络,并剔除包络外的噪声。In a possible implementation, the morphological processing of the grayscale image after denoising includes: removing the uniform background area in the grayscale image after denoising to obtain the foreground area; removing the peripheral area in the foreground area to obtain the image after the peripheral area is removed; the uniform background includes uniform light source and/or uniform texture, and the peripheral area is the area in the foreground area other than the connected area where the pixel values are concentrated; and performing morphological processing on the image after the peripheral area is removed. In an embodiment of the present application, before performing morphological processing on the grayscale image after denoising, the uniform background area (for example, the background area with uniform light source and/or uniform texture) in the grayscale image after denoising can be removed, and more accurate fingerprint area recognition can be achieved based on the centroid concentration of the connected area in the grayscale image, that is, determining the area where the fingerprint lines are located, and removing the large block noise outside the area; further, if the connected area in the foreground area is not detected, it can be judged that the fingerprint residue is weak. In addition, the envelope of the area where the fingerprint lines are located can be determined by image segmentation or morphological processing, and the noise outside the envelope can be removed.

步骤S102:基于所述指纹区域的像素信息与所述目标区域的像素信息,确定所述指纹区域与目标区域的对比度。Step S102: Determine the contrast between the fingerprint area and the target area based on the pixel information of the fingerprint area and the pixel information of the target area.

具体地,基于所需对比的壳体的材质是否相同,可以对比目标区域与指纹区域的不同的像素信息,例如,若所需对比的壳体的材质相同时,可以通过对比目标区域与指纹区域的灰度值更准确的判断壳体的指纹残留性能;或者,若所需对比的壳体的材质不同时,可以通过对比目标区域与指纹区域的RGB通道值更准确的判断壳体的指纹残留性能。Specifically, based on whether the material of the shell to be compared is the same, different pixel information of the target area and the fingerprint area can be compared. For example, if the material of the shell to be compared is the same, the fingerprint residual performance of the shell can be more accurately judged by comparing the grayscale values of the target area and the fingerprint area; or, if the material of the shell to be compared is different, the fingerprint residual performance of the shell can be more accurately judged by comparing the RGB channel values of the target area and the fingerprint area.

在一种可能的实现方式中,若所述像素信息包括RGB通道值;所述基于所述指纹区域的像素信息与所述目标区域的像素信息,确定所述指纹区域与目标区域的对比度,包括;确定所述指纹区域的RGB通道值中的每个通道值之和,和所述目标区域的RGB通道值中的每个通道值之和;将所述指纹区域的RGB通道值中的每个通道值之和,与所述目标区域的RGB通道值中的每个通道值之和进行对比,得到每个通道的对比度。本申请实施例中可以通过将指纹区域与目标区域的RGB通道值中每个通道值之和进行对比,以获取指纹区域与目标区域的颜色差异信息,从而在对比不同材质的壳体时提高了壳体指纹残留测试结果的准确性。具体地,首先在获取目标区域和指纹区域的像素信息(即RGB通道值)后,确定指纹区域的RGB通道值中的每个通道值之和与目标区域的RGB通道值中的每个通道值之和,系统可以通过将指纹区域与目标区域的RGB通道值中相同类型的通道值之和进行对比,得到RGB三种通道中每个通道的对比度,基于该对比度可以判断指纹区域与目标区域的颜色差异程度(指纹区域与目标区域的颜色差异程度越大,则证明指纹残留程度越高),从而在后续的指纹残留性能判断中得到更准确的结果。此外,在对不同材质的壳体进行测试时,因为不同材质的壳体通常具有明显的颜色差异,因此通过上述颜色差异信息可以更准确且更客观的判断不同壳体材质之间指纹残留性能的差异。关于本申请实施例中的对比指纹区域与目标区域的RGB通道值对比度对应的具体场景描述可参见下文中图2A-图5A对应的实施例,本申请实施例中不作赘述。In a possible implementation, if the pixel information includes RGB channel values; the determination of the contrast between the fingerprint area and the target area based on the pixel information of the fingerprint area and the pixel information of the target area includes: determining the sum of each channel value in the RGB channel values of the fingerprint area and the sum of each channel value in the RGB channel values of the target area; comparing the sum of each channel value in the RGB channel values of the fingerprint area with the sum of each channel value in the RGB channel values of the target area to obtain the contrast of each channel. In the embodiment of the present application, the color difference information between the fingerprint area and the target area can be obtained by comparing the sum of each channel value in the RGB channel values of the fingerprint area and the target area, thereby improving the accuracy of the shell fingerprint residue test result when comparing shells of different materials. Specifically, after first obtaining the pixel information (i.e., RGB channel values) of the target area and the fingerprint area, the sum of each channel value in the RGB channel values of the fingerprint area and the sum of each channel value in the RGB channel values of the target area are determined. The system can compare the sum of the channel values of the same type in the RGB channel values of the fingerprint area and the target area to obtain the contrast of each of the three RGB channels. Based on the contrast, the degree of color difference between the fingerprint area and the target area can be judged (the greater the degree of color difference between the fingerprint area and the target area, the higher the degree of fingerprint residue), thereby obtaining more accurate results in the subsequent judgment of fingerprint residue performance. In addition, when testing shells of different materials, because shells of different materials usually have obvious color differences, the above-mentioned color difference information can be used to more accurately and objectively judge the difference in fingerprint residue performance between different shell materials. For the specific scene description corresponding to the contrast of the RGB channel values of the fingerprint area and the target area in the embodiment of the present application, please refer to the embodiments corresponding to Figures 2A-5A below, which will not be repeated in the embodiments of the present application.

在一种可能的实现方式中,若所述像素信息包括灰度值;所述基于所述指纹区域的像素信息与所述目标区域的像素信息,确定所述指纹区域与目标区域的对比度,包括;确定所述指纹区域的灰度值之和和所述目标区域的灰度值之和;将所述指纹区域的灰度值之和与所述目标区域的灰度值之和的对比结果确定为所述对比度。本申请实施例中可以通过比较指纹区域的灰度值之和与目标区域的灰度值之和,来确定指纹区域与目标区域的灰度差异,例如,在对相同壳体材质进行测试时,因为相同材质的壳体之间的颜色差异较小,而灰度信息中包含更多的特征信息,因此可以通过比较不同壳体之间灰度差异信息判断指纹残留性能之间的差异,从而提高了壳体指纹残留性能的判断准确性。具体地,本申请实施例中可以通过指纹图像中的目标区域和指纹区域的像素信息(即灰度值),确定指纹区域的灰度值之和与目标区域的灰度值之和,并将其进行比较,判断指纹区域与目标区域的灰度差异程度(例如,在多次测试相同壳体材质时,若指纹区域与目标区域的灰度差异程度越大,则证明指纹残留程度越高),从而在后续的指纹残留性能判断中得到更准确的结果。此外,在对相同壳体材质进行测试时,因为相同材质的壳体在颜色的差异上较小,而灰度信息中更多的特征信息,因此通过上述灰度差异信息可以更准确且更客观的判断相同壳体材质之间指纹残留性能的差异。关于本申请实施例中的对比指纹区域与目标区域的灰度值对比度对应的具体场景描述可参见下文中图6A-图9A对应的实施例,本申请实施例中不作赘述。In a possible implementation, if the pixel information includes a grayscale value; the determination of the contrast between the fingerprint area and the target area based on the pixel information of the fingerprint area and the pixel information of the target area includes: determining the sum of the grayscale values of the fingerprint area and the sum of the grayscale values of the target area; and determining the contrast as the result of comparing the sum of the grayscale values of the fingerprint area and the sum of the grayscale values of the target area. In the embodiment of the present application, the grayscale difference between the fingerprint area and the target area can be determined by comparing the sum of the grayscale values of the fingerprint area with the sum of the grayscale values of the target area. For example, when testing the same shell material, because the color difference between shells of the same material is small, and the grayscale information contains more feature information, the difference between the fingerprint residual performance can be judged by comparing the grayscale difference information between different shells, thereby improving the accuracy of judging the fingerprint residual performance of the shell. Specifically, in the embodiment of the present application, the sum of the grayscale values of the fingerprint area and the sum of the grayscale values of the target area can be determined through the pixel information (i.e., grayscale value) of the target area and the fingerprint area in the fingerprint image, and compared to determine the degree of grayscale difference between the fingerprint area and the target area (for example, when the same shell material is tested multiple times, the greater the grayscale difference between the fingerprint area and the target area, the higher the degree of fingerprint residue), so as to obtain more accurate results in the subsequent fingerprint residue performance judgment. In addition, when testing the same shell material, because the shells of the same material have smaller color differences and more feature information in the grayscale information, the above-mentioned grayscale difference information can be used to more accurately and objectively judge the difference in fingerprint residue performance between the same shell materials. For the specific scene description corresponding to the grayscale value contrast ratio of the fingerprint area and the target area in the embodiment of the present application, please refer to the embodiments corresponding to Figures 6A-9A below, which will not be repeated in the embodiment of the present application.

步骤S103:基于所述指纹区域的面积和所述对比度,判断所述目标壳体的指纹残留性能。Step S103: judging the fingerprint residue performance of the target housing based on the area of the fingerprint region and the contrast.

具体地,本申请实施例中,系统首先获取指纹区域的面积和对比度信息。指纹区域的面积可以通过前一步骤中提取的指纹区域的像素数来计算,面积的大小反映了指纹区域在整个目标区域中的覆盖范围;对比度则可以通过计算指纹区域与目标区域的灰度值或者RGB通道值差异确定,对比度的高低反映了指纹区域的显著性和清晰度。在获得指纹区域的面积和对比度后,系统可以对这些指标进行分析,以判断目标壳体的指纹残留性能。示例性地,系统可以预先设定一个或多个阈值或标准,以评估指纹残留的程度。例如,可以由系统或工作人员预先设定面积阈值和对比度阈值,当系统检测到指纹区域的面积和对比度同时超过预定的阈值时,可以判断目标壳体具有明显的指纹残留(即指纹残留度较高)。Specifically, in the embodiment of the present application, the system first obtains the area and contrast information of the fingerprint area. The area of the fingerprint area can be calculated by the number of pixels of the fingerprint area extracted in the previous step, and the size of the area reflects the coverage of the fingerprint area in the entire target area; the contrast can be determined by calculating the difference in grayscale value or RGB channel value between the fingerprint area and the target area, and the contrast reflects the significance and clarity of the fingerprint area. After obtaining the area and contrast of the fingerprint area, the system can analyze these indicators to determine the fingerprint residual performance of the target shell. Exemplarily, the system can pre-set one or more thresholds or standards to evaluate the degree of fingerprint residue. For example, the area threshold and contrast threshold can be pre-set by the system or staff. When the system detects that the area and contrast of the fingerprint area exceed the predetermined threshold at the same time, it can be judged that the target shell has obvious fingerprint residue (that is, the fingerprint residue is high).

在一种可能的实现方式中,所述基于所述指纹区域的面积和所述对比度,判断所述目标壳体的指纹残留性能,包括;若所述指纹区域的面积小于预设面积、且所述对比度小于预设对比度,则判断所述目标壳体的指纹残留度低。本申请实施例中,若指纹区域的面积小于预设面积,且指纹区域与目标区域之间的对比度(例如,若是比较相同材质的壳体,则对比度为灰度值的对比度,或者,若是比较不同材质的壳体,则对比度为RGB通道值的对比度)小于预设对比度,则判断目标壳体的指纹残留度低,通过指纹区域的大小和与目标区域的颜色或灰度差异程度,从而更准确的评估指纹残留情况,以提升壳体指纹残留的检测方案的准确性和客观性。示例性地,可参见图1C,图1C为本申请实施例中提供的一种不同材质壳体指纹残留性能判断示意图,如图1C所示,图1C中展示了不同材质样品的指纹残留图像以及相应的面积和对比度标准,图1C中包含三个主要材质类别:PC壳料、触控板和屏幕(例如平板柔性屏幕)。每个类别下的指纹图像分别展示了该材质样品在标准光源和拍摄条件下的指纹残留情况;对于PC壳料,指纹图像1中显示了在标准光源条件下拍摄的指纹残留情况,系统可以通过图像处理算法提取指纹区域,并计算指纹区域的面积和对比度(例如指纹图像1中指纹区域与目标区域的RGB通道值的对比度);触控板和屏幕分别对应的指纹图像2和指纹图像3可参见指纹图像1对应的实施例描述,此处不再赘述;如图1C所示,若检测到指纹图像1、指纹图像2和指纹图像3中的一个或多个指纹图像中的指纹残留面积应小于2000平方像素,且对比度应低于30%,则判断该指纹图像对应的壳体的抗指纹性能和抗脏污性能较好。通过在不同壳体材质上的应用,本申请实施例中提供的示例可以验证壳体指纹残留的检测方法在多种实际应用场景中的普适性和有效性。In a possible implementation, the fingerprint residual performance of the target shell is judged based on the area of the fingerprint area and the contrast, including: if the area of the fingerprint area is less than the preset area and the contrast is less than the preset contrast, then the fingerprint residual degree of the target shell is judged to be low. In the embodiment of the present application, if the area of the fingerprint area is less than the preset area, and the contrast between the fingerprint area and the target area (for example, if the shells of the same material are compared, the contrast is the contrast of the grayscale value, or if the shells of different materials are compared, the contrast is the contrast of the RGB channel value) is less than the preset contrast, then the fingerprint residual degree of the target shell is judged to be low, and the fingerprint residual situation is more accurately evaluated by the size of the fingerprint area and the color or grayscale difference with the target area, so as to improve the accuracy and objectivity of the detection scheme of the shell fingerprint residue. For example, see Figure 1C, Figure 1C is a schematic diagram of judging the fingerprint residual performance of a shell of different materials provided in the embodiment of the present application, as shown in Figure 1C, Figure 1C shows the fingerprint residual images of samples of different materials and the corresponding area and contrast standards, and Figure 1C contains three main material categories: PC shell material, touch panel and screen (such as a flat flexible screen). The fingerprint images under each category show the fingerprint residue of the material sample under standard light source and shooting conditions; for PC shell material, fingerprint image 1 shows the fingerprint residue taken under standard light source conditions. The system can extract the fingerprint area through image processing algorithm and calculate the area and contrast of the fingerprint area (for example, the contrast of the RGB channel value of the fingerprint area and the target area in fingerprint image 1); the fingerprint image 2 and fingerprint image 3 corresponding to the touch panel and the screen respectively can refer to the description of the embodiment corresponding to fingerprint image 1, which will not be repeated here; as shown in Figure 1C, if the fingerprint residue area in one or more fingerprint images of fingerprint image 1, fingerprint image 2 and fingerprint image 3 is detected to be less than 2000 square pixels, and the contrast should be less than 30%, it is judged that the shell corresponding to the fingerprint image has good anti-fingerprint performance and anti-fouling performance. Through the application on different shell materials, the examples provided in the embodiments of this application can verify the universality and effectiveness of the detection method of shell fingerprint residue in a variety of practical application scenarios.

可选地,在上述方法步骤S101中,在对多个不同的壳体进行指纹残留的检测时,基于壳体的材质是否相同,图像处理时可以包括两种不同的处理,具体可参见图2A,图2A为本申请实施例中提供的另一种壳体指纹残留测试方案的流程示意图;图2A中可以包括(一)图像灰度计算201和(二)图像转灰度计算以及背景提取202,基于不同的处理,判断指纹区域与目标区域对比度时的像素信息也不同,如(一)图像灰度计算201为在比较相同材质的壳体的指纹残留度时,通过指纹区域与目标区域的RGB通道值中每个通道值之和的对比度,以及指纹区域的面积判断指纹残留度;(二)图像转灰度计算以及背景提取202为在比较不同材质的壳体的指纹残留度时,通过多一步背景提取步骤,从而得到指纹区域中更多的灰度信息,并通过指纹区域与目标区域的灰度值之和的对比度,以及指纹区域的面积判断指纹残留度,其中,(一)图像灰度计算201和(二)图像转灰度计算以及背景提取202在具体实施时均可以包括图2A中场景一、场景二、场景三和场景四这四种场景中的一种或多种场景,具体可包括如下场景描述:Optionally, in step S101 of the above method, when fingerprint residues are detected on multiple different shells, based on whether the material of the shells is the same, the image processing may include two different processes, specifically referring to FIG2A, FIG2A is a flow chart of another shell fingerprint residue test scheme provided in an embodiment of the present application; FIG2A may include (i) image grayscale calculation 201 and (ii) image conversion grayscale calculation and background extraction 202. Based on different processes, the pixel information when judging the contrast between the fingerprint area and the target area is also different. For example, (i) image grayscale calculation 201 is when comparing the fingerprint residue of shells of the same material, the RGB channel of the fingerprint area and the target area is used to compare the fingerprint residue of the shells. The fingerprint residue is determined by the contrast of the sum of each channel value in the channel value and the area of the fingerprint area; (ii) image to grayscale calculation and background extraction 202 is to obtain more grayscale information in the fingerprint area by an additional background extraction step when comparing the fingerprint residues of shells of different materials, and the fingerprint residue is determined by the contrast of the sum of the grayscale values of the fingerprint area and the target area, and the area of the fingerprint area. Among them, (i) image grayscale calculation 201 and (ii) image to grayscale calculation and background extraction 202 can include one or more of the four scenes of scene 1, scene 2, scene 3 and scene 4 in Figure 2A during specific implementation, and can specifically include the following scene descriptions:

(一)图像灰度计算201。(i) Image grayscale calculation 201.

场景一:光源均匀,且未去除均匀背景的场景。Scene 1: The light source is uniform and the uniform background is not removed.

具体地,可参见图2B,图2B为本申请实施例中提供的一种图像灰度计算场景一的流程图,该流程可以包括以下步骤S2001-步骤S2004。Specifically, please refer to Figure 2B, which is a flowchart of an image grayscale calculation scenario 1 provided in an embodiment of the present application. The process may include the following steps S2001-S2004.

步骤S2001:指纹图像拍摄输入。Step S2001: Fingerprint image capture and input.

具体地,获取指纹图像,指纹图像即针对目标壳体表面上的指纹进行拍摄得到的指纹图像。不同壳体对应的指纹图像可以为通过相同的拍摄条件拍摄所得到的图像,例如相同的拍摄光源、拍摄手法、拍摄设备等条件,可以在后续对比不同壳体的指纹残留性能差异时得到更客观、更准确的对比结果,避免了因为拍摄条件不同导致的数据异常等影响。Specifically, a fingerprint image is obtained, which is a fingerprint image obtained by photographing the fingerprint on the surface of the target shell. The fingerprint images corresponding to different shells can be images obtained by photographing under the same shooting conditions, such as the same shooting light source, shooting technique, shooting equipment and other conditions, so that a more objective and accurate comparison result can be obtained when comparing the fingerprint residual performance differences of different shells in the subsequent comparison, avoiding the influence of data anomalies caused by different shooting conditions.

步骤S2002:感兴趣区域(Region of Interest,RIO)提取。Step S2002: extracting the region of interest (RIO).

具体地,在获取指纹图像后,可以通过对指纹图像进行RIO区域提取,从指纹图像中提取出目标区域、以及目标区域中采集有指纹纹路的指纹区域,其中,步骤S2002中可以包括以下步骤S2002A-步骤S2002D。Specifically, after acquiring the fingerprint image, the target area and the fingerprint area with fingerprint patterns collected in the target area can be extracted from the fingerprint image by performing RIO area extraction on the fingerprint image, wherein step S2002 may include the following steps S2002A-S2002D.

步骤S2002A:图像灰度计算。Step S2002A: Image grayscale calculation.

具体地,在图像灰度计算之前,首先通过指纹图像的拍摄参数确定目标区域(例如,假设指纹图像的像素面积为1200*1200,工作人员或系统可以基于拍摄设备、拍摄距离和拍摄条件,将指纹图像中指纹最集中的区域确定为目标区域,例如指纹图像中一块像素面积为500*500的区域,该区域中包括指纹纹路所在的指纹区域),图像灰度计算用于将指纹图像由彩色图像转换为灰度图像,该灰度图像仅包含亮度信息,去除了色彩信息。示例性地,灰度计算可以采用加权平均法,即根据图像的RGB三个通道的亮度值计算灰度值,例如该灰度计算公式可以为:灰度值 = 0.299R + 0.587G + 0.114*B,该灰度计算公式为根据人眼对不同颜色的可见程度加权计算得出,使指纹图像中每个像素的RGB通道信息(通常由红、绿、蓝三个通道组成)被合成为一个灰度值,并基于该灰度值将指纹图像转换为仅包括灰度信息的灰度图像,上述灰度计算公式仅为一种可能的实施方式,也可以为其他实施方式,本申请实施例中不作限定。此外,通过指纹图像的拍摄参数确定目标区域可参见图2C,图2C为本申请实施例中提供的一张目标区域确定示意图,图2C中可以包括指纹图像示意图02-A和目标区域的图像示意图02-B,如指纹图像示意图02-A所示,假设指纹图像示意图02-A的像素面积为1500*1500,其中白线框中为指纹所在的区域;工作人员或系统可以基于拍摄设备、拍摄距离和拍摄条件,将指纹图像示意图02-A中指纹最集中的区域确定为目标区域,如目标区域的图像示意图02-B所示,该目标区域的图像示意图02-B的像素面积为150*150,使目标区域的图像示意图02-B中同样包括白线框(即指纹所在的区域),且大幅减少了其他不包含有效信息的区域,后续可以基于该目标区域更准确的确定出指纹区域、以及指纹残留性能。Specifically, before the image grayscale calculation, the target area is first determined by the shooting parameters of the fingerprint image (for example, assuming that the pixel area of the fingerprint image is 1200*1200, the staff or system can determine the area with the most concentrated fingerprints in the fingerprint image as the target area based on the shooting equipment, shooting distance and shooting conditions, such as an area with a pixel area of 500*500 in the fingerprint image, which includes the fingerprint area where the fingerprint lines are located). The image grayscale calculation is used to convert the fingerprint image from a color image to a grayscale image, which only contains brightness information and removes color information. Exemplarily, the grayscale calculation can adopt the weighted average method, that is, the grayscale value is calculated according to the brightness values of the three RGB channels of the image. For example, the grayscale calculation formula can be: grayscale value = 0.299 R + 0.587 G + 0.114*B. The grayscale calculation formula is obtained by weighted calculation based on the visibility of different colors to the human eye, so that the RGB channel information of each pixel in the fingerprint image (usually composed of three channels of red, green, and blue) is synthesized into a grayscale value, and based on the grayscale value, the fingerprint image is converted into a grayscale image including only grayscale information. The above grayscale calculation formula is only one possible implementation method, and other implementation methods may also be used, which is not limited in the embodiments of the present application. In addition, the target area determined by the shooting parameters of the fingerprint image can be seen in Figure 2C. Figure 2C is a target area determination schematic diagram provided in an embodiment of the present application. Figure 2C may include fingerprint image schematic diagram 02-A and image schematic diagram 02-B of the target area. As shown in fingerprint image schematic diagram 02-A, it is assumed that the pixel area of fingerprint image schematic diagram 02-A is 1500*1500, wherein the white line frame is the area where the fingerprint is located; the staff or the system can determine the area with the most concentrated fingerprints in the fingerprint image schematic diagram 02-A as the target area based on the shooting equipment, shooting distance and shooting conditions, as shown in the image schematic diagram 02-B of the target area, the pixel area of the image schematic diagram 02-B of the target area is 150*150, so that the image schematic diagram 02-B of the target area also includes the white line frame (i.e., the area where the fingerprint is located), and greatly reduces other areas that do not contain valid information. Subsequently, the fingerprint area and fingerprint residual performance can be more accurately determined based on the target area.

步骤S2002B:图像滤波。Step S2002B: Image filtering.

具体地,在将目标区域的图像转换为灰度图像之后,可以通过图像滤波对灰度图像进行去噪处理。示例性地,本申请实施例中可以通过log-Gabor滤波器和/或中值滤波对灰度图像进行去噪处理,log-Gabor滤波器用于提取图像中的指纹纹路特征,增强图像中的细节和边缘信息;中值滤波是一种非线性滤波方法,主要用于去除图像中的噪声(例如椒盐噪声),同时保留图像的边缘细节。通过上述图像滤波处理,可以初步减少图像中的干扰和噪声,并提高指纹纹路的清晰度和连续性。Specifically, after the image of the target area is converted into a grayscale image, the grayscale image can be denoised by image filtering. Exemplarily, in the embodiment of the present application, the grayscale image can be denoised by log-Gabor filter and/or median filter. The log-Gabor filter is used to extract fingerprint pattern features in the image and enhance the details and edge information in the image; the median filter is a nonlinear filtering method, which is mainly used to remove noise (such as salt and pepper noise) in the image while retaining the edge details of the image. Through the above-mentioned image filtering process, the interference and noise in the image can be preliminarily reduced, and the clarity and continuity of the fingerprint pattern can be improved.

步骤S2002C:数学形态学计算。Step S2002C: mathematical morphology calculation.

具体地,在通过图像滤波对灰度图像进行去噪处理后,可以对去噪处理后的灰度图像进行形态学处理(即数学形态学计算),形态学处理可以包括腐蚀、膨胀、开运算和闭运算等。示例性地,在本申请实施例中可以通过膨胀操作来填充去噪处理后的灰度图像中的指纹纹路中的空洞,使其更加完整;同时,利用闭运算可以消除指纹纹路中的小孔或断裂,从而提高灰度图像的连续性和清晰度,进一步强化图像中的指纹特征,上述数学形态学计算仅为一种可能的实施方式,也可以为其他实施方式,本申请实施例中不作限定。Specifically, after the grayscale image is denoised by image filtering, the denoised grayscale image can be subjected to morphological processing (i.e., mathematical morphological calculation), and the morphological processing can include corrosion, expansion, opening operation, closing operation, etc. For example, in the embodiment of the present application, the holes in the fingerprint lines in the denoised grayscale image can be filled by the expansion operation to make it more complete; at the same time, the small holes or breaks in the fingerprint lines can be eliminated by the closing operation, thereby improving the continuity and clarity of the grayscale image and further strengthening the fingerprint features in the image. The above-mentioned mathematical morphological calculation is only one possible implementation method, and other implementation methods can also be used, which are not limited in the embodiment of the present application.

步骤S2002D:自适应大津法(Otsu's Method,OSTU)二值化提取指纹位置。Step S2002D: Adaptive Otsu's Method (OSTU) is used to binarize and extract the fingerprint position.

具体地,在灰度图像经过图像滤波处理和数学形态学计算后,系统可以采用自适应OSTU二值化提取灰度图像中的指纹位置(即指纹区域)。自适应OSTU二值化为一种基于灰度直方图的自动阈值选取技术,其原理是通过最大化类间方差来确定最佳分割阈值,从而将图像分割为前景(指纹图案)和背景两部分,该方法不仅能够适应不同图像的灰度分布特点,还能够根据局部区域的特性进行灵活调整,因此能够更加准确地提取出指纹的位置信息。在本申请实施例中,自适应 OSTU二值化的目的是将图像分割为前景和背景两部分,因此输出的是一个只包含黑白两种像素值的图像,黑色(表示背景)和白色(表示前景),即灰度图像将变为二值图像,用于表示物体的存在或缺失。通过自适应OSTU二值化,系统可以动态地调整阈值,以确保在不同区域都能够获得最佳的分割效果,即使在目标区域的图像中存在光照不均匀、噪声干扰等情况下,系统仍能够准确地提取出指纹的位置信息。Specifically, after the grayscale image is processed by image filtering and mathematical morphology calculation, the system can use adaptive OSTU binarization to extract the fingerprint position (i.e., fingerprint area) in the grayscale image. Adaptive OSTU binarization is an automatic threshold selection technology based on grayscale histogram. Its principle is to determine the optimal segmentation threshold by maximizing the inter-class variance, thereby segmenting the image into two parts: foreground (fingerprint pattern) and background. This method can not only adapt to the grayscale distribution characteristics of different images, but also be flexibly adjusted according to the characteristics of the local area, so that the fingerprint location information can be extracted more accurately. In the embodiment of the present application, the purpose of adaptive OSTU binarization is to segment the image into two parts: foreground and background. Therefore, the output is an image containing only black and white pixel values, black (representing the background) and white (representing the foreground), that is, the grayscale image will become a binary image to indicate the presence or absence of an object. Through adaptive OSTU binarization, the system can dynamically adjust the threshold to ensure that the best segmentation effect can be obtained in different areas. Even if there is uneven illumination, noise interference, etc. in the image of the target area, the system can still accurately extract the fingerprint location information.

步骤S2003:直接计算指纹区域的面积。Step S2003: directly calculating the area of the fingerprint region.

具体地,本申请实施例中可以基于步骤S2002中提取的二值化指纹区域(即指纹位置)计算得出指纹区域的面积,并将指纹区域的面积作为残留指纹面积输出。示例性地,系统首先对二值化后的指纹区域进行扫描,因为在指纹区域像中,黑色像素代表指纹纹路,所以通过统计指纹区域中所有黑色像素的数量,即可得到指纹区域的面积,其中,统计方法包括但不限于逐行扫描、逐列扫描、自动化提取算法以及区域生长等算法。此外,在计算指纹区域面积的过程中,因为不同图像的分辨率可能不同,相同面积的指纹区域在不同分辨率的图像中对应的像素数量也不同,因此,在计算面积时,系统可以通过引入图像的分辨率信息进行转换,例如,通过像素密度(每英寸像素数,DPI)将像素面积转换为实际面积,以得到指纹区域的面积。Specifically, in the embodiment of the present application, the area of the fingerprint area can be calculated based on the binary fingerprint area (i.e., fingerprint position) extracted in step S2002, and the area of the fingerprint area is output as the residual fingerprint area. For example, the system first scans the fingerprint area after binarization. Because the black pixels in the fingerprint area image represent the fingerprint lines, the area of the fingerprint area can be obtained by counting the number of all black pixels in the fingerprint area, wherein the statistical method includes but is not limited to row-by-row scanning, column-by-column scanning, automatic extraction algorithm, and regional growth algorithm. In addition, in the process of calculating the area of the fingerprint area, because the resolution of different images may be different, the number of pixels corresponding to the fingerprint area of the same area in images of different resolutions is also different. Therefore, when calculating the area, the system can convert by introducing the resolution information of the image, for example, by converting the pixel area to the actual area through the pixel density (pixels per inch, DPI) to obtain the area of the fingerprint area.

步骤S2004:将指纹位置放入原图分别计算RGB通道的指纹对比度。Step S2004: Place the fingerprint position into the original image and calculate the fingerprint contrast of the RGB channels respectively.

具体地,可以通过将步骤S2002中提取的指纹位置放入目标区域的图像(即步骤S2001中的目标区域的图像)中,计算指纹区域与目标区域的RGB通道值的对比度,并输出RGB三个通道的指纹残留对比度;进一步地,在检测指纹残留性能时,用户或工作人员通过手指触碰壳体材料后(即在壳体材料上留下指纹痕迹),可以在等待一定的时间(例如5分钟)后擦拭手指所接触的区域(即指纹区域),再通过人为查看判断指纹残留性能,或者对壳体材料进行拍摄,并通过步骤S2001-步骤S2005所描述的实施例对此次拍摄的指纹图像进行指纹残留性能判断,以更准确的确定指纹残留性能;或者,本申请实施例中,用户或工作人员通过手指触碰壳体材料(即在壳体材料上留下指纹痕迹),并等待一定的时间(例如3分钟)后,再通过人为查看判断指纹残留性能,或者对壳体材料进行拍摄,并通过步骤S2001-步骤S2005所描述的实施例对此次拍摄的指纹图像进行指纹残留性能判断,以更准确的确定指纹残留性能。示例性地,在对不同材质的壳体进行测试时,因为不同材质的壳体通常具有明显的颜色差异,因此通过该颜色差异信息(即RGB通道值的对比度)可以更准确且更客观的判断不同壳体材质之间指纹残留性能的差异,可以通过对比度公式计算得出上述RGB三个通道的对比度,具体可参见图2D,图2D为本申请实施例中提供的一种反相计算示意图,图2D中可以包括第一反相计算示意图02-C和第二反相计算示意图02-D;如第一反相计算示意图02-C所示,假设目标区域的整体面积为A,目标区域内指纹区域的面积为B,指纹区域之外的其他区域面积为A-B;B区域内的平均R通道值为β,A-B区域的平均R通道值为α,一般情况下指纹区域的颜色深度一般大于除指纹区域之外的区域(即B区域的颜色比A-B区域的颜色深),而深色的灰度统计则是颜色越深代表灰度越低,因此可以把图像整体反相计算,就是由第一反相计算示意图02-C转化成第二反相计算示意图02-D计算,此时β大于α,A大于B。Specifically, the fingerprint position extracted in step S2002 can be placed in the image of the target area (i.e., the image of the target area in step S2001), the contrast between the RGB channel values of the fingerprint area and the target area can be calculated, and the fingerprint residual contrast of the three RGB channels can be output; further, when detecting the fingerprint residual performance, after the user or staff touches the shell material with a finger (i.e., leaves a fingerprint mark on the shell material), the user or staff can wait for a certain time (e.g., 5 minutes) and wipe the area contacted by the finger (i.e., the fingerprint area), and then manually check and judge the fingerprint residual performance, or shoot the shell material, and judge the fingerprint residual performance of the fingerprint image shot this time through the embodiments described in steps S2001-S2005, so as to more accurately determine the fingerprint residual performance; or, in the embodiment of the present application, the user or staff touches the shell material with a finger (i.e., leaves a fingerprint mark on the shell material), and waits for a certain time (e.g., 3 minutes), and then manually check and judge the fingerprint residual performance, or shoot the shell material, and judge the fingerprint residual performance of the fingerprint image shot this time through the embodiments described in steps S2001-S2005, so as to more accurately determine the fingerprint residual performance. For example, when testing shells of different materials, because shells of different materials usually have obvious color differences, the difference in fingerprint residual performance between different shell materials can be judged more accurately and objectively through the color difference information (i.e., the contrast of RGB channel values), and the contrast of the above three RGB channels can be calculated by the contrast formula. For details, please refer to Figure 2D, which is an inversion calculation schematic diagram provided in an embodiment of the present application. Figure 2D may include a first inversion calculation schematic diagram 02-C and a second inversion calculation schematic diagram 02-D; as shown in the first inversion calculation schematic diagram 02-C , assuming that the overall area of the target area is A, the area of the fingerprint area within the target area is B, and the area of other areas outside the fingerprint area is A-B; the average R channel value in area B is β, and the average R channel value in area A-B is α. In general, the color depth of the fingerprint area is generally greater than that of the area other than the fingerprint area (that is, the color of area B is darker than that of area A-B), and the dark grayscale statistics are that the darker the color, the lower the grayscale. Therefore, the overall image can be inverted, that is, the first inversion calculation diagram 02-C is converted into the second inversion calculation diagram 02-D. At this time, β is greater than α, and A is greater than B.

此时计算的对比度指标就可以表示成,B区域的图像R通道值求和比A区域的图像R通道值求和,对比度公式可以表示为:At this time, the calculated contrast index can be expressed as the sum of the R channel values of the image in area B is greater than the sum of the R channel values of the image in area A. The contrast formula can be expressed as:

在基于上述对比度公式确定指纹区域与目标区域的R通道值对比度(即B区域与A区域的R通道值对比度)后,可以将RGB通道中的G通道值和B通道值分别代入上述对比度公式中,以分别计算出RGB三个通道的指纹残留对比度。After determining the R channel value contrast between the fingerprint area and the target area (i.e., the R channel value contrast between the B area and the A area) based on the above contrast formula, the G channel value and the B channel value in the RGB channel can be substituted into the above contrast formula respectively to calculate the fingerprint residual contrast of the three RGB channels respectively.

首先对该简化公式的单调性分析:First, the monotonicity analysis of the simplified formula is:

(1)当A的面积固定时(真实拍摄照片的时候,也需要使用固定的设备和距离将A面积固定),contrast和B正相关;(1) When the area of A is fixed (when taking photos in real life, the area of A also needs to be fixed using fixed equipment and distance), contrast is positively correlated with B;

(2)当A与B(残留面积)固定时,contrast与负相关,β越大,α越小,则越小,整体contrast越大(β与α差异越大,contrast越大(显著对比),同样符合对比度主观含义);(2) When A and B (residual area) are fixed, contrast and Negative correlation, the larger β is, the smaller α is. The smaller it is, the greater the overall contrast (the greater the difference between β and α, the greater the contrast (significant contrast), which also conforms to the subjective meaning of contrast);

其次分析公式中几个变量的影响因素和相关性:Secondly, analyze the influencing factors and correlations of several variables in the formula:

整体面积A:与拍摄设备(device)、拍摄条件(距离L、笔记本厚度d)、框选指纹区域ROI相关。Overall area A: related to the shooting device, shooting conditions (distance L, notebook thickness d), and the selected fingerprint area ROI.

指纹区域面积(脏污区域面积)B:B是自动化提取算法提取的指纹面积,B与指纹算法提取精度相关,B与指纹灰度平均深度β和背景平均灰度深度α相关。Fingerprint area (dirty area) B: B is the fingerprint area extracted by the automatic extraction algorithm. B is related to the fingerprint algorithm extraction accuracy. B is related to the average grayscale depth β of the fingerprint and the average grayscale depth α of the background.

背景平均灰度α和指纹平均深度β:与材质(Material)、拍摄设备(device)、拍摄光源(light-source)、指纹残留情况(condition)相关。Background average grayscale α and fingerprint average depth β: related to material (Material), shooting equipment (device), shooting light source (light-source), and fingerprint residue condition (condition).

最后在特殊情况下,对特殊值分析:Finally, in special cases, special values are analyzed:

假设固定指纹区域检测面积B(能检测出指纹则β>α),若β与α差异越大,则contrast越大。Assume that the fingerprint detection area B is fixed (if the fingerprint can be detected, β>α), the greater the difference between β and α, the greater the contrast.

场景二:光源不均匀,且未去除均匀背景的场景。Scene 2: The light source is uneven and the uniform background is not removed.

具体地,可参见图3A,图3A为本申请实施例中提供的一种图像灰度计算场景二的流程图,该流程可以包括以下步骤S3001-步骤S3004。Specifically, please refer to Figure 3A, which is a flowchart of an image grayscale calculation scenario 2 provided in an embodiment of the present application. The process may include the following steps S3001-S3004.

步骤S3001:指纹图像拍摄输入。Step S3001: Fingerprint image capture and input.

步骤S3002:感兴趣区域(Region of Interest,RIO)提取。Step S3002: Region of Interest (RIO) extraction.

具体地,在获取指纹图像后,可以通过对指纹图像进行RIO区域提取,从指纹图像中提取出目标区域、以及目标区域中采集有指纹纹路的指纹区域,其中,步骤S3002中可以包括以下步骤S3002A-步骤S3002H。Specifically, after acquiring the fingerprint image, the target area and the fingerprint area with fingerprint patterns collected in the target area can be extracted from the fingerprint image by performing RIO area extraction on the fingerprint image, wherein step S3002 can include the following steps S3002A-S3002H.

步骤S3002A:图像灰度计算。Step S3002A: Image grayscale calculation.

步骤S3002B:目标区域的图像自适应分区。Step S3002B: adaptively partition the image of the target area.

具体地,当检测到目标区域的图像的光源不均匀时,系统会根据目标区域的图像的特性和光源情况,将图像自适应划分为多个区域,以更好地适应图像的局部特征。示例性地,可参见图3B,图3B为本申请实施例中提供的一种光源不均匀示意图,如图3B所示,图3B的黑线框中为指纹所在区域,图3B中出现了不同程度的不均匀反光,按正常步骤计算可能会对指纹区域的计算结果有影响,因此当系统检测到目标区域的图像出现中心区域亮度高于周围区域(即除指纹所在区域之外的区域)等光源不均匀情况时,可以通过将目标区域的图像按照3×3和/或4×4的网格进行分区,以更精准地对每个区域进行处理,从而最大限度地减少处理误差。Specifically, when the light source of the image of the target area is detected to be uneven, the system will adaptively divide the image into multiple areas according to the characteristics of the image of the target area and the light source conditions, so as to better adapt to the local features of the image. For example, please refer to Figure 3B, which is a schematic diagram of uneven light source provided in an embodiment of the present application. As shown in Figure 3B, the black line frame in Figure 3B is the area where the fingerprint is located. In Figure 3B, there are uneven reflections of varying degrees. Calculation according to normal steps may affect the calculation results of the fingerprint area. Therefore, when the system detects that the image of the target area has uneven light source conditions such as the central area brightness being higher than the surrounding area (i.e., the area other than the fingerprint area), the image of the target area can be partitioned according to 3×3 and/or 4×4 grids to more accurately process each area, thereby minimizing processing errors.

步骤S3002C:图像滤波。Step S3002C: Image filtering.

步骤S3002D:数学形态学计算。Step S3002D: mathematical morphology calculation.

步骤S3002E:分区图像阈值分割。Step S3002E: Partition image threshold segmentation.

具体地,在对目标区域的图像进行图像灰度计算、自适应分区、图像滤波去噪处理和数学形态学计算后,可以得到目标区域的灰度图像的多个子区域,并针对每个子区域分别计算其平均亮度,以及基于各个子区域的平均亮度差异设置适当的阈值,最后基于该阈值可以将每个子区域中的像素分为两类:高于阈值的像素点被归为指纹特征,而低于阈值的像素点被归为背景;通过上述二值化处理的阈值分割可以更准确地从目标区域的图像中提取出指纹区域。示例性地,如果多个子区域中的某个子区域内的平均亮度较高,可能意味着该子区域中存在指纹纹路,因此可以选择一个相对较低的阈值进行分割,以确保指纹区域能够被有效提取出来;而对于平均亮度较低的子区域,则可能是背景区域,因此可以选择一个较高的阈值进行分割,以减少背景的干扰,通过这种分区图像阈值分割的方法,可以更加灵活地处理光源不均匀性情况,并提高后续指纹区域的提取准确度和稳定性。Specifically, after the image grayscale calculation, adaptive partitioning, image filtering and denoising processing and mathematical morphology calculation are performed on the image of the target area, multiple sub-areas of the grayscale image of the target area can be obtained, and the average brightness of each sub-area is calculated respectively, and an appropriate threshold is set based on the average brightness difference of each sub-area. Finally, based on the threshold, the pixels in each sub-area can be divided into two categories: the pixels above the threshold are classified as fingerprint features, and the pixels below the threshold are classified as background; the fingerprint area can be more accurately extracted from the image of the target area through the threshold segmentation of the above-mentioned binarization processing. Exemplarily, if the average brightness in a sub-area among the multiple sub-areas is high, it may mean that there are fingerprint lines in the sub-area, so a relatively low threshold can be selected for segmentation to ensure that the fingerprint area can be effectively extracted; and for the sub-area with a low average brightness, it may be a background area, so a higher threshold can be selected for segmentation to reduce the interference of the background. Through this method of partitioned image threshold segmentation, the unevenness of the light source can be handled more flexibly, and the accuracy and stability of subsequent fingerprint area extraction can be improved.

步骤S3002F:分区图像合并。Step S3002F: Merge partition images.

具体地,在进行分区图像阈值分割之后,需要对分割后的各个区域进行合并,以得到整体的指纹区域。假设对上述目标区域的灰度图像的分区为3×3和4×4(即多个灰度图像一一对应的分区),可以将3×3或4×4的网格中的共有连通区域进行合并,以将分区图像中相邻的指纹区域合并为更大的连通区域,从而得到更完整的指纹区域。Specifically, after performing the threshold segmentation of the partitioned image, it is necessary to merge the segmented regions to obtain the overall fingerprint region. Assuming that the grayscale image of the target area is partitioned into 3×3 and 4×4 (i.e., multiple grayscale images are partitioned one by one), the common connected regions in the 3×3 or 4×4 grids can be merged to merge adjacent fingerprint regions in the partitioned image into a larger connected region, thereby obtaining a more complete fingerprint region.

步骤S3002G:指纹连通区域判断。Step S3002G: Fingerprint connected area determination.

具体地,在分区图像合并之后,可以对合并后的指纹区域进行连通区域判断,以确保提取的指纹区域连续性。示例性地,系统可以对合并后的指纹区域进行连通区域判断,识别并保留连通的指纹区域,从而剔除不连通的部分。例如,系统会检测合并后的指纹区域中是否存在断裂或不连续的部分,并将这些部分剔除,从而确保最终提取的指纹区域是连续的,并提高提取出的指纹区域的连续性和清晰度。Specifically, after the partition images are merged, the merged fingerprint area can be judged for connected areas to ensure the continuity of the extracted fingerprint area. Exemplarily, the system can judge the connected areas of the merged fingerprint area, identify and retain the connected fingerprint area, and then remove the disconnected parts. For example, the system will detect whether there are broken or discontinuous parts in the merged fingerprint area, and remove these parts, so as to ensure that the final extracted fingerprint area is continuous and improve the continuity and clarity of the extracted fingerprint area.

步骤S3002H:非指纹区域直接剔除。Step S3002H: directly remove non-fingerprint areas.

具体地,在进行指纹连通区域判断之后,系统会直接剔除非指纹区域,以减少后续处理的计算量和提高处理效率。示例性地,假设在指纹连通区域判断的过程中,系统识别出了一些与指纹不连通的区域,将剔除上述不连通的区域,仅保留与指纹连通的部分(即指纹区域)。综上,本申请实施例中,可以通过对目标区域的灰度图像进行自适应分区得到多个子区域,并基于目标区域的灰度图像中每个子区域内的光源情况确定阈值,以及对每个子区域进行共有连通区域合并,以确定指纹区域,大大地减少了光源不均匀带来的误差影响,从而提高了壳体指纹残留测试方案的客观性和结果的准确性。Specifically, after the fingerprint connected area judgment is performed, the system will directly eliminate the non-fingerprint area to reduce the amount of calculation for subsequent processing and improve processing efficiency. For example, assuming that in the process of fingerprint connected area judgment, the system has identified some areas that are not connected to the fingerprint, the above-mentioned unconnected areas will be eliminated, and only the part connected to the fingerprint (ie, the fingerprint area) will be retained. In summary, in the embodiment of the present application, multiple sub-areas can be obtained by adaptively partitioning the grayscale image of the target area, and a threshold can be determined based on the light source conditions in each sub-area in the grayscale image of the target area, and the common connected areas of each sub-area can be merged to determine the fingerprint area, which greatly reduces the error caused by the uneven light source, thereby improving the objectivity of the shell fingerprint residue test scheme and the accuracy of the results.

步骤S3003:直接计算指纹区域的面积。Step S3003: directly calculating the area of the fingerprint region.

步骤S3004:将指纹位置放入原图分别计算RGB通道的指纹对比度。Step S3004: Place the fingerprint position into the original image and calculate the fingerprint contrast of the RGB channels respectively.

上述步骤S3001、步骤S3003和步骤S3004中的具体描述可以参见前述图2B中步骤S2001、步骤S2003和步骤S2004对应的实施例,步骤S3002A、步骤S3002C和步骤S3002D可以参见步骤S2002A-步骤S2002C对应的实施例,此处不再赘述。The specific descriptions of the above-mentioned steps S3001, S3003 and S3004 can refer to the embodiments corresponding to steps S2001, S2003 and S2004 in the aforementioned Figure 2B, and the specific descriptions of steps S3002A, S3002C and S3002D can refer to the embodiments corresponding to steps S2002A-S2002C, which will not be repeated here.

场景三:光源均匀,且已去除均匀背景的场景。Scene 3: The light source is uniform and the uniform background has been removed.

具体地,可参见图4A,图4A为本申请实施例中提供的一种图像灰度计算场景三的流程图,该流程可以包括以下步骤S4001-步骤S4004。Specifically, please refer to Figure 4A, which is a flowchart of an image grayscale calculation scenario three provided in an embodiment of the present application. The process may include the following steps S4001-S4004.

步骤S4001:指纹图像拍摄输入。Step S4001: Fingerprint image capture and input.

步骤S4002:感兴趣区域(Region of Interest,RIO)提取。Step S4002: Region of Interest (RIO) extraction.

具体地,在获取指纹图像后,可以通过对指纹图像进行RIO区域提取,从指纹图像中提取出目标区域、以及目标区域中采集有指纹纹路的指纹区域,其中,步骤S4002中可以包括以下步骤S4002A-步骤S4002E。Specifically, after acquiring the fingerprint image, the target area and the fingerprint area with fingerprint patterns collected in the target area can be extracted from the fingerprint image by performing RIO area extraction on the fingerprint image, wherein step S4002 can include the following steps S4002A-S4002E.

步骤S4002A:图像灰度计算。Step S4002A: Image grayscale calculation.

步骤S4002B:图像滤波。Step S4002B: Image filtering.

步骤S4002C:去除均匀背景,基于连通区域的重心集中度剔除噪声。Step S4002C: remove the uniform background and eliminate the noise based on the centroid concentration of the connected area.

具体地,在通过图像滤波对目标区域的灰度图像进行初步噪声剔除后,可以通过提取灰度图像中均匀的背景区域,并在去除该均匀的背景区域后得到前景区域,根据前景区域中的连通区域重心集中度判断指纹区域的位置,并将不在指纹区域的大块噪声进行剔除。示例性地,在通过图像滤波对灰度图像进行初步噪声剔除后,系统可以通过识别灰度图像中具有均匀灰度值的背景区域确定均匀背景区域,该均匀背景区域不包含指纹特征,且灰度值变化较小;当系统提取完均匀背景区域后,系统可以通过将这些背景区域从图像中去除,得到前景区域,其中,该前景区域中可以包括指纹特征及其他可能的干扰信息(例如更深层的噪声);进一步地,系统可以识别前景区域中的所有连通区域(指的是图像中相邻且具有相似灰度值的像素块),并计算每个连通区域的重心位置(即该区域中所有像素点的位置平均值),并基于重心位置的分布情况判断指纹区域的位置,如系统检测到连通区域的重心位置集中在灰度图像中的某一区域中,则判断该区域为指纹区域;或者,如果系统检测到连通区域的重心位置(即欧式距离)分散于整张图片,则系统可以判断该区域内无显著指纹特征,可能为噪声区域;在确定指纹区域和噪声区域后,系统可以将不在指纹区域的大块噪声进行剔除(例如可以通过标记并移除那些重心位置分散且面积较大的连通区域,以清理图像中的噪声),使处理后得到的前景区域更为纯净,指纹特征更加明显,便于后续的特征提取和识别。可参见图4B,图4B为本申请实施例中提供的一种均匀背景提取示意图,图4B中可包括目标区域示意图04-A、反相图像04-B、滤波图像04-C、均匀背景提取图像04-D和二值化指纹区域04-E,如目标区域示意图04-A所示,该目标区域示意图04-A为从指纹图像中截取的目标区域的图像,因为该目标区域示意图04-A的可见痕迹较低,无法准确的判断壳体指纹残留性能,因此可以通过将该目标区域示意图04-A进行反相计算,即由目标区域示意图04-A转换为反相图像04-B,该反相图像04-B中的像素信息和指纹纹路信息变得清晰可见;进一步地,系统可以通过对该反相图像04-B进行图像滤波和形态学处理(即上述步骤S4002B和步骤S4002D),减少反相图像04-B中的噪声,得到滤波图像04-C,系统可以通过识别滤波图像04-C中具有均匀灰度值的背景区域以确定均匀背景区域,并去除该均匀背景区域得到前景区域;进一步地,系统可以根据上述前景区域中的连通区域重心集中度判断指纹区域的位置,并将不在指纹区域的大块噪声进行剔除,以得到指纹特征更清晰的灰度图像,即均匀背景提取图像04-D,该均匀背景提取图像04-D中的白色噪声减少,且指纹纹路所在区域更加清晰,最后可以通过对均匀背景提取图像04-D进行二值化处理(即下述步骤S4002E),以得到二值化指纹区域04-E,该二值化指纹区域04-E中已去除噪声和背景区域,仅包括从目标区域的图像中提取出的指纹区域。Specifically, after performing preliminary noise removal on the grayscale image of the target area through image filtering, the uniform background area in the grayscale image can be extracted, and the foreground area can be obtained after removing the uniform background area. The position of the fingerprint area is determined according to the concentration of the center of gravity of the connected area in the foreground area, and the large block of noise that is not in the fingerprint area is removed. Exemplarily, after performing preliminary noise removal on the grayscale image through image filtering, the system can determine the uniform background area by identifying the background area with uniform grayscale value in the grayscale image, and the uniform background area does not contain fingerprint features and the grayscale value changes slightly; when the system extracts the uniform background area, the system can remove these background areas from the image to obtain the foreground area, wherein the foreground area may include fingerprint features and other possible interference information (such as deeper noise); further, the system can identify all connected areas in the foreground area (referring to adjacent pixel blocks with similar grayscale values in the image), and calculate the center of gravity position of each connected area (that is, the average position of all pixel points in the area) ), and judge the position of the fingerprint area based on the distribution of the centroid position. If the system detects that the centroid position of the connected area is concentrated in a certain area in the grayscale image, then the area is judged to be the fingerprint area; or, if the system detects that the centroid position (i.e., Euclidean distance) of the connected area is scattered throughout the entire image, then the system can judge that there is no significant fingerprint feature in the area and it may be a noise area; after determining the fingerprint area and the noise area, the system can remove large blocks of noise that are not in the fingerprint area (for example, by marking and removing those connected areas with scattered centroid positions and large areas to clean up the noise in the image), so that the foreground area obtained after processing is purer and the fingerprint features are more obvious, which is convenient for subsequent feature extraction and recognition. Please refer to Figure 4B, which is a schematic diagram of uniform background extraction provided in an embodiment of the present application. Figure 4B may include a target area schematic diagram 04-A, an inverted image 04-B, a filtered image 04-C, a uniform background extraction image 04-D and a binary fingerprint area 04-E. As shown in the target area schematic diagram 04-A, the target area schematic diagram 04-A is an image of the target area intercepted from the fingerprint image. Because the visible trace of the target area schematic diagram 04-A is low, it is impossible to accurately judge the fingerprint residual performance of the shell. Therefore, the target area schematic diagram 04-A can be inverted by calculation, that is, the target area schematic diagram 04-A is converted into an inverted image 04-B, and the pixel information and fingerprint pattern information in the inverted image 04-B become clearly visible; further, the system can filter and morphologically process the inverted image 04-B (that is, the above-mentioned steps S4002B and S4002B). 02D), reduce the noise in the inverted image 04-B to obtain the filtered image 04-C. The system can determine the uniform background area by identifying the background area with uniform grayscale value in the filtered image 04-C, and remove the uniform background area to obtain the foreground area; further, the system can judge the position of the fingerprint area according to the concentration of the center of gravity of the connected area in the foreground area, and remove the large block of noise that is not in the fingerprint area to obtain a grayscale image with clearer fingerprint features, that is, the uniform background extraction image 04-D. The white noise in the uniform background extraction image 04-D is reduced, and the area where the fingerprint pattern is located is clearer. Finally, the uniform background extraction image 04-D can be binarized (that is, the following step S4002E) to obtain a binary fingerprint area 04-E, in which the noise and background area have been removed and only the fingerprint area extracted from the image of the target area is included.

步骤S4002D:数学形态学计算。Step S4002D: mathematical morphology calculation.

步骤S4002E:自适应OSTU二值化提取指纹位置。Step S4002E: Adaptively perform OSTU binarization to extract fingerprint positions.

步骤S4003:直接计算指纹区域的面积。Step S4003: directly calculating the area of the fingerprint region.

步骤S4004:将指纹位置放入原图分别计算RGB通道的指纹对比度。Step S4004: Place the fingerprint position into the original image and calculate the fingerprint contrast of the RGB channels respectively.

上述步骤S4001、步骤S4003和步骤S4004中的具体描述可以参见前述图2B中步骤S2001、步骤S2003和步骤S2004对应的实施例,步骤S4002A-步骤S4002E中除步骤S4002C之外的步骤可以参见步骤S2002A-步骤S2002D对应的实施例,此处不再赘述。The specific descriptions of the above-mentioned steps S4001, S4003 and S4004 can refer to the embodiments corresponding to steps S2001, S2003 and S2004 in Figure 2B above, and the steps in steps S4002A-S4002E except step S4002C can refer to the embodiments corresponding to steps S2002A-S2002D, which will not be repeated here.

场景四:光源不均匀,且已去除均匀背景的场景。Scene 4: The light source is uneven and the uniform background has been removed.

具体地,可参见图5A,图5A为本申请实施例中提供的一种图像灰度计算场景四的流程图,该流程可以包括以下步骤S5001-步骤S5004。Specifically, please refer to Figure 5A, which is a flowchart of an image grayscale calculation scenario four provided in an embodiment of the present application. The process may include the following steps S5001-S5004.

步骤S5001:指纹图像拍摄输入。Step S5001: Fingerprint image capture and input.

具体地,获取指纹图像,指纹图像即针对目标壳体表面上的指纹进行拍摄得到的指纹图像。不同壳体对应的指纹图像可以为通过相同的拍摄条件拍摄所得到的图像,例如相同的拍摄光源、拍摄手法、拍摄设备等条件,可以在后续对比不同壳体的指纹残留性能差异时得到更客观、更准确的对比结果,避免了因为拍摄条件不同导致的数据异常等影响。Specifically, a fingerprint image is obtained, which is a fingerprint image obtained by photographing the fingerprint on the surface of the target shell. The fingerprint images corresponding to different shells can be images obtained by photographing under the same shooting conditions, such as the same shooting light source, shooting technique, shooting equipment and other conditions, so that a more objective and accurate comparison result can be obtained when comparing the fingerprint residual performance differences of different shells in the subsequent comparison, avoiding the influence of data anomalies caused by different shooting conditions.

步骤S5002:感兴趣区域(Region of Interest,RIO)提取。Step S5002: extracting the region of interest (RIO).

具体地,在获取指纹图像后,可以通过对指纹图像进行RIO区域提取,从指纹图像中提取出目标区域、以及目标区域中采集有指纹纹路的指纹区域,其中,步骤S5002中可以包括以下步骤S5002A-步骤S5002I。Specifically, after acquiring the fingerprint image, the target area and the fingerprint area with fingerprint patterns collected in the target area can be extracted from the fingerprint image by performing RIO area extraction on the fingerprint image, wherein step S5002 can include the following steps S5002A-S5002I.

步骤S5002A:图像灰度计算。Step S5002A: Image grayscale calculation.

具体地,图像灰度计算用于将目标区域的图像由彩色图像转换为灰度图像,上述多个灰度图像仅包含亮度信息,去除了色彩信息。示例性地,灰度计算可以采用加权平均法,即根据图像的RGB三个通道的亮度值计算灰度值,例如该灰度计算公式可以为:灰度值= 0.299R + 0.587G + 0.114*B,该灰度计算公式为根据人眼对不同颜色的可见程度加权计算得出,使目标区域的图像中每个像素的RGB通道信息(通常由红、绿、蓝三个通道组成)被合成为一个灰度值,并基于该灰度值将目标区域的图像转换为仅包括灰度信息的灰度图像。Specifically, the image grayscale calculation is used to convert the image of the target area from a color image to a grayscale image, and the above-mentioned multiple grayscale images only contain brightness information and remove color information. Exemplarily, the grayscale calculation can adopt a weighted average method, that is, the grayscale value is calculated according to the brightness values of the three RGB channels of the image. For example, the grayscale calculation formula can be: grayscale value = 0.299 R + 0.587 G + 0.114*B. The grayscale calculation formula is obtained by weighted calculation based on the visibility of different colors to the human eye, so that the RGB channel information (usually composed of three channels of red, green, and blue) of each pixel in the image of the target area is synthesized into a grayscale value, and based on the grayscale value, the image of the target area is converted into a grayscale image including only grayscale information.

步骤S5002B:目标区域的图像自适应分区。Step S5002B: adaptively partition the image of the target area.

具体地,当检测到目标区域的灰度图像光源不均匀时,系统可以根据目标区域的灰度图像的面积和光源情况,将图像自适应划分为多个子区域,以更好地适应图像的局部特征。Specifically, when it is detected that the light source of the grayscale image of the target area is uneven, the system can adaptively divide the image into multiple sub-areas according to the area and light source conditions of the grayscale image of the target area to better adapt to the local characteristics of the image.

步骤S5002C:图像滤波。Step S5002C: Image filtering.

具体地,在将目标区域的灰度图像进行自适应分区为多个子区域后,可以通过log-Gabor滤波器和/或中值滤波等图像滤波对多个子区域进行去噪处理,以初步减少图像中的干扰和噪声,并提高指纹纹路的清晰度和连续性。Specifically, after the grayscale image of the target area is adaptively partitioned into multiple sub-areas, the multiple sub-areas can be denoised by image filtering such as log-Gabor filter and/or median filter to preliminarily reduce interference and noise in the image and improve the clarity and continuity of the fingerprint lines.

步骤S5002D:去除均匀背景,基于连通区域的重心集中度剔除噪声。Step S5002D: remove the uniform background and eliminate the noise based on the centroid concentration of the connected area.

具体地,在通过图像滤波对目标区域的灰度图像中的多个子区域进行初步噪声剔除后,可以通过提取每个子区域中均匀的背景区域,并在去除该均匀的背景区域后得到前景区域,根据前景区域中的连通区域重心集中度判断指纹区域的位置,并将不在指纹区域的大块噪声进行剔除,以实现对上述多个灰度图像中的噪声的二次剔除。Specifically, after preliminary noise removal is performed on multiple sub-regions in the grayscale image of the target area through image filtering, a uniform background region can be extracted from each sub-region, and the foreground region can be obtained after removing the uniform background region. The position of the fingerprint region is determined according to the concentration of the center of gravity of the connected regions in the foreground region, and large blocks of noise that are not in the fingerprint region are removed, so as to achieve secondary noise removal in the above-mentioned multiple grayscale images.

步骤S5002E:数学形态学计算。Step S5002E: mathematical morphology calculation.

具体地,在通过图像滤波的初步噪声剔除和基于连通区域的重心集中度深度剔除噪声后,系统可以对去噪处理后的每个子区域进行腐蚀、膨胀、开运算和闭运算等等形态学处理(即数学形态学计算),从而提高上述目标区域的灰度图像中的多个子区域的连续性和清晰度,并进一步强化图像中的指纹特征。Specifically, after preliminary noise removal through image filtering and deep noise removal based on the centroid concentration of connected areas, the system can perform morphological processing (i.e., mathematical morphological calculations) such as corrosion, dilation, opening and closing operations on each sub-area after denoising, thereby improving the continuity and clarity of multiple sub-areas in the grayscale image of the above-mentioned target area, and further strengthening the fingerprint features in the image.

步骤S5002F:分区图像阈值分割。Step S5002F: Partition image threshold segmentation.

具体地,在对目标区域进行图像灰度计算、自适应分区、图像滤波去噪处理和数学形态学计算后,可以得到灰度计算和去噪处理后的多个子区域,并针对每个子区域分别计算其平均亮度,以及基于各个子区域的平均亮度差异设置适当的阈值,最后通过该阈值进行二值化处理,以更加灵活地处理光源不均匀性情况,并提高后续指纹区域的提取准确度和稳定性。Specifically, after performing image grayscale calculation, adaptive partitioning, image filtering and denoising processing, and mathematical morphology calculation on the target area, multiple sub-regions after grayscale calculation and denoising processing can be obtained, and the average brightness of each sub-region is calculated respectively, and an appropriate threshold is set based on the average brightness difference of each sub-region. Finally, binarization processing is performed using the threshold to more flexibly handle the non-uniformity of the light source and improve the accuracy and stability of subsequent fingerprint area extraction.

步骤S5002G:分区图像合并。Step S5002G: Merge partition images.

具体地,在进行分区图像阈值分割之后,需要对分割后的各个区域进行合并,以得到整体的指纹区域。假设对上述目标区域的灰度图像的自适应分区为3×3和4×4(即多个子区域),可以将3×3或4×4的网格中的共有连通区域进行合并,以将分区图像中相邻的指纹区域合并为更大的连通区域,从而得到更完整的指纹区域。Specifically, after performing the threshold segmentation of the partitioned image, the segmented regions need to be merged to obtain the overall fingerprint region. Assuming that the adaptive partitioning of the grayscale image of the above target area is 3×3 and 4×4 (i.e., multiple sub-regions), the common connected regions in the 3×3 or 4×4 grids can be merged to merge the adjacent fingerprint regions in the partitioned image into a larger connected region, thereby obtaining a more complete fingerprint region.

步骤S5002H:指纹连通区域判断。Step S5002H: Fingerprint connected area determination.

具体地,在分区图像合并之后,可以对合并后的指纹区域进行连通区域判断,以确保提取的指纹区域连续性。Specifically, after the partition images are merged, a connected region judgment may be performed on the merged fingerprint region to ensure the continuity of the extracted fingerprint region.

步骤S5002I:非指纹区域直接剔除。Step S5002I: directly remove non-fingerprint areas.

具体地,在进行指纹连通区域判断之后,系统会直接剔除非指纹区域,只保留与指纹连通的部分(即指纹区域)。此外,也可以通过图像分割或形态学处理等确定目标区域的图像中指纹区域包络,并通过将方差灰度均匀区域中的灰度值设置为0(黑色)或255(白色),以将指纹区域包络之外的非指纹区域去除。Specifically, after determining the fingerprint connected area, the system will directly remove the non-fingerprint area and only retain the part connected to the fingerprint (i.e., the fingerprint area). In addition, the fingerprint area envelope in the image of the target area can be determined by image segmentation or morphological processing, and the grayscale value in the variance grayscale uniform area can be set to 0 (black) or 255 (white) to remove the non-fingerprint area outside the fingerprint area envelope.

步骤S5003:直接计算指纹区域的面积。Step S5003: directly calculating the area of the fingerprint region.

具体地,本申请实施例中可以基于步骤S5002中提取的二值化指纹区域(即指纹位置)计算得出指纹区域的面积,并将指纹区域的面积作为残留指纹面积输出。示例性地,系统首先对二值化后的指纹区域进行扫描,因为在二值化的指纹区域图像中,黑色像素代表指纹纹路,所以通过统计指纹区域中所有黑色像素的数量,即可得到指纹区域的面积。Specifically, in the embodiment of the present application, the area of the fingerprint region can be calculated based on the binary fingerprint region (i.e., fingerprint position) extracted in step S5002, and the area of the fingerprint region is output as the residual fingerprint area. For example, the system first scans the binary fingerprint region, because in the binary fingerprint region image, black pixels represent fingerprint lines, so the area of the fingerprint region can be obtained by counting the number of all black pixels in the fingerprint region.

步骤S5004:将指纹位置放入原图分别计算RGB通道的指纹对比度。Step S5004: Place the fingerprint position into the original image and calculate the fingerprint contrast of the RGB channels respectively.

具体地,可以通过将步骤S5002中提取的指纹位置放入目标区域的图像(即步骤S5002中的目标区域的图像)中,计算指纹区域与目标区域的RGB通道值的对比度,并输出RGB三个通道的指纹残留对比度。Specifically, the fingerprint position extracted in step S5002 can be placed in the image of the target area (i.e., the image of the target area in step S5002), the contrast between the RGB channel values of the fingerprint area and the target area can be calculated, and the fingerprint residual contrast of the three RGB channels can be output.

上述步骤S5001-步骤S5004中的实施例描述为初步描述,具体描述可以参见前述图2B-图4A中对应的实施例,此处不再赘述。The embodiment descriptions in the above steps S5001 to S5004 are preliminary descriptions. For detailed descriptions, please refer to the corresponding embodiments in the above-mentioned Figures 2B to 4A, which will not be repeated here.

(二)图像转灰度计算以及背景提取202。(ii) Image conversion to grayscale and background extraction 202.

场景一:光源均匀,且未去除均匀背景的场景。Scene 1: The light source is uniform and the uniform background is not removed.

具体地,可参见图6A,图6A为本申请实施例中提供的一种图像转灰度计算以及背景提取场景一的流程图,该流程可以包括以下步骤S6001-步骤S6004。Specifically, please refer to Figure 6A, which is a flowchart of an image to grayscale calculation and background extraction scenario 1 provided in an embodiment of the present application. The process may include the following steps S6001-S6004.

步骤S6001:指纹图像拍摄输入。Step S6001: Fingerprint image capture and input.

具体地,获取指纹图像,指纹图像即针对目标壳体表面上的指纹进行拍摄得到的指纹图像。不同壳体对应的指纹图像可以为通过相同的拍摄条件拍摄所得到的图像,例如相同的拍摄光源、拍摄手法、拍摄设备等条件,可以在后续对比不同壳体的指纹残留性能差异时得到更客观、更准确的对比结果,避免了因为拍摄条件不同导致的数据异常等影响。Specifically, a fingerprint image is obtained, which is a fingerprint image obtained by photographing the fingerprint on the surface of the target shell. The fingerprint images corresponding to different shells can be images obtained by photographing under the same shooting conditions, such as the same shooting light source, shooting technique, shooting equipment and other conditions, so that a more objective and accurate comparison result can be obtained when comparing the fingerprint residual performance differences of different shells in the subsequent comparison, avoiding the influence of data anomalies caused by different shooting conditions.

步骤S6002:感兴趣区域(Region of Interest,RIO)提取。Step S6002: Region of Interest (RIO) extraction.

具体地,在获取指纹图像后,可以通过对指纹图像进行RIO区域提取,从指纹图像中提取出目标区域、以及目标区域中采集有指纹纹路的指纹区域,其中,步骤S6002中可以包括以下步骤S6002A-步骤S6002D。Specifically, after acquiring the fingerprint image, the target area and the fingerprint area with fingerprint patterns collected in the target area can be extracted from the fingerprint image by performing RIO area extraction on the fingerprint image, wherein step S6002 can include the following steps S6002A-S6002D.

步骤S6002A:图像转灰度计算。Step S6002A: image conversion to grayscale calculation.

具体地,图像灰度计算用于将目标区域的图像由彩色图像转换为灰度图像,该灰度图像仅包含亮度信息,去除了色彩信息。示例性地,灰度计算可以采用加权平均法,即根据图像的RGB三个通道的亮度值计算灰度值,例如该灰度计算公式可以为:灰度值 =0.299R + 0.587G + 0.114*B,该灰度计算公式为根据人眼对不同颜色的可见程度加权计算得出,使目标区域的图像中每个像素的RGB通道信息(通常由红、绿、蓝三个通道组成)被合成为一个灰度值,并基于该灰度值将目标区域的图像转换为仅包括灰度信息的灰度图像,转换后的灰度图像中仅包括有颜色信息转换的灰度信息,使灰度图像可以反映原彩色图像的亮度分布,上述灰度计算公式仅为一种可能的实施方式,也可以为其他实施方式,本申请实施例中不作限定。其中,在进行步骤S6002A的图像转灰度计算时,还可以包括步骤S6002A1。Specifically, the image grayscale calculation is used to convert the image of the target area from a color image to a grayscale image, which only contains brightness information and removes color information. Exemplarily, the grayscale calculation can use a weighted average method, that is, the grayscale value is calculated according to the brightness values of the three RGB channels of the image. For example, the grayscale calculation formula can be: grayscale value = 0.299 R + 0.587 G + 0.114*B. The grayscale calculation formula is obtained by weighted calculation based on the visibility of different colors to the human eye, so that the RGB channel information (usually composed of three channels of red, green, and blue) of each pixel in the image of the target area is synthesized into a grayscale value, and based on the grayscale value, the image of the target area is converted into a grayscale image including only grayscale information. The converted grayscale image only includes grayscale information converted from color information, so that the grayscale image can reflect the brightness distribution of the original color image. The above grayscale calculation formula is only a possible implementation method, and other implementation methods can also be used, which is not limited in the embodiments of the present application. When performing the image-to-grayscale calculation in step S6002A, step S6002A1 may also be included.

步骤S6002A1:背景提取。Step S6002A1: Background extraction.

具体地,若在比较相同材质的壳体时,由于壳体的颜色差异较小,因此可以通过对上述灰度图像进行背景提取,从而确定更多的灰度信息,以更准确地提取和分析指纹特征。示例性地,本申请实施例中在对目标区域的图像进行图像转灰度计算得到灰度图像后,可以通过分析灰度值的分布和变化来识别背景区域,例如系统可以采用直方图分析的方法来确定背景区域的灰度值范围,通过统计图像中各个灰度值的频率,找到占据较大比例且变化较小的灰度值区间,并将这些区间确定为背景区域;进一步地,系统可以对该灰度图像进行阈值分割,以区分背景区域和前景区域,例如系统可以基于上述灰度图像中的像素信息或亮度信息选择一个或多个阈值,并将灰度值低于阈值的像素点确定为背景区域;在阈值分割完成后,系统可以标记并去除识别出的背景区域,使得在后续的图像处理过程中,可以简化数据处理过程,且突出相同材质的壳体的对比度,并提高图像处理的准确性和效率。Specifically, if the shells of the same material are compared, since the color difference of the shells is small, more grayscale information can be determined by performing background extraction on the grayscale image to more accurately extract and analyze fingerprint features. Exemplarily, in the embodiment of the present application, after the image of the target area is converted to grayscale to obtain a grayscale image, the background area can be identified by analyzing the distribution and change of the grayscale value. For example, the system can use a histogram analysis method to determine the grayscale value range of the background area, and by counting the frequency of each grayscale value in the image, find the grayscale value interval that occupies a large proportion and has a small change, and determine these intervals as the background area; further, the system can perform threshold segmentation on the grayscale image to distinguish the background area from the foreground area. For example, the system can select one or more thresholds based on the pixel information or brightness information in the grayscale image, and determine the pixel points with grayscale values below the threshold as the background area; after the threshold segmentation is completed, the system can mark and remove the identified background area, so that in the subsequent image processing process, the data processing process can be simplified, and the contrast of the shells of the same material can be highlighted, and the accuracy and efficiency of image processing can be improved.

步骤S6002B:图像滤波。Step S6002B: Image filtering.

具体地,在将目标区域的图像转换为灰度图像且背景提取之后,可以通过图像滤波对灰度图像进行去噪处理。示例性地,本申请实施例中可以通过log-Gabor滤波器和/或中值滤波对灰度图像进行去噪处理,log-Gabor滤波器用于提取图像中的指纹纹路特征,增强图像中的细节和边缘信息;中值滤波是一种非线性滤波方法,主要用于去除图像中的噪声(例如椒盐噪声),同时保留图像的边缘细节。通过上述图像滤波处理,可以初步减少图像中的干扰和噪声,并提高指纹纹路的清晰度和连续性。Specifically, after the image of the target area is converted into a grayscale image and the background is extracted, the grayscale image can be denoised by image filtering. Exemplarily, in the embodiment of the present application, the grayscale image can be denoised by log-Gabor filter and/or median filter. The log-Gabor filter is used to extract the fingerprint pattern features in the image and enhance the details and edge information in the image; the median filter is a nonlinear filtering method, which is mainly used to remove noise (such as salt and pepper noise) in the image while retaining the edge details of the image. Through the above-mentioned image filtering process, the interference and noise in the image can be preliminarily reduced, and the clarity and continuity of the fingerprint pattern can be improved.

步骤S6002C:数学形态学计算。Step S6002C: mathematical morphology calculation.

具体地,在通过图像滤波对灰度图像进行去噪处理后,可以对去噪处理后的灰度图像进行形态学处理(即数学形态学计算),形态学处理可以包括腐蚀、膨胀、开运算和闭运算等。示例性地,在本申请实施例中可以通过膨胀操作来填充去噪处理后的灰度图像中的指纹纹路中的空洞,使其更加完整;同时,利用闭运算可以消除指纹纹路中的小孔或断裂,从而提高灰度图像的连续性和清晰度,进一步强化图像中的指纹特征,上述数学形态学计算仅为一种可能的实施方式,也可以为其他实施方式,本申请实施例中不作限定。Specifically, after the grayscale image is denoised by image filtering, the denoised grayscale image can be subjected to morphological processing (i.e., mathematical morphological calculation), and the morphological processing can include corrosion, expansion, opening operation, closing operation, etc. For example, in the embodiment of the present application, the holes in the fingerprint lines in the denoised grayscale image can be filled by the expansion operation to make it more complete; at the same time, the small holes or breaks in the fingerprint lines can be eliminated by the closing operation, thereby improving the continuity and clarity of the grayscale image and further strengthening the fingerprint features in the image. The above-mentioned mathematical morphological calculation is only one possible implementation method, and other implementation methods can also be used, which are not limited in the embodiment of the present application.

步骤S6002D:自适应OSTU二值化提取指纹位置。Step S6002D: Adaptively perform OSTU binarization to extract fingerprint position.

具体地,在灰度图像经过图像滤波处理和数学形态学计算后,系统可以采用自适应OSTU二值化提取灰度图像中的指纹位置(即指纹区域)。自适应OSTU二值化为一种基于灰度直方图的自动阈值选取技术,其原理是通过最大化类间方差来确定最佳分割阈值,从而将图像分割为前景(指纹图案)和背景两部分,该方法不仅能够适应不同图像的灰度分布特点,还能够根据局部区域的特性进行灵活调整,因此能够更加准确地提取出指纹的位置信息。在本申请实施例中,自适应 OSTU二值化用于将图像分割为前景和背景两部分,因此输出的是一个只包含黑白两种像素值的图像,黑色(表示背景)和白色(表示前景),即灰度图像将变为二值图像,用于表示物体的存在或缺失。通过自适应OSTU二值化,系统可以动态地调整阈值,以确保在不同区域都能够获得最佳的分割效果,即使在目标区域的图像中存在光照不均匀、噪声干扰等情况下,系统仍能够准确地提取出指纹的位置信息。Specifically, after the grayscale image is processed by image filtering and mathematical morphology calculation, the system can use adaptive OSTU binarization to extract the fingerprint position (i.e., fingerprint area) in the grayscale image. Adaptive OSTU binarization is an automatic threshold selection technology based on grayscale histogram. Its principle is to determine the optimal segmentation threshold by maximizing the inter-class variance, thereby segmenting the image into two parts: foreground (fingerprint pattern) and background. This method can not only adapt to the grayscale distribution characteristics of different images, but also be flexibly adjusted according to the characteristics of the local area, so that the fingerprint location information can be extracted more accurately. In the embodiment of the present application, adaptive OSTU binarization is used to segment the image into two parts: foreground and background, so the output is an image containing only black and white pixel values, black (representing the background) and white (representing the foreground), that is, the grayscale image will become a binary image, which is used to indicate the presence or absence of an object. Through adaptive OSTU binarization, the system can dynamically adjust the threshold to ensure that the best segmentation effect can be obtained in different areas. Even if there is uneven lighting, noise interference, etc. in the image of the target area, the system can still accurately extract the fingerprint location information.

步骤S6003:直接计算指纹区域的面积。Step S6003: directly calculating the area of the fingerprint region.

具体地,本申请实施例中可以基于步骤S6002中提取的二值化指纹区域(即指纹位置)计算得出指纹区域的面积,并将指纹区域的面积作为残留指纹面积输出。示例性地,系统首先对二值化后的指纹区域进行扫描,因为在二值化指纹区域图像中,黑色像素代表指纹纹路,所以通过统计指纹区域中所有黑色像素的数量,即可得到指纹区域的面积,其中,统计方法包括但不限于逐行扫描、逐列扫描、自动化提取算法以及区域生长等算法。此外,在计算指纹区域面积的过程中,因为不同图像的分辨率可能不同,相同面积的指纹区域在不同分辨率的图像中对应的像素数量也不同,因此,在计算面积时,系统可以通过引入图像的分辨率信息进行转换,例如,通过像素密度(每英寸像素数,DPI)将像素面积转换为实际面积,以得到指纹区域的面积。Specifically, in the embodiment of the present application, the area of the fingerprint area can be calculated based on the binary fingerprint area (i.e., fingerprint position) extracted in step S6002, and the area of the fingerprint area is output as the residual fingerprint area. For example, the system first scans the binary fingerprint area. Because in the binary fingerprint area image, black pixels represent fingerprint lines, the area of the fingerprint area can be obtained by counting the number of all black pixels in the fingerprint area, wherein the statistical method includes but is not limited to row-by-row scanning, column-by-column scanning, automatic extraction algorithm, and regional growth algorithm. In addition, in the process of calculating the area of the fingerprint area, because the resolution of different images may be different, the number of pixels corresponding to the fingerprint area of the same area in images of different resolutions is also different. Therefore, when calculating the area, the system can convert by introducing the resolution information of the image, for example, by converting the pixel area to the actual area through the pixel density (pixels per inch, DPI) to obtain the area of the fingerprint area.

步骤S6004:计算指纹区域灰度累计值。Step S6004: Calculate the cumulative grayscale value of the fingerprint area.

具体地,可以通过将步骤S6002中提取的指纹位置放入目标区域的图像(即步骤S6002中的目标区域的图像)中,计算指纹区域与目标区域的灰度值的对比度,并输出灰度值的指纹残留对比度。示例性地,在对相同材质的壳体进行测试时,因为相同材质的壳体通常具有较小的颜色差异,因此通过灰度差异信息可以更准确且更客观的判断不同壳体材质之间指纹残留性能的差异,可以通过对比度公式计算得出上述灰度值的对比度,假设目标区域的整体面积为A,目标区域内指纹区域的面积为B,指纹区域之外的周围区域为A-B;B区域内的平均灰度值为β,A-B区域的平均灰度值为α,一般情况下指纹区域的颜色深度一般大于除指纹区域之外的区域(即B区域的颜色比A-B区域的颜色深),但是深色的灰度统计则是颜色越深代表灰度越低,因此可以把图像整体反相计算,此时β大于α,A大于B。Specifically, the fingerprint position extracted in step S6002 can be placed in the image of the target area (i.e., the image of the target area in step S6002), the contrast between the grayscale values of the fingerprint area and the target area can be calculated, and the fingerprint residual contrast of the grayscale value can be output. Exemplarily, when testing a shell of the same material, because the shells of the same material usually have a small color difference, the difference in fingerprint residual performance between different shell materials can be more accurately and objectively judged through the grayscale difference information, and the contrast of the above grayscale value can be calculated by the contrast formula. Assume that the overall area of the target area is A, the area of the fingerprint area in the target area is B, and the surrounding area outside the fingerprint area is A-B; the average grayscale value in the B area is β, and the average grayscale value in the A-B area is α. In general, the color depth of the fingerprint area is generally greater than that of the area other than the fingerprint area (i.e., the color of the B area is darker than that of the A-B area), but the dark grayscale statistics are that the darker the color, the lower the grayscale, so the image can be inverted as a whole. At this time, β is greater than α, and A is greater than B.

此时计算的对比度指标就可以表示成,B区域的图像灰度值求和比A区域的图像灰度值求和,对比度公式可以表示为:At this time, the calculated contrast index can be expressed as the sum of the image grayscale values in area B is greater than the sum of the image grayscale values in area A. The contrast formula can be expressed as:

首先对该简化公式的单调性分析:First, the monotonicity analysis of the simplified formula is:

(1)当A的面积固定时(真实拍摄照片的时候,也需要使用固定的设备和距离将A面积固定),contrast和B正相关;(1) When the area of A is fixed (when taking photos in real life, the area of A also needs to be fixed using fixed equipment and distance), contrast is positively correlated with B;

(2)当A与B(残留面积)固定时,contrast与负相关,β越大,α越小,则越小,整体contrast越大(β与α差异越大,contrast越大(显著对比),同样符合对比度主观含义);(2) When A and B (residual area) are fixed, contrast and Negative correlation, the larger β is, the smaller α is. The smaller it is, the greater the overall contrast (the greater the difference between β and α, the greater the contrast (significant contrast), which also conforms to the subjective meaning of contrast);

其次分析公式中几个变量的影响因素和相关性:Secondly, analyze the influencing factors and correlations of several variables in the formula:

整体面积A:与拍摄设备(device)、拍摄条件(距离L、笔记本厚度d)、框选指纹区域ROI相关。Overall area A: related to the shooting device, shooting conditions (distance L, notebook thickness d), and the selected fingerprint area ROI.

指纹区域面积(脏污区域面积)B:B是自动化提取算法提取的指纹面积,B与指纹算法提取精度相关,B与指纹灰度平均深度β和背景平均灰度深度α相关。Fingerprint area (dirty area) B: B is the fingerprint area extracted by the automatic extraction algorithm. B is related to the fingerprint algorithm extraction accuracy. B is related to the average grayscale depth β of the fingerprint and the average grayscale depth α of the background.

背景平均灰度α和指纹平均深度β:与材质(Material)、拍摄设备(device)、拍摄光源(light-source)、指纹残留情况(condition)相关。Background average grayscale α and fingerprint average depth β: related to material (Material), shooting equipment (device), shooting light source (light-source), and fingerprint residue condition (condition).

最后在特殊情况下,对特殊值分析:Finally, in special cases, special values are analyzed:

假设固定指纹区域检测面积B(能检测出指纹则β>α),若β与α差异越大,则contrast越大。Assume that the fingerprint detection area B is fixed (if the fingerprint can be detected, β>α), the greater the difference between β and α, the greater the contrast.

场景二:光源不均匀,且未去除均匀背景的场景。Scene 2: The light source is uneven and the uniform background is not removed.

具体地,可参见图7A,图7A为本申请实施例中提供的一种图像转灰度计算场景二的流程图,该流程可以包括以下步骤S7001-步骤S7004。Specifically, please refer to Figure 7A, which is a flowchart of an image to grayscale calculation scenario 2 provided in an embodiment of the present application. The process may include the following steps S7001-S7004.

步骤S7001:指纹图像拍摄输入。Step S7001: Fingerprint image capture and input.

步骤S7002:感兴趣区域(Region of Interest,RIO)提取。Step S7002: Region of Interest (RIO) extraction.

具体地,在获取指纹图像后,可以通过对指纹图像进行RIO区域提取,从指纹图像中提取出目标区域、以及目标区域中采集有指纹纹路的指纹区域,其中,步骤S7002中可以包括以下步骤S7002A-步骤S7002H。Specifically, after acquiring the fingerprint image, the target area and the fingerprint area with fingerprint patterns collected in the target area can be extracted from the fingerprint image by performing RIO area extraction on the fingerprint image, wherein step S7002 can include the following steps S7002A-S7002H.

步骤S7002A:图像转灰度计算。Step S7002A: image conversion to grayscale calculation.

步骤S7002A1:背景提取。Step S7002A1: Background extraction.

步骤S7002B:目标区域的图像自适应分区。Step S7002B: adaptively partition the image of the target area.

具体地,当检测到目标区域的图像的光源不均匀时,系统会根据目标区域的图像的特性和光源情况,将图像自适应划分为多个区域,以更好地适应图像的局部特征。示例性地,若检测到目标区域的图像中出现了不同程度的不均匀反光,按正常步骤计算可能会对指纹区域的计算结果有影响,因此当检测到目标区域的图像出现中心区域亮度高于目标区域等光源不均匀情况时,系统可以通过将目标区域的图像按照3×3和/或4×4的网格进行分区,以更精准地对每个区域进行处理,从而提高目标区域的图像处理的准确性,最大限度地减少处理误差。Specifically, when the light source of the image of the target area is detected to be uneven, the system will adaptively divide the image into multiple areas according to the characteristics of the image of the target area and the light source conditions to better adapt to the local characteristics of the image. For example, if the image of the target area is detected to have uneven reflections of varying degrees, the calculation according to the normal steps may affect the calculation results of the fingerprint area. Therefore, when the image of the target area is detected to have uneven light sources such as the central area being brighter than the target area, the system can partition the image of the target area according to a 3×3 and/or 4×4 grid to process each area more accurately, thereby improving the accuracy of the image processing of the target area and minimizing the processing error.

步骤S7002C:图像滤波。Step S7002C: Image filtering.

步骤S7002D:数学形态学计算。Step S7002D: mathematical morphology calculation.

步骤S7002E:分区图像阈值分割。Step S7002E: Partition image threshold segmentation.

具体地,在对目标区域的图像进行图像灰度计算、自适应分区、图像滤波去噪处理和数学形态学计算后,可以得到目标区域的灰度图像中的多个子区域,可以针对每个子区域分别计算其平均亮度,并基于各个子区域的平均亮度差异设置适当的阈值,基于该阈值可以将子区域中的像素分为两类:高于阈值的像素点被归为指纹特征,而低于阈值的像素点被归为背景;通过上述二值化处理的阈值分割可以更准确地从目标区域的图像中提取出指纹区域。示例性地,如果多个子区域中的某个子区域内的平均亮度较高,可能意味着该子区域中存在指纹,因此可以选择一个相对较低的阈值进行分割,以确保指纹区域能够被有效提取出来;而对于平均亮度较低的区域,则可能是背景区域,因此可以选择一个较高的阈值进行分割,以减少背景的干扰,通过这种分区图像阈值分割的方法,可以更加灵活地处理光源不均匀性情况,并提高后续指纹区域的提取准确度和稳定性。Specifically, after the image grayscale calculation, adaptive partitioning, image filtering and denoising processing and mathematical morphology calculation are performed on the image of the target area, multiple sub-areas in the grayscale image of the target area can be obtained, and the average brightness of each sub-area can be calculated respectively, and an appropriate threshold can be set based on the average brightness difference of each sub-area. Based on the threshold, the pixels in the sub-area can be divided into two categories: the pixels above the threshold are classified as fingerprint features, and the pixels below the threshold are classified as background; the fingerprint area can be more accurately extracted from the image of the target area through the threshold segmentation of the above-mentioned binarization processing. Exemplarily, if the average brightness in a sub-area among the multiple sub-areas is high, it may mean that there is a fingerprint in the sub-area, so a relatively low threshold can be selected for segmentation to ensure that the fingerprint area can be effectively extracted; and for the area with low average brightness, it may be the background area, so a higher threshold can be selected for segmentation to reduce the interference of the background. Through this method of partitioned image threshold segmentation, the light source non-uniformity can be handled more flexibly, and the subsequent fingerprint area extraction accuracy and stability can be improved.

步骤S7002F:分区图像合并。Step S7002F: Merge partition images.

具体地,在进行分区图像阈值分割之后,需要对分割后的各个区域进行合并,以得到整体的指纹区域。假设对上述目标区域的图像的分区为3×3和4×4(即上述多个子区域),可以将3×3或4×4的网格中的共有连通区域进行合并,以将分区图像中相邻的指纹区域合并为更大的连通区域,从而得到更完整的指纹区域。Specifically, after performing the threshold segmentation of the partitioned image, it is necessary to merge the segmented regions to obtain the overall fingerprint region. Assuming that the image of the target region is partitioned into 3×3 and 4×4 (i.e., the above-mentioned multiple sub-regions), the common connected regions in the 3×3 or 4×4 grids can be merged to merge the adjacent fingerprint regions in the partitioned image into a larger connected region, thereby obtaining a more complete fingerprint region.

步骤S7002G:指纹连通区域判断。Step S7002G: Fingerprint connected area determination.

具体地,在分区图像合并之后,可以对合并后的指纹区域进行连通区域判断,以确保提取的指纹区域连续性。示例性地,系统可以对合并后的指纹区域进行连通区域判断,识别并保留连通的指纹区域,从而剔除不连通的部分。例如,系统会检测合并后的指纹区域中是否存在断裂或不连续的部分,并将这些部分剔除,从而确保最终提取的指纹区域是连续的,并提高提取出的指纹区域的连续性和清晰度。Specifically, after the partition images are merged, the merged fingerprint area can be judged for connected areas to ensure the continuity of the extracted fingerprint area. Exemplarily, the system can judge the connected areas of the merged fingerprint area, identify and retain the connected fingerprint area, and then remove the disconnected parts. For example, the system will detect whether there are broken or discontinuous parts in the merged fingerprint area, and remove these parts, so as to ensure that the final extracted fingerprint area is continuous and improve the continuity and clarity of the extracted fingerprint area.

步骤S7002H:非指纹区域直接剔除。Step S7002H: directly remove non-fingerprint areas.

具体地,在进行指纹连通区域判断之后,系统会直接剔除非指纹区域,以减少后续处理的计算量和提高处理效率。示例性地,假设在指纹连通区域判断的过程中,系统识别出了一些与指纹不连通的区域,将剔除上述不连通的区域,仅保留与指纹连通的部分(即指纹区域)。综上,本申请实施例中,可以通过对目标区域的灰度图像进行自适应分区得到多个子区域,并基于每个子区域内的光源情况确定阈值,以及对每个子区域进行共有连通区域合并,以确定指纹区域,大大地减少了光源不均匀带来的误差影响,从而提高了壳体指纹残留测试方案的客观性和结果的准确性。此外,也可以通过图像分割或形态学处理等确定目标区域的图像中指纹区域包络,并通过将方差灰度均匀区域中的灰度值设置为0(黑色)或255(白色),以将指纹区域包络之外的非指纹区域去除。Specifically, after the fingerprint connected area judgment is performed, the system will directly eliminate the non-fingerprint area to reduce the amount of calculation for subsequent processing and improve processing efficiency. For example, assuming that in the process of fingerprint connected area judgment, the system identifies some areas that are not connected to the fingerprint, the above-mentioned unconnected areas will be eliminated, and only the part connected to the fingerprint (i.e., the fingerprint area) will be retained. In summary, in the embodiment of the present application, multiple sub-areas can be obtained by adaptively partitioning the grayscale image of the target area, and a threshold is determined based on the light source situation in each sub-area, and the common connected area of each sub-area is merged to determine the fingerprint area, which greatly reduces the error effect caused by the uneven light source, thereby improving the objectivity of the shell fingerprint residue test scheme and the accuracy of the results. In addition, the fingerprint area envelope in the image of the target area can also be determined by image segmentation or morphological processing, and the non-fingerprint area outside the fingerprint area envelope can be removed by setting the grayscale value in the variance grayscale uniform area to 0 (black) or 255 (white).

步骤S7003:直接计算指纹区域的面积。Step S7003: directly calculate the area of the fingerprint region.

步骤S7004:计算指纹区域灰度累计值。Step S7004: Calculate the cumulative grayscale value of the fingerprint area.

上述步骤S7001、步骤S7003和步骤S7004中的具体描述可以参见前述图6A中步骤S6001、步骤S6003和步骤S6004对应的实施例,步骤S7002A、步骤S7002C和步骤S7002D可以参见步骤S6002A-步骤S6002C对应的实施例,此处不再赘述。For the specific descriptions of the above-mentioned steps S7001, S7003 and S7004, please refer to the embodiments corresponding to steps S6001, S6003 and S6004 in Figure 6A above. For steps S7002A, S7002C and S7002D, please refer to the embodiments corresponding to steps S6002A-S6002C, which will not be repeated here.

场景三:光源均匀,且已去除均匀背景的场景。Scene 3: The light source is uniform and the uniform background has been removed.

具体地,可参见图8A,图8A为本申请实施例中提供的一种图像转灰度计算场景三的流程图,该流程可以包括以下步骤S8001-步骤S8004。Specifically, please refer to Figure 8A, which is a flowchart of an image to grayscale calculation scenario three provided in an embodiment of the present application. The process may include the following steps S8001-S8004.

步骤S8001:指纹图像拍摄输入。Step S8001: Fingerprint image capture and input.

步骤S8002:感兴趣区域(Region of Interest,RIO)提取。Step S8002: Region of Interest (RIO) extraction.

具体地,在获取指纹图像后,可以通过对指纹图像进行RIO区域提取,从指纹图像中提取出目标区域、以及目标区域中采集有指纹纹路的指纹区域,其中,步骤S8002中可以包括以下步骤S8002A-步骤S8002E。Specifically, after acquiring the fingerprint image, the target area and the fingerprint area with fingerprint patterns collected in the target area can be extracted from the fingerprint image by performing RIO area extraction on the fingerprint image, wherein step S8002 can include the following steps S8002A-S8002E.

步骤S8002A:图像转灰度计算。Step S8002A: image conversion to grayscale calculation.

步骤S8002A1:背景提取。Step S8002A1: Background extraction.

步骤S8002B:图像滤波。Step S8002B: Image filtering.

步骤S8002C:去除均匀背景,基于连通区域的重心集中度剔除噪声。Step S8002C: remove the uniform background and eliminate the noise based on the centroid concentration of the connected area.

具体地,在通过图像滤波对目标区域的灰度图像进行初步噪声剔除后,可以通过提取灰度图像中均匀的背景区域,并在去除该均匀的背景区域后得到前景区域,根据前景区域中的连通区域重心集中度判断指纹区域的位置,并将不在指纹区域的大块噪声进行剔除。示例性地,在通过图像滤波对灰度图像进行初步噪声剔除后,系统可以通过识别灰度图像中具有均匀灰度值的背景区域确定均匀背景区域,该均匀背景区域不包含指纹特征,且灰度值变化较小;当系统提取完均匀背景区域后,系统可以通过将这些背景区域从图像中去除,得到前景区域,其中,该前景区域中可以包括指纹特征及其他可能的干扰信息(例如更深层的噪声);进一步地,系统可以识别前景区域中的所有连通区域(指的是图像中相邻且具有相似灰度值的像素块),并计算每个连通区域的重心位置(即该区域中所有像素点的位置平均值),并基于重心位置的分布情况判断指纹区域的位置,如系统检测到连通区域的重心位置集中在灰度图像中的某一区域中,则判断该区域为指纹区域;或者,如果系统检测到连通区域的重心位置(即欧式距离)分散于整张图片,则系统可以判断该区域内无显著指纹特征,可能为噪声区域;在确定指纹区域和噪声区域后,系统可以将不在指纹区域的大块噪声进行剔除(例如可以通过标记并移除那些重心位置分散且面积较大的连通区域,以清理图像中的噪声),使处理后得到的前景区域更为纯净,指纹特征更加明显,便于后续的特征提取和识别。Specifically, after performing preliminary noise removal on the grayscale image of the target area through image filtering, the uniform background area in the grayscale image can be extracted, and the foreground area can be obtained after removing the uniform background area. The position of the fingerprint area is determined according to the concentration of the center of gravity of the connected area in the foreground area, and the large block of noise that is not in the fingerprint area is removed. Exemplarily, after performing preliminary noise removal on the grayscale image through image filtering, the system can determine the uniform background area by identifying the background area with uniform grayscale value in the grayscale image, and the uniform background area does not contain fingerprint features and the grayscale value changes slightly; when the system extracts the uniform background area, the system can remove these background areas from the image to obtain the foreground area, wherein the foreground area may include fingerprint features and other possible interference information (such as deeper noise); further, the system can identify all connected areas in the foreground area (referring to adjacent pixel blocks with similar grayscale values in the image), and calculate the center of gravity position of each connected area (that is, the average position of all pixel points in the area) ), and judge the position of the fingerprint area based on the distribution of the centroid position. If the system detects that the centroid position of the connected area is concentrated in a certain area in the grayscale image, then the area is judged to be the fingerprint area; or, if the system detects that the centroid position (i.e., Euclidean distance) of the connected area is scattered throughout the entire image, then the system can judge that there is no significant fingerprint feature in the area and it may be a noise area; after determining the fingerprint area and the noise area, the system can remove large blocks of noise that are not in the fingerprint area (for example, by marking and removing those connected areas with scattered centroid positions and large areas to clean up the noise in the image), so that the foreground area obtained after processing is purer and the fingerprint features are more obvious, which is convenient for subsequent feature extraction and recognition.

步骤S8002D:数学形态学计算。Step S8002D: mathematical morphology calculation.

步骤S8002E:自适应OSTU二值化提取指纹位置。Step S8002E: Adaptively perform OSTU binarization to extract fingerprint positions.

步骤S8003:直接计算指纹区域的面积。Step S8003: directly calculating the area of the fingerprint region.

步骤S8004:计算指纹区域灰度累计值。Step S8004: Calculate the cumulative grayscale value of the fingerprint area.

上述步骤S8001、步骤S8003和步骤S8004中的具体描述可以参见前述图6A中步骤S6001、步骤S6003和步骤S6004对应的实施例,步骤S8002A-步骤S8002E中除步骤S8002C之外的步骤可以参见步骤S6002A-步骤S6002D对应的实施例,此处不再赘述。For the specific descriptions of the above-mentioned steps S8001, S8003 and S8004, please refer to the embodiments corresponding to steps S6001, S6003 and S6004 in Figure 6A above. For the steps in steps S8002A-S8002E except step S8002C, please refer to the embodiments corresponding to steps S6002A-S6002D, which will not be repeated here.

场景四:光源不均匀,且已去除均匀背景的场景。Scene 4: The light source is uneven and the uniform background has been removed.

具体地,可参见图9A,图9A为本申请实施例中提供的一种图像灰度计算场景四的流程图,该流程可以包括以下步骤S9001-步骤S9004。Specifically, please refer to Figure 9A, which is a flowchart of an image grayscale calculation scenario four provided in an embodiment of the present application. The process may include the following steps S9001-S9004.

步骤S9001:指纹图像拍摄输入。Step S9001: Fingerprint image capture and input.

具体地,获取指纹图像,指纹图像即针对目标壳体表面上的指纹进行拍摄得到的指纹图像。不同壳体对应的指纹图像可以为通过相同的拍摄条件拍摄所得到的图像,例如相同的拍摄光源、拍摄手法、拍摄设备等条件,可以在后续对比不同壳体的指纹残留性能差异时得到更客观、更准确的对比结果,避免了因为拍摄条件不同导致的数据异常等影响。Specifically, a fingerprint image is obtained, which is a fingerprint image obtained by photographing the fingerprint on the surface of the target shell. The fingerprint images corresponding to different shells can be images obtained by photographing under the same shooting conditions, such as the same shooting light source, shooting technique, shooting equipment and other conditions, so that a more objective and accurate comparison result can be obtained when comparing the fingerprint residual performance differences of different shells in the subsequent comparison, avoiding the influence of data anomalies caused by different shooting conditions.

步骤S9002:感兴趣区域(Region of Interest,RIO)提取。Step S9002: Region of Interest (RIO) extraction.

具体地,在获取指纹图像后,可以通过对指纹图像进行RIO区域提取,从指纹图像中提取出目标区域、以及目标区域中采集有指纹纹路的指纹区域,其中,步骤S9002中可以包括以下步骤S9002A-步骤S9002I。Specifically, after acquiring the fingerprint image, the target area and the fingerprint area with fingerprint patterns collected in the target area can be extracted from the fingerprint image by performing RIO area extraction on the fingerprint image, wherein step S9002 can include the following steps S9002A-S9002I.

步骤S9002A:图像转灰度计算。Step S9002A: image conversion to grayscale calculation.

具体地,图像灰度计算用于将目标区域的图像由彩色图像转换为灰度图像,上述灰度图像中仅包含亮度信息,去除了色彩信息。示例性地,灰度计算可以采用加权平均法,即根据图像的RGB三个通道的亮度值计算灰度值,例如该灰度计算公式可以为:灰度值 =0.299R + 0.587G + 0.114*B,该灰度计算公式为根据人眼对不同颜色的可见程度加权计算得出,使目标区域的图像中每个像素的RGB通道信息(通常由红、绿、蓝三个通道组成)被合成为一个灰度值,并基于该灰度值将目标区域的图像转换为仅包括灰度信息的灰度图像。Specifically, the image grayscale calculation is used to convert the image of the target area from a color image to a grayscale image, which only contains brightness information and removes color information. Exemplarily, the grayscale calculation can use a weighted average method, that is, the grayscale value is calculated based on the brightness values of the three RGB channels of the image. For example, the grayscale calculation formula can be: grayscale value = 0.299 R + 0.587 G + 0.114*B. The grayscale calculation formula is obtained by weighted calculation based on the visibility of different colors to the human eye, so that the RGB channel information (usually composed of three channels of red, green, and blue) of each pixel in the image of the target area is synthesized into a grayscale value, and based on the grayscale value, the image of the target area is converted into a grayscale image that only includes grayscale information.

步骤S9002A1:背景提取。Step S9002A1: Background extraction.

具体地,若在比较相同材质的壳体时,由于壳体的颜色差异较小,因此可以通过对上述灰度图像进行背景提取,从而确定更多的灰度信息,以更准确地提取和分析指纹特征。Specifically, when comparing shells of the same material, since the color difference of the shells is small, more grayscale information can be determined by performing background extraction on the grayscale image, so as to more accurately extract and analyze fingerprint features.

步骤S9002B:目标区域的图像自适应分区。Step S9002B: adaptively partition the image of the target area.

具体地,当检测到目标区域的灰度图像的光源不均匀时,系统会根据该灰度图像的特性和光源情况,将上述灰度图像自适应划分为多个子区域。Specifically, when it is detected that the light source of the grayscale image of the target area is uneven, the system will adaptively divide the grayscale image into a plurality of sub-areas according to the characteristics of the grayscale image and the light source conditions.

步骤S9002C:图像滤波。Step S9002C: Image filtering.

具体地,在对目标区域的灰度图像进行自适应分区得到多个子区域后,可以通过log-Gabor滤波器和/或中值滤波等图像滤波对多个子区域进行去噪处理,以初步减少灰度图像中的干扰和噪声,并提高指纹纹路的清晰度和连续性。Specifically, after adaptively partitioning the grayscale image of the target area to obtain multiple sub-regions, the multiple sub-regions can be denoised by image filtering such as log-Gabor filter and/or median filter to preliminarily reduce interference and noise in the grayscale image and improve the clarity and continuity of the fingerprint lines.

步骤S9002D:去除均匀背景,基于连通区域的重心集中度剔除噪声。Step S9002D: remove the uniform background and eliminate the noise based on the centroid concentration of the connected area.

具体地,在通过图像滤波对多个子区域进行初步噪声剔除后,可以通过提取每个子区域中均匀的背景区域,并在去除该均匀的背景区域后得到前景区域,根据前景区域中的连通区域重心集中度判断指纹区域的位置,并将不在指纹区域的大块噪声进行剔除,以实现对上述多个灰度图像中的噪声的二次剔除。Specifically, after preliminary noise removal of multiple sub-regions through image filtering, a uniform background region can be extracted from each sub-region, and the foreground region can be obtained after removing the uniform background region. The position of the fingerprint region can be determined according to the concentration of the center of gravity of the connected regions in the foreground region, and large blocks of noise that are not in the fingerprint region can be removed, so as to achieve secondary noise removal in the above-mentioned multiple grayscale images.

步骤S9002E:数学形态学计算。Step S9002E: mathematical morphology calculation.

具体地,在通过图像滤波的初步噪声剔除和基于连通区域的重心集中度深度剔除噪声后,系统可以对去噪处理后的多个子区域进行腐蚀、膨胀、开运算和闭运算等等形态学处理(即数学形态学计算),从而提高上述多个灰度图像的连续性和清晰度,并进一步强化图像中的指纹特征。Specifically, after preliminary noise removal through image filtering and deep noise removal based on the centroid concentration of connected areas, the system can perform morphological processing (i.e., mathematical morphological calculations) such as corrosion, dilation, opening and closing operations on the multiple sub-areas after denoising, thereby improving the continuity and clarity of the above-mentioned multiple grayscale images and further strengthening the fingerprint features in the image.

步骤S9002F:分区图像阈值分割。Step S9002F: Partition image threshold segmentation.

具体地,在对目标区域的图像进行图像灰度计算、自适应分区、图像滤波去噪处理和数学形态学计算后,可以得到目标区域的灰度图像中的多个子区域,通过针对每个子区域分别计算其平均亮度,并基于各个灰度图像的平均亮度差异设置适当的阈值,最后基于该阈值进行二值化处理,以更加灵活地处理光源不均匀性情况,并提高后续指纹区域的提取准确度和稳定性。Specifically, after performing image grayscale calculation, adaptive partitioning, image filtering and denoising processing, and mathematical morphology calculation on the image of the target area, multiple sub-regions in the grayscale image of the target area can be obtained. The average brightness of each sub-region is calculated separately, and an appropriate threshold is set based on the average brightness difference of each grayscale image. Finally, binarization processing is performed based on the threshold to more flexibly handle the non-uniformity of the light source and improve the accuracy and stability of subsequent fingerprint area extraction.

步骤S9002G:分区图像合并。Step S9002G: Merge partition images.

具体地,在进行分区图像阈值分割之后,需要对分割后的各个区域进行合并,以得到整体的指纹区域。假设对上述目标区域的灰度图像的分区为3×3和4×4(即多个灰度图像一一对应的分区),可以将3×3或4×4的网格中的共有连通区域进行合并,以将分区图像中相邻的指纹区域合并为更大的连通区域,从而得到更完整的指纹区域。Specifically, after performing the threshold segmentation of the partitioned image, it is necessary to merge the segmented regions to obtain the overall fingerprint region. Assuming that the grayscale image of the target area is partitioned into 3×3 and 4×4 (i.e., multiple grayscale images are partitioned one by one), the common connected regions in the 3×3 or 4×4 grids can be merged to merge adjacent fingerprint regions in the partitioned image into a larger connected region, thereby obtaining a more complete fingerprint region.

步骤S9002H:指纹连通区域判断。Step S9002H: Fingerprint connected area determination.

具体地,在分区图像合并之后,可以对合并后的指纹区域进行连通区域判断,以确保提取的指纹区域连续性。Specifically, after the partition images are merged, a connected region judgment may be performed on the merged fingerprint region to ensure the continuity of the extracted fingerprint region.

步骤S9002I:非指纹区域直接剔除。Step S9002I: directly remove non-fingerprint areas.

具体地,在进行指纹连通区域判断之后,系统会直接剔除非指纹区域,只保留与指纹连通的部分(即指纹区域)。此外,也可以通过图像分割或形态学处理等确定目标区域的图像中指纹区域包络,并通过将方差灰度均匀区域中的灰度值设置为0(黑色)或255(白色),以将指纹区域包络之外的非指纹区域去除。Specifically, after determining the fingerprint connected area, the system will directly remove the non-fingerprint area and only retain the part connected to the fingerprint (i.e., the fingerprint area). In addition, the fingerprint area envelope in the image of the target area can be determined by image segmentation or morphological processing, and the grayscale value in the variance grayscale uniform area can be set to 0 (black) or 255 (white) to remove the non-fingerprint area outside the fingerprint area envelope.

步骤S9003:直接计算指纹区域的面积。Step S9003: directly calculating the area of the fingerprint region.

具体地,本申请实施例中可以基于步骤S9002中提取的二值化指纹区域(即指纹位置)计算得出指纹区域的面积,并将指纹区域的面积作为残留指纹面积输出。示例性地,系统首先对二值化后的指纹区域进行扫描,因为在指纹区域像中,黑色像素代表指纹纹路,所以通过统计指纹区域中所有黑色像素的数量,即可得到指纹区域的面积。Specifically, in the embodiment of the present application, the area of the fingerprint region can be calculated based on the binary fingerprint region (i.e., fingerprint position) extracted in step S9002, and the area of the fingerprint region is output as the residual fingerprint area. For example, the system first scans the binary fingerprint region, because in the fingerprint region image, black pixels represent fingerprint lines, so the area of the fingerprint region can be obtained by counting the number of all black pixels in the fingerprint region.

步骤S9004:计算指纹区域灰度累计值。Step S9004: Calculate the cumulative grayscale value of the fingerprint area.

具体地,可以通过将步骤S9002中提取的指纹位置放入原始目标区域的图像(即步骤S9002中的目标区域的图像)中,计算指纹区域与目标区域的灰度值的对比度,并输出RGB三个通道的指纹残留对比度。Specifically, the fingerprint position extracted in step S9002 can be placed in the image of the original target area (ie, the image of the target area in step S9002), the contrast between the grayscale values of the fingerprint area and the target area can be calculated, and the fingerprint residual contrast of the three RGB channels can be output.

上述步骤S9001-步骤S9004中的实施例描述为初步描述,具体描述可以参见前述图6A-图8A中对应的实施例描述,此处不再赘述。The embodiment descriptions in the above steps S9001 to S9004 are preliminary descriptions. For detailed descriptions, please refer to the corresponding embodiment descriptions in the above-mentioned Figures 6A to 8A, which will not be repeated here.

上述详细阐述了本申请实施例的方法,下面提供了本申请实施例的相关装置。The above describes in detail the method of the embodiment of the present application, and the following provides the related device of the embodiment of the present application.

请参见图10,图10是本申请实施例提供的一种壳体指纹残留的检测装置的结构示意图,该壳体指纹残留的检测装置1000可以包括获取指纹图像单元1001、确定指纹区域单元1002、确定对比度单元1003和判断指纹残留性能单元1004,其中,各个单元的详细描述如下。Please refer to Figure 10, which is a structural schematic diagram of a detection device for fingerprint residue on a shell provided in an embodiment of the present application. The detection device 1000 for fingerprint residue on a shell may include a fingerprint image acquisition unit 1001, a fingerprint area determination unit 1002, a contrast determination unit 1003 and a fingerprint residue performance judgment unit 1004, wherein each unit is described in detail as follows.

获取指纹图像单元1001,用于获取指纹图像,所述指纹图像为针对目标壳体表面上的指纹进行拍摄得到的图像;The fingerprint image acquisition unit 1001 is used to acquire a fingerprint image, where the fingerprint image is an image obtained by photographing the fingerprint on the surface of the target housing;

确定指纹区域单元1002,用于对所述指纹图像进行图像处理,确定所述指纹图像中的目标区域、以及所述目标区域中采集有指纹纹路的指纹区域;A fingerprint area determination unit 1002 is used to perform image processing on the fingerprint image to determine a target area in the fingerprint image and a fingerprint area in the target area where fingerprint lines are collected;

在一种可能的实现方式中,所述确定指纹区域单元1002,具体用于:In a possible implementation, the fingerprint area determination unit 1002 is specifically configured to:

基于所述指纹图像的拍摄参数确定所述目标区域;Determining the target area based on shooting parameters of the fingerprint image;

将所述目标区域的图像转化为第一灰度图像;Converting the image of the target area into a first grayscale image;

对所述第一灰度图像进行图像特征增强处理,得到第二灰度图像;Performing image feature enhancement processing on the first grayscale image to obtain a second grayscale image;

对所述第二灰度图像进行二值化处理,以确定所述目标区域中符合指纹特征的指纹区域。The second grayscale image is binarized to determine a fingerprint region in the target region that meets the fingerprint feature.

在一种可能的实现方式中,所述确定指纹区域单元1002,具体用于:In a possible implementation, the fingerprint area determination unit 1002 is specifically configured to:

基于所述指纹图像的拍摄参数确定所述目标区域;Determining the target area based on shooting parameters of the fingerprint image;

将所述目标区域的图像转换为第三灰度图像;Converting the image of the target area into a third grayscale image;

基于拍摄光源和所述第三灰度图像的面积对所述第三灰度图像进行分区处理,得到多个子区域;Performing partition processing on the third grayscale image based on the shooting light source and the area of the third grayscale image to obtain a plurality of sub-areas;

对所述第三灰度图像中的每个子区域分别进行图像特征增强处理,得到第四灰度图像;Performing image feature enhancement processing on each sub-region in the third grayscale image to obtain a fourth grayscale image;

通过对所述第四灰度图像进行二值化处理,并将二值化处理后所述第四灰度图像中的每个子区域共有的连通区域进行合并,以确定所述指纹区域。The fingerprint region is determined by binarizing the fourth grayscale image and merging the connected regions shared by each subregion in the fourth grayscale image after the binarization process.

在一种可能的实现方式中,所述确定指纹区域单元1002,具体用于:In a possible implementation, the fingerprint area determination unit 1002 is specifically configured to:

基于拍摄参数确定所述目标区域;determining the target area based on shooting parameters;

将所述目标区域的图像转化为第一灰度图像;Converting the image of the target area into a first grayscale image;

从所述第一灰度图像中提取出背景区域,将所述第一灰度图像中的所述背景区域去除;Extracting a background area from the first grayscale image, and removing the background area from the first grayscale image;

对去除背景区域后的第一灰度图像进行图像特征增强处理,得到第二灰度图像;Performing image feature enhancement processing on the first grayscale image after removing the background area to obtain a second grayscale image;

对所述第二灰度图像进行二值化处理,以确定所述目标区域中符合指纹特征的指纹区域。在一种可能的实现方式中,所述确定指纹区域单元1002,具体用于:The second grayscale image is binarized to determine a fingerprint region in the target region that meets the fingerprint feature. In a possible implementation, the fingerprint region determination unit 1002 is specifically configured to:

基于拍摄参数确定所述目标区域;determining the target area based on shooting parameters;

将所述目标区域的图像转换为第三灰度图像;Converting the image of the target area into a third grayscale image;

基于拍摄光源和所述第三灰度图像的面积对所述第三灰度图像进行分区处理,得到多个子区域;Performing partition processing on the third grayscale image based on the shooting light source and the area of the third grayscale image to obtain a plurality of sub-areas;

从所述第三灰度图像中的每个子区域中提取出背景区域,将所述第三灰度图像中的每个子区域中的所述背景区域去除;Extracting a background region from each sub-region in the third grayscale image, and removing the background region from each sub-region in the third grayscale image;

对去除背景区域后的所述第三灰度图像中的每个子区域分别进行图像特征增强处理,得到第四灰度图像;Performing image feature enhancement processing on each sub-region in the third grayscale image after removing the background region, to obtain a fourth grayscale image;

通过对所述第四灰度图像进行二值化处理,并将二值化处理后所述第四灰度图像中的每个子区域共有的连通区域进行合并,以确定所述指纹区域。The fingerprint region is determined by binarizing the fourth grayscale image and merging the connected regions shared by each subregion in the fourth grayscale image after the binarization process.

在一种可能的实现方式中,所述确定指纹区域单元1002,具体用于:In a possible implementation, the fingerprint area determination unit 1002 is specifically configured to:

通过图像滤波对对应的灰度图像进行去噪处理;De-noising the corresponding grayscale image through image filtering;

对去噪处理后的灰度图像进行形态学处理。Perform morphological processing on the denoised grayscale image.

在一种可能的实现方式中,所述确定指纹区域单元1002,具体用于:In a possible implementation, the fingerprint area determination unit 1002 is specifically configured to:

将去噪处理后的灰度图像中的均匀背景区域去除,以得到前景区域;The uniform background area in the denoised grayscale image is removed to obtain the foreground area;

去除所述前景区域中的周边区域,以得到周边区域去除后的图像;所述均匀背景包括光源均匀和/或纹理均匀,所述周边区域为所述前景区域中除像素值集中的连通区域之外的区域;Removing the peripheral area in the foreground area to obtain an image after the peripheral area is removed; the uniform background includes uniform light source and/or uniform texture, and the peripheral area is an area in the foreground area excluding the connected area where the pixel values are concentrated;

对周边区域去除后的图像进行形态学处理。Morphological processing is performed on the image after the peripheral area is removed.

确定对比度单元1003,基于所述指纹区域的像素信息与所述目标区域的像素信息,确定所述指纹区域与目标区域的对比度;A contrast determination unit 1003, which determines the contrast between the fingerprint area and the target area based on the pixel information of the fingerprint area and the pixel information of the target area;

在一种可能的实现方式中,若所述像素信息包括RGB通道值;所述确定对比度单元1003,具体用于:In a possible implementation, if the pixel information includes RGB channel values, the contrast determination unit 1003 is specifically configured to:

确定所述指纹区域的RGB通道值中的每个通道值之和,和所述目标区域的RGB通道值中的每个通道值之和;Determine the sum of each channel value in the RGB channel values of the fingerprint area and the sum of each channel value in the RGB channel values of the target area;

将所述指纹区域的RGB通道值中的每个通道值之和,与所述目标区域的RGB通道值中的每个通道值之和进行对比,得到每个通道的对比度。The sum of each channel value in the RGB channel values of the fingerprint area is compared with the sum of each channel value in the RGB channel values of the target area to obtain the contrast of each channel.

在一种可能的实现方式中,若所述像素信息包括灰度值;所述确定对比度单元1003,具体用于:In a possible implementation, if the pixel information includes a grayscale value, the contrast determination unit 1003 is specifically configured to:

确定所述指纹区域的灰度值之和和所述目标区域的灰度值之和;Determining the sum of the grayscale values of the fingerprint area and the sum of the grayscale values of the target area;

将所述指纹区域的灰度值之和与所述目标区域的灰度值之和的对比结果确定为所述对比度。A comparison result of the sum of the grayscale values of the fingerprint area and the sum of the grayscale values of the target area is determined as the contrast.

判断指纹残留性能单元1004,基于所述指纹区域的面积和所述对比度,判断所述目标壳体的指纹残留性能。The fingerprint residual performance judging unit 1004 judges the fingerprint residual performance of the target housing based on the area of the fingerprint region and the contrast.

在一种可能的实现方式中,所述判断指纹残留性能单元1004,具体用于:In a possible implementation, the fingerprint residual performance determination unit 1004 is specifically configured to:

若所述指纹区域的面积小于预设面积、且所述对比度小于预设对比度,则判断所述目标壳体的指纹残留度低。If the area of the fingerprint region is smaller than the preset area, and the contrast is smaller than the preset contrast, it is determined that the fingerprint residue of the target housing is low.

为了便于理解本申请实施例,下面先介绍本申请实施例中提供的示例性电子设备。To facilitate understanding of the embodiments of the present application, an exemplary electronic device provided in the embodiments of the present application is first introduced below.

请参见图11,图11是本申请实施例提供的一种电子设备的硬件结构示意图,该电子设备100可以为各种类型的电子设备,本申请实施例对其具体类型不作限制。例如,该电子设备100例如可以是手机,还可以包括平板电脑、桌面型计算机、具有触敏表面或触控面板的台式计算机、膝上型计算机(laptop)、手持计算机、笔记本电脑、智慧屏、可穿戴式设备(如智能手表、智能手环等)、增强现实(augmented reality,AR)设备、虚拟现实(virtualreality,VR)设备、人工智能(artificial intelligence,AI)设备、车机,游戏机,还可以是物联网(internet of things,IOT)设备等等。请参见图11,下面结合图11对电子设备100的各个构成部件进行具体的介绍:Please refer to Figure 11, which is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. The electronic device 100 can be various types of electronic devices, and the embodiment of the present application does not limit its specific type. For example, the electronic device 100 can be a mobile phone, and can also include a tablet computer, a desktop computer, a desktop computer with a touch-sensitive surface or a touch panel, a laptop computer (laptop), a handheld computer, a notebook computer, a smart screen, a wearable device (such as a smart watch, a smart bracelet, etc.), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a car machine, a game console, and can also be an Internet of Things (IOT) device, etc. Please refer to Figure 11, and the following is a specific introduction to the various components of the electronic device 100 in conjunction with Figure 11:

电子设备100可以包括处理器101,存储器102,无线通信模块103,移动通信模块104,天线103A,天线104A,电源开关105,传感器模块106,对焦马达107,摄像头108,显示屏109等。其中,传感器模块106可以包括陀螺仪传感器106A,加速度传感器106B,环境光传感器106C,图像传感器106D,距离传感器106E等。其中,无线通信模块103可以包括WLAN通信模块,蓝牙通信模块等。上述多个部分可以通过总线传输数据。The electronic device 100 may include a processor 101, a memory 102, a wireless communication module 103, a mobile communication module 104, an antenna 103A, an antenna 104A, a power switch 105, a sensor module 106, a focus motor 107, a camera 108, a display screen 109, etc. Among them, the sensor module 106 may include a gyroscope sensor 106A, an acceleration sensor 106B, an ambient light sensor 106C, an image sensor 106D, a distance sensor 106E, etc. Among them, the wireless communication module 103 may include a WLAN communication module, a Bluetooth communication module, etc. The above multiple parts can transmit data through a bus.

处理器101可以包括一个或多个处理单元,例如:处理器101可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。本申请实施例中,处理器101负责执行壳体指纹残留的检测中的各种指令,例如当获取到指纹图像(即图1A对应的实施例描述中的指纹图像)后,处理器101可以执行图像处理功能从指纹图像中提取出目标区域、以及目标区域中采集有指纹纹路的指纹区域,并基于该指纹区域确定指纹区域的面积和指纹残留对比度(如指纹图像中指纹区域与目标区域的RGB通道值或灰度值的对比度),以确定壳体的指纹残留性能。The processor 101 may include one or more processing units, for example: the processor 101 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. In the embodiment of the present application, the processor 101 is responsible for executing various instructions in the detection of fingerprint residues on the shell. For example, after obtaining a fingerprint image (i.e., the fingerprint image in the embodiment description corresponding to FIG. 1A), the processor 101 can execute an image processing function to extract a target area from the fingerprint image, and a fingerprint area in the target area where fingerprint lines are collected, and determine the area of the fingerprint area and the fingerprint residue contrast (such as the contrast of the RGB channel value or grayscale value of the fingerprint area and the target area in the fingerprint image) based on the fingerprint area to determine the fingerprint residue performance of the shell.

存储器102可以用于存储计算机可执行程序代码,可执行程序代码可以包括指令。处理器101通过运行存储在存储器102的指令,从而执行电子设备100的各种功能应用以及数据处理。存储器102可以包括存储程序区和存储数据区。具体实现中,存储器102可以包括高速随机存取的存储器,并且也可包括非易失性存储器,例如一个或多个磁盘存储设备、闪存设备或其他非易失性固态存储设备。The memory 102 may be used to store computer executable program codes, and the executable program codes may include instructions. The processor 101 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the memory 102. The memory 102 may include a program storage area and a data storage area. In a specific implementation, the memory 102 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.

电子设备100的无线通信功能可以通过天线103A,天线104A,移动通信模块104,无线通信模块103,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be implemented through the antenna 103A, the antenna 104A, the mobile communication module 104, the wireless communication module 103, the modem processor and the baseband processor.

天线103A和天线104A可以用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。Antenna 103A and antenna 104A can be used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas.

移动通信模块104可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块104可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块104可以由天线104A接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块104还可以对经调制解调处理器调制后的信号放大,经天线104A转为电磁波辐射出去。The mobile communication module 104 can provide solutions for wireless communications including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 104 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 104 can receive electromagnetic waves through the antenna 104A, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 104 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 104A.

调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备输出声音信号,或通过显示屏109显示图像或视频。The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is transmitted to the application processor. The application processor outputs a sound signal through an audio device, or displays an image or video through the display screen 109.

无线通信模块103可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN),蓝牙(bluetooth,BT),全球导航卫星系统(globalnavigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块103可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块103经由天线103A接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器101。无线通信模块103还可以从处理器101接收待发送的信号,对其进行调频,放大,经天线103A转为电磁波辐射出去。本申请实施例中,可以基于无线通信模块103中的蓝牙或其他通信技术接收来自其他设备传入的文件,并在接收文件后基于用户的选择接收、拒绝接收或发送文件到目标应用窗口中。The wireless communication module 103 can provide wireless communication solutions including wireless local area networks (WLAN), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., applied to the electronic device 100. The wireless communication module 103 can be one or more devices integrating at least one communication processing module. The wireless communication module 103 receives electromagnetic waves via the antenna 103A, modulates the frequency of the electromagnetic wave signal and performs filtering processing, and sends the processed signal to the processor 101. The wireless communication module 103 can also receive the signal to be sent from the processor 101, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 103A. In the embodiment of the present application, files transmitted from other devices can be received based on Bluetooth or other communication technologies in the wireless communication module 103, and after receiving the file, the file can be received, refused to be received, or sent to the target application window based on the user's choice.

电源开关105可用于控制电源向电子设备100的供电。The power switch 105 may be used to control the supply of power to the electronic device 100 .

陀螺仪传感器106A可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器106A确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器106A可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器106A检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器106A还可以用于导航,体感游戏场景。The gyro sensor 106A can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 106A. The gyro sensor 106A can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 106A detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 106A can also be used for navigation and somatosensory game scenes.

加速度传感器106B可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,例如,加速度传感器106B可以应用于横竖屏切换,计步器等应用。The acceleration sensor 106B can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device. For example, the acceleration sensor 106B can be applied to applications such as horizontal and vertical screen switching and pedometers.

环境光传感器106C用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏109的亮度。环境光传感器106C也可用于拍照时自动调节白平衡。The ambient light sensor 106C is used to sense the brightness of the ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 109 according to the sensed brightness of the ambient light. The ambient light sensor 106C can also be used to automatically adjust the white balance when taking pictures.

图像传感器106D,又称为感光元件,可以利用光电器件的光电转换功能将感光面上的光像转换为与光像成相应比例关系的电信号。图像传感器可以是电荷耦合器件(charge coupled device,CCD)传感器或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)传感器。示例性地,当按下快门,在固定光源和拍摄手法下,图像传感器106D可以将捕获的光信号转换为电信号,传递给ISP处理,以便进一步进行指纹图像(即图1A对应的实施例描述中的指纹图像)的分析和处理。The image sensor 106D, also known as a photosensitive element, can utilize the photoelectric conversion function of the photoelectric device to convert the light image on the photosensitive surface into an electrical signal that is proportional to the light image. The image sensor can be a charge coupled device (CCD) sensor or a complementary metal-oxide-semiconductor (CMOS) sensor. Exemplarily, when the shutter is pressed, under a fixed light source and shooting technique, the image sensor 106D can convert the captured light signal into an electrical signal and pass it to the ISP for processing, so as to further analyze and process the fingerprint image (i.e., the fingerprint image in the embodiment description corresponding to FIG1A).

距离传感器106E可以用于测量距离。电子设备100可以通过红外或激光测量距离。在一些拍摄场景中,电子设备100可以利用距离传感器106E测距以实现快速对焦。The distance sensor 106E can be used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some shooting scenarios, the electronic device 100 can use the distance sensor 106E to measure the distance to achieve fast focusing.

对焦马达107可用于快速对焦。电子设备100可以通过对焦马达107控制镜片的移动,实现自动对焦。The focus motor 107 can be used for fast focusing. The electronic device 100 can control the movement of the lens through the focus motor 107 to achieve automatic focusing.

电子设备100可以通过ISP,摄像头108,视频编解码器,GPU,显示屏109以及应用处理器等实现拍摄功能。The electronic device 100 can realize the shooting function through the ISP, the camera 108, the video codec, the GPU, the display screen 109 and the application processor.

ISP用于处理摄像头108反馈的指纹图像数据。例如,拍照时,光线通过镜头被传递到图像传感器106D上,光信号转换为电信号,图像传感器106D将所述电信号传递给ISP处理,转化为数字图像信号。ISP还可以对图像的噪点、亮度、颜色进行优化,以确保指纹图像的质量和可识别性。The ISP is used to process the fingerprint image data fed back by the camera 108. For example, when taking a photo, light is transmitted to the image sensor 106D through the lens, and the light signal is converted into an electrical signal. The image sensor 106D transmits the electrical signal to the ISP for processing and converts it into a digital image signal. The ISP can also optimize the noise, brightness, and color of the image to ensure the quality and recognizability of the fingerprint image.

摄像头108可用于捕获残留指纹的静态图像。物体通过镜头生成光学图像投射到图像传感器106D上,图像传感器106D将光信号转换成电信号,传递给ISP转化为数字图像信号,以便进行指纹区域(即图1A对应的实施例描述中的指纹区域)的提取和对比度计算。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头108,N为大于1的正整数。The camera 108 can be used to capture a static image of the residual fingerprint. The object generates an optical image through the lens and projects it onto the image sensor 106D. The image sensor 106D converts the optical signal into an electrical signal and transmits it to the ISP to convert it into a digital image signal so as to extract the fingerprint area (i.e., the fingerprint area in the embodiment description corresponding to FIG. 1A) and calculate the contrast. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 108, where N is a positive integer greater than 1.

视频编解码器用于对数字图像压缩或解压缩。电子设备100可以支持一种或多种图像编解码器。这样,电子设备100代开或保存多种编码格式的图片或视频。The video codec is used to compress or decompress digital images. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can open or save pictures or videos in multiple coding formats.

电子设备100可以通过GPU,显示屏109,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏109和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器101可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 can realize the display function through a GPU, a display screen 109, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 109 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 101 may include one or more GPUs, which execute program instructions to generate or change display information.

显示屏109用于显示图像,视频等。显示屏109包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode的,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏109,N为大于1的正整数。The display screen 109 is used to display images, videos, etc. The display screen 109 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 109, where N is a positive integer greater than 1.

可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

应理解,上述方法实施例中的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。It should be understood that each step in the above method embodiment can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.

本申请还提供一种电子设备,该电子设备可以包括:存储器和处理器。其中,存储器可用于存储计算机程序;处理器可用于调用所述存储器中的计算机程序,以使得该电子设备执行上述任意一个实施例中电子设备侧执行的方法。The present application also provides an electronic device, which may include: a memory and a processor. The memory may be used to store a computer program; the processor may be used to call the computer program in the memory so that the electronic device executes the method executed by the electronic device side in any of the above embodiments.

本申请还提供了一种芯片系统,所述芯片系统包括至少一个处理器,用于实现上述任一个实施例中电子设备侧所涉及的功能。The present application also provides a chip system, which includes at least one processor for implementing the functions involved in the electronic device side in any of the above embodiments.

在一种可能的设计中,所述芯片系统还包括存储器,所述存储器用于保存程序指令和数据,存储器位于处理器之内或处理器之外。In one possible design, the chip system also includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.

该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。The chip system may be composed of the chip, or may include the chip and other discrete devices.

可选地,该芯片系统中的处理器可以为一个或多个。该处理器可以通过硬件实现也可以通过软件实现。当通过硬件实现时,该处理器可以是逻辑电路、集成电路等。当通过软件实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现。Optionally, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

可选地,该芯片系统中的存储器也可以为一个或多个。该存储器可以与处理器集成在一起,也可以和处理器分离设置,本申请实施例并不限定。示例性地,存储器可以是非瞬时性处理器,例如只读存储器ROM,其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请实施例对存储器的类型,以及存储器与处理器的设置方式不作具体限定。Optionally, the memory in the chip system may also be one or more. The memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be arranged on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.

示例性地,该芯片系统可以是现场可编程门阵列(field programmable gatearray,FPGA),可以是专用集成芯片(application specific integrated circuit,ASIC),还可以是系统芯片(system on chip,SoC),还可以是中央处理器,还可以是网络处理器(network processor,NP),还可以是数字信号处理电路(digital signal processor,DSP),还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logic device,PLD)或其他集成芯片。Exemplarily, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processing unit, a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), or other integrated chips.

本申请还提供一种计算机程序产品,所述计算机程序产品包括:计算机程序(也可以称为代码,或指令),当所述计算机程序被运行时,使得计算机执行上述任一个实施例中电子设备侧所执行的方法。The present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which, when executed, enables a computer to execute the method executed by the electronic device side in any of the above embodiments.

本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序(也可以称为代码,或指令)。当所述计算机程序被运行时,使得计算机执行上述任一个实施例中电子设备侧所执行的方法。The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes the method executed by the electronic device side in any of the above embodiments.

本申请的各实施方式可以任意进行组合,以实现不同的技术效果。The various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in this application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。总之,以上所述仅为本申请技术方案的实施例而已,并非用于限定本申请的保护范围。凡根据本申请的揭露,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by a computer program to instruct the relevant hardware to complete the process, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes. In short, the above is only an embodiment of the technical solution of the present application, and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made according to the disclosure of the present application should be included in the scope of protection of the present application.

Claims (22)

1.A method for detecting fingerprint residue of a housing, the method comprising:
Acquiring a fingerprint image, wherein the fingerprint image is an image obtained by shooting a fingerprint on the surface of a target shell;
Performing image processing on the fingerprint image, and determining a target area in the fingerprint image and a fingerprint area with fingerprint lines collected in the target area;
Determining the contrast ratio of the fingerprint region and the target region based on the pixel information of the fingerprint region and the pixel information of the target region;
And judging the fingerprint residual performance of the target shell based on the area of the fingerprint area and the contrast.
2. The method of claim 1, wherein if the pixel information includes RGB channel values; the determining the contrast ratio between the fingerprint region and the target region based on the pixel information of the fingerprint region and the pixel information of the target region includes:
Determining a sum of each of the RGB channel values of the fingerprint region and a sum of each of the RGB channel values of the target region;
and comparing the sum of each channel value in the RGB channel values of the fingerprint area with the sum of each channel value in the RGB channel values of the target area to obtain the contrast of each channel.
3. The method of claim 2, wherein the performing image processing on the fingerprint image to determine a target area in the fingerprint image and a fingerprint area in the target area where fingerprint lines are acquired, comprises:
determining the target area based on shooting parameters of the fingerprint image;
converting the image of the target area into a first gray scale image;
performing image feature enhancement processing on the first gray level image to obtain a second gray level image;
And carrying out binarization processing on the second gray level image to determine a fingerprint area which accords with fingerprint characteristics in the target area.
4. The method of claim 2, wherein the performing image processing on the fingerprint image to determine a target area in the fingerprint image and a fingerprint area in the target area where fingerprint lines are acquired, comprises:
determining the target area based on shooting parameters of the fingerprint image;
converting the image of the target area into a third gray scale image;
partitioning the third gray level image based on the areas of the shooting light source and the third gray level image to obtain a plurality of subareas;
respectively carrying out image characteristic enhancement processing on each sub-region in the third gray level image to obtain a fourth gray level image;
and the fingerprint area is determined by carrying out binarization processing on the fourth gray level image and combining the communication areas shared by each sub-area in the fourth gray level image after the binarization processing.
5. The method of claim 1, wherein if the pixel information includes a gray value; the determining the contrast ratio between the fingerprint region and the target region based on the pixel information of the fingerprint region and the pixel information of the target region includes:
determining a sum of gray values of the fingerprint area and a sum of gray values of the target area;
and determining a comparison result of the sum of the gray values of the fingerprint area and the sum of the gray values of the target area as the contrast.
6. The method of claim 5, wherein the performing image processing on the fingerprint image to determine a target area in the fingerprint image and a fingerprint area in the target area where fingerprint lines are collected, comprises:
determining the target area based on shooting parameters;
converting the image of the target area into a first gray scale image;
extracting a background area from the first gray level image, and removing the background area in the first gray level image;
performing image feature enhancement processing on the first gray level image with the background area removed to obtain a second gray level image;
And carrying out binarization processing on the second gray level image to determine a fingerprint area which accords with fingerprint characteristics in the target area.
7. The method of claim 5, wherein the performing image processing on the fingerprint image to determine a target area in the fingerprint image and a fingerprint area in the target area where fingerprint lines are collected, comprises:
determining the target area based on shooting parameters;
converting the image of the target area into a third gray scale image;
partitioning the third gray level image based on the areas of the shooting light source and the third gray level image to obtain a plurality of subareas;
Extracting a background region from each sub-region in the third gray scale image, and removing the background region in each sub-region in the third gray scale image;
Respectively carrying out image characteristic enhancement processing on each sub-region in the third gray level image after the background region is removed to obtain a fourth gray level image;
and the fingerprint area is determined by carrying out binarization processing on the fourth gray level image and combining the communication areas shared by each sub-area in the fourth gray level image after the binarization processing.
8. The method according to claim 3, 4, 6 or 7, wherein the image feature enhancement processing comprises:
Denoising the corresponding gray level image through image filtering;
And carrying out morphological processing on the gray level image after the denoising processing.
9. The method of claim 8, wherein morphologically processing the denoised grayscale image comprises:
removing the uniform background area in the denoised gray image to obtain a foreground area;
Removing the peripheral area in the foreground area to obtain an image with the peripheral area removed; the uniform background comprises uniform light sources and/or uniform textures, and the peripheral area is an area except for a communication area in which pixel values are concentrated in the foreground area;
and performing morphological processing on the image with the peripheral area removed.
10. The method of any of claims 1-7, wherein the determining fingerprint residual performance of the target housing based on the area of the fingerprint region and the contrast comprises:
And if the area of the fingerprint area is smaller than the preset area and the contrast is smaller than the preset contrast, judging that the fingerprint residue of the target shell is low.
11. A device for detecting fingerprint residue in a housing, the device comprising:
the fingerprint image acquisition unit is used for acquiring a fingerprint image, wherein the fingerprint image is an image obtained by shooting a fingerprint on the surface of the target shell;
The fingerprint area determining unit is used for performing image processing on the fingerprint image, and determining a target area in the fingerprint image and a fingerprint area with fingerprint lines collected in the target area;
a contrast determining unit that determines a contrast of the fingerprint region and the target region based on pixel information of the fingerprint region and pixel information of the target region;
And a fingerprint residual performance judging unit for judging the fingerprint residual performance of the target shell based on the area of the fingerprint area and the contrast.
12. The apparatus of claim 11, wherein if the pixel information includes RGB channel values; the contrast determination unit is specifically configured to:
Determining a sum of each of the RGB channel values of the fingerprint region and a sum of each of the RGB channel values of the target region;
and comparing the sum of each channel value in the RGB channel values of the fingerprint area with the sum of each channel value in the RGB channel values of the target area to obtain the contrast of each channel.
13. The apparatus according to claim 12, wherein the determining fingerprint area unit is specifically configured to:
determining the target area based on shooting parameters of the fingerprint image;
converting the image of the target area into a first gray scale image;
performing image feature enhancement processing on the first gray level image to obtain a second gray level image;
And carrying out binarization processing on the second gray level image to determine a fingerprint area which accords with fingerprint characteristics in the target area.
14. The apparatus according to claim 12, wherein the determining fingerprint area unit is specifically configured to:
determining the target area based on shooting parameters of the fingerprint image;
converting the image of the target area into a third gray scale image;
partitioning the third gray level image based on the areas of the shooting light source and the third gray level image to obtain a plurality of subareas;
respectively carrying out image characteristic enhancement processing on each sub-region in the third gray level image to obtain a fourth gray level image;
and the fingerprint area is determined by carrying out binarization processing on the fourth gray level image and combining the communication areas shared by each sub-area in the fourth gray level image after the binarization processing.
15. The apparatus of claim 11, wherein if the pixel information includes a gray value; the contrast determination unit is specifically configured to:
determining a sum of gray values of the fingerprint area and a sum of gray values of the target area;
and determining a comparison result of the sum of the gray values of the fingerprint area and the sum of the gray values of the target area as the contrast.
16. The apparatus according to claim 15, wherein the determining fingerprint area unit is specifically configured to:
determining the target area based on shooting parameters;
converting the image of the target area into a first gray scale image;
extracting a background area from the first gray level image, and removing the background area in the first gray level image;
performing image feature enhancement processing on the first gray level image with the background area removed to obtain a second gray level image;
And carrying out binarization processing on the second gray level image to determine a fingerprint area which accords with fingerprint characteristics in the target area.
17. The apparatus according to claim 15, wherein the determining fingerprint area unit is specifically configured to:
determining the target area based on shooting parameters;
converting the image of the target area into a third gray scale image;
partitioning the third gray level image based on the areas of the shooting light source and the third gray level image to obtain a plurality of subareas;
Extracting a background region from each sub-region in the third gray scale image, and removing the background region in each sub-region in the third gray scale image;
Respectively carrying out image characteristic enhancement processing on each sub-region in the third gray level image after the background region is removed to obtain a fourth gray level image;
and the fingerprint area is determined by carrying out binarization processing on the fourth gray level image and combining the communication areas shared by each sub-area in the fourth gray level image after the binarization processing.
18. The apparatus according to claim 13, 14, 16 or 17, wherein the determining fingerprint area unit is specifically configured to:
Denoising the corresponding gray level image through image filtering;
And carrying out morphological processing on the gray level image after the denoising processing.
19. The apparatus according to claim 18, wherein the determining fingerprint area unit is specifically configured to:
removing the uniform background area in the denoised gray image to obtain a foreground area;
Removing the peripheral area in the foreground area to obtain an image with the peripheral area removed; the uniform background comprises uniform light sources and/or uniform textures, and the peripheral area is an area except for a communication area in which pixel values are concentrated in the foreground area;
and performing morphological processing on the image with the peripheral area removed.
20. The apparatus according to any one of claims 11-17, wherein the fingerprint residue performance determining unit is specifically configured to:
And if the area of the fingerprint area is smaller than the preset area and the contrast is smaller than the preset contrast, judging that the fingerprint residue of the target shell is low.
21. A computer storage medium, characterized in that the computer storage medium stores a computer program which, when executed by a processor, implements the method according to any of claims 1-10.
22. A computer program comprising instructions which, when executed by a computer, cause the computer to perform the method of any of claims 1-10.
CN202410861975.7A 2024-06-28 2024-06-28 Method and device for detecting fingerprint residues of shell Active CN118397664B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410861975.7A CN118397664B (en) 2024-06-28 2024-06-28 Method and device for detecting fingerprint residues of shell

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410861975.7A CN118397664B (en) 2024-06-28 2024-06-28 Method and device for detecting fingerprint residues of shell

Publications (2)

Publication Number Publication Date
CN118397664A true CN118397664A (en) 2024-07-26
CN118397664B CN118397664B (en) 2024-12-06

Family

ID=91991701

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410861975.7A Active CN118397664B (en) 2024-06-28 2024-06-28 Method and device for detecting fingerprint residues of shell

Country Status (1)

Country Link
CN (1) CN118397664B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119126656A (en) * 2024-11-14 2024-12-13 江苏三变科技有限公司 A laser obstacle removal remote control system for remote obstacle removal of overhead lines

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1564187A (en) * 2004-04-18 2005-01-12 杭州中正生物认证技术有限公司 Checkout of effective fingerprint signal under condition of light interference and identifying method for residual fingerprint
CN101833649A (en) * 2009-03-09 2010-09-15 杭州晟元芯片技术有限公司 Method for discriminating fingerprint residues
CN204331751U (en) * 2015-01-09 2015-05-13 江苏吉菲尔光电科技有限公司 Sapphire fingerprint recognition button
CN109370567A (en) * 2018-12-07 2019-02-22 西南政法大学 A kind of preparation method of silicon ball carbon dots powder and its application in latent fingerprint identification
CN116740771A (en) * 2023-06-26 2023-09-12 江阴邦融微电子有限公司 Fingerprint identification method
EP4287148A1 (en) * 2022-05-30 2023-12-06 By Techdesign S.L. Contactless fingerprint biometric system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1564187A (en) * 2004-04-18 2005-01-12 杭州中正生物认证技术有限公司 Checkout of effective fingerprint signal under condition of light interference and identifying method for residual fingerprint
CN101833649A (en) * 2009-03-09 2010-09-15 杭州晟元芯片技术有限公司 Method for discriminating fingerprint residues
CN204331751U (en) * 2015-01-09 2015-05-13 江苏吉菲尔光电科技有限公司 Sapphire fingerprint recognition button
CN109370567A (en) * 2018-12-07 2019-02-22 西南政法大学 A kind of preparation method of silicon ball carbon dots powder and its application in latent fingerprint identification
EP4287148A1 (en) * 2022-05-30 2023-12-06 By Techdesign S.L. Contactless fingerprint biometric system
CN116740771A (en) * 2023-06-26 2023-09-12 江阴邦融微电子有限公司 Fingerprint identification method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SHUAIHENG HUAI ETAL.: "Multifeature-Based Outdoor Fingerprint Localization With Accuracy Enhancement for Cellular Network", 《IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT》, vol. 72, 6 October 2023 (2023-10-06) *
李鼎睿: "OLED屏下指纹的预处理和识别算法研究与实现", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》, no. 1, 15 January 2023 (2023-01-15), pages 3 - 4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119126656A (en) * 2024-11-14 2024-12-13 江苏三变科技有限公司 A laser obstacle removal remote control system for remote obstacle removal of overhead lines

Also Published As

Publication number Publication date
CN118397664B (en) 2024-12-06

Similar Documents

Publication Publication Date Title
CN106446873B (en) Face detection method and device
CN106650665B (en) Face tracking method and device
US10382712B1 (en) Automatic removal of lens flares from images
US9071745B2 (en) Automatic capturing of documents having preliminarily specified geometric proportions
AU2015315156A1 (en) Systems and methods for liveness analysis
JP6553624B2 (en) Measurement equipment and system
CN113283439B (en) Intelligent counting method, device and system based on image recognition
JP5779089B2 (en) Edge detection apparatus, edge detection program, and edge detection method
CN104540445A (en) Image processing device, image processing method, program, and image processing system
EP2959454A1 (en) Method, system and software module for foreground extraction
US20180232192A1 (en) System and Method for Visual Enhancement, Annotation and Broadcast of Physical Writing Surfaces
JP2008529189A (en) Real-time image detection using polarization data
CN118397664B (en) Method and device for detecting fingerprint residues of shell
JP2018018173A (en) Image processing device, image processing method, and computer program
CN105229665A (en) To the enhancing analysis of the snakelike belt wear assessment based on image
CN112528888A (en) Optical fingerprint acquisition method and device, electronic equipment and storage medium
CN114627561B (en) Dynamic gesture recognition method and device, readable storage medium and electronic equipment
US9536162B2 (en) Method for detecting an invisible mark on a card
CN117994542A (en) Foreign matter detection method, device and system
CN117745552A (en) Self-adaptive image enhancement method and device and electronic equipment
US20210281742A1 (en) Document detections from video images
US11205064B1 (en) Measuring quality of depth images in real time
JP2023061880A (en) Collation device and program
WO2017219562A1 (en) Method and apparatus for generating two-dimensional code
US20240281625A1 (en) Magnetic bead-based detection method, storage medium, and detection device

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Terminal Co.,Ltd.

Country or region after: China

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Patentee before: Honor Device Co.,Ltd.

Country or region before: China