[go: up one dir, main page]

CN114554188A - Mobile phone camera detection method and device based on image sensor pixel array - Google Patents

Mobile phone camera detection method and device based on image sensor pixel array Download PDF

Info

Publication number
CN114554188A
CN114554188A CN202210170072.5A CN202210170072A CN114554188A CN 114554188 A CN114554188 A CN 114554188A CN 202210170072 A CN202210170072 A CN 202210170072A CN 114554188 A CN114554188 A CN 114554188A
Authority
CN
China
Prior art keywords
image
target
detection
area
mobile phone
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.)
Pending
Application number
CN202210170072.5A
Other languages
Chinese (zh)
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.)
Shenzhen Shanhui Technology Co ltd
Original Assignee
Shenzhen Shanhui Technology 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 Shenzhen Shanhui Technology Co ltd filed Critical Shenzhen Shanhui Technology Co ltd
Priority to CN202210170072.5A priority Critical patent/CN114554188A/en
Publication of CN114554188A publication Critical patent/CN114554188A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/002Diagnosis, testing or measuring for television systems or their details for television cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/24Arrangements for testing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Artificial Intelligence (AREA)
  • Quality & Reliability (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Studio Devices (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a mobile phone camera detection method based on an image sensor pixel array, which is characterized in that the characteristics of a target camera area or a gray level step in an image before and after the active irradiation of an external infrared light source are obtained to realize the target detection and obtain an input image, the input image is preprocessed to improve the signal-to-noise ratio of the image, a suspicious target seed point is obtained by using a target segmentation algorithm of a histogram and an image entropy, a complete highlight area is obtained, the discrimination of a suspicious target is screened by discriminating the target through a feature descriptor of the target camera, the repeated detection condition of the target is determined through a detection clustering algorithm, and the detection result is displayed in an RGB color image. Changing the shape of the target mask reduces the accuracy of later stage feature analysis and calculation, affecting the final target decision. The fact that the re-detection targets are necessarily close in physical distance is utilized, the judgment results are clustered, the situation of repeated detection of the targets is eliminated, and the precision and the efficiency of camera detection are improved to a certain extent.

Description

基于图像传感器像素阵列的手机摄像头检测方法及装置Mobile phone camera detection method and device based on image sensor pixel array

技术领域technical field

本发明属于图像处理技术领域,尤其涉及一种基于图像传感器像素阵列的手机摄像头检测方法及装置。The invention belongs to the technical field of image processing, and in particular relates to a mobile phone camera detection method and device based on an image sensor pixel array.

背景技术Background technique

随着智能电子产品终端和汽车电子需求的日益增长,国内的摄像头模组市场需求量逐步增加。前置摄像头的主流配置已达到了800万像素甚至1000万像素的水平,各大手机厂商的手机后置摄像机均配备了自动对焦功能,并且一些厂商已经在尝试将光学变焦功能应用在智能手机上,微型相机模块的自动对焦功能将会大幅度提高对焦效率并减少其占用的空间,为了提升用户拍照时的体验,解决照片的模糊问题,从传动的弹片聚焦马达,闭环聚焦马达逐步转换发展为光学防抖聚焦马达。由于摄像头识别技术主要应用于区分真伪目标,虚警种类多样导致传统的目标识别方法鲁棒性不佳,深度学习的摄像头识别算法需要选取适当的模型以及合理的训练方式,同时需要大量样本集作为输入,而尚无摄像头公开数据集合已训练模型可供使用,降低了摄像头检测的效率和准确性。With the increasing demand for smart electronic product terminals and automotive electronics, the domestic market demand for camera modules has gradually increased. The mainstream configuration of the front camera has reached the level of 8 million pixels or even 10 million pixels. The rear cameras of major mobile phone manufacturers are equipped with autofocus function, and some manufacturers are already trying to apply the optical zoom function to smartphones. , The autofocus function of the micro camera module will greatly improve the focusing efficiency and reduce the space occupied. In order to improve the user's experience when taking pictures and solve the problem of blurred photos, the focus motor is gradually transformed from a driven shrapnel focus motor to a closed-loop focus motor. Optical image stabilization focusing motor. Since the camera recognition technology is mainly used to distinguish true and false targets, the variety of false alarms leads to the poor robustness of traditional target recognition methods. The camera recognition algorithm of deep learning needs to select an appropriate model and a reasonable training method, and also requires a large number of sample sets. As input, there is no camera public dataset trained model available, reducing the efficiency and accuracy of camera detection.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本发明提供了一种基于图像传感器像素阵列的手机摄像头检测方法及装置,解决了批量有效检测和筛选出异常产品的效率,保证产能和准确率,具体采用以下技术方案来实现。In view of this, the present invention provides a mobile phone camera detection method and device based on an image sensor pixel array, which solves the problem of effectively detecting and screening out abnormal products in batches, and ensures productivity and accuracy. The following technical solutions are specifically implemented.

第一方面,本发明提供了一种基于图像传感器像素阵列的手机摄像头检测方法,包括以下步骤:In a first aspect, the present invention provides a mobile phone camera detection method based on an image sensor pixel array, comprising the following steps:

获取外部红外光源主动照射前后图像中目标摄像头区域或灰度阶跃的特点实现目标检测并得到输入图像,其中使用EL-NIR图像与NL-NIR图像作为输入;Obtain the characteristics of the target camera area or grayscale step in the image before and after the active illumination of the external infrared light source to achieve target detection and obtain the input image, in which the EL-NIR image and the NL-NIR image are used as input;

对输入图像进行预处理以提高图像信噪比,使用直方图和图像熵的目标分割算法得到可疑目标种子点;The input image is preprocessed to improve the image signal-to-noise ratio, and the target segmentation algorithm using histogram and image entropy is used to obtain suspicious target seed points;

获取完整高光区域,并通过目标摄像头的特征描述子进行目标判别对可疑目标的判别进行筛选,其中,筛选过程包括对EL-NIR图像与NL-NIR图像进行图像差分获得差分图像实现初步背景抑制,使用形态学滤波提高真实目标在图像中的显著性,通过目标分割获取目标高光区域碎片,使用自适应区域增长获取目标完整高光区域;Obtain the complete highlight area, and use the feature descriptor of the target camera to perform target discrimination to screen suspicious targets. The screening process includes performing image difference between the EL-NIR image and the NL-NIR image to obtain a differential image to achieve preliminary background suppression. Use morphological filtering to improve the saliency of the real target in the image, obtain target highlight area fragments through target segmentation, and use adaptive area growth to obtain the target complete highlight area;

通过检测聚类算法确定目标重复检测情况,将检测结果以RGB彩色图像进行展示。The detection clustering algorithm is used to determine the repeated detection of the target, and the detection results are displayed in RGB color images.

作为上述技术方案的进一步改进,筛选过程包括对EL-NIR图像与NL-NIR图像进行图像差分获得差分图像实现初步背景抑制,包括:As a further improvement of the above technical solution, the screening process includes performing image difference between the EL-NIR image and the NL-NIR image to obtain a differential image to achieve preliminary background suppression, including:

通过将两幅图像的像素值对应相减达到削弱图像的相似部分,突出显示图像变化的部分,差分图像的获取方式包括当前图像与固定背景差分、连续两幅图像之间的差分;The similar parts of the images are weakened by correspondingly subtracting the pixel values of the two images, and the changed parts of the images are highlighted. The acquisition method of the difference image includes the difference between the current image and the fixed background, and the difference between two consecutive images;

经图像差分后获得的表达式为Idif(x,y)=Ip(x,y)-In(x,y),其中ip、In分别为EL-NIR图像与NL-NIR图像,Idif为得到的差分图像,(x,y)为图像对齐进行差分的像素点坐标;The expression obtained after image difference is Idif ( x ,y)= Ip ( x ,y)-In(x,y), where ip and In are EL-NIR image and NL-NIR image respectively , I dif is the obtained differential image, (x, y) is the pixel coordinate of the image alignment for differential;

目标摄像头在红外光照射下所形成的为小尺寸的类圆状光斑,通过分析目标形状特征和灰度分别特征,以提高图像的信噪比,其表达式为

Figure BDA0003517281100000021
其中Idst为经背景抑制算法处理后的背景抑制图像,Idif为差分图像,
Figure BDA0003517281100000022
为膨胀运算,
Figure BDA0003517281100000023
为腐蚀运算,Md为算法中的膨胀结构元素,Me为算法中的腐蚀结构元素。The small-sized circular light spot formed by the target camera under the irradiation of infrared light can improve the signal-to-noise ratio of the image by analyzing the target shape characteristics and grayscale characteristics, and its expression is as follows:
Figure BDA0003517281100000021
where I dst is the background suppression image processed by the background suppression algorithm, and I dif is the difference image,
Figure BDA0003517281100000022
for the expansion operation,
Figure BDA0003517281100000023
is the erosion operation, M d is the expansion structure element in the algorithm, and Me is the erosion structure element in the algorithm.

作为上述技术方案的进一步改进,腐蚀通过消除图像边缘中相对孤立的像素,并根据结构化元素定义的模板腐蚀颗粒的轮廓,使得灰度值高的像素面积减少,对于任何一个给定的像素p0,结构化元素以p0为中心,由结构化元素屏蔽的元素等于1,并表示为pi,则像素pi的值等于0,将p0设为0,若pi是1将p0设置为1;As a further improvement of the above technical solution, the erosion eliminates relatively isolated pixels in the edge of the image, and erodes the outline of the particles according to the template defined by the structuring element, so that the area of pixels with high gray values is reduced. For any given pixel p 0 , the structuring element is centered on p 0 , the element masked by the structuring element is equal to 1, and denoted as p i , then the value of pixel p i is equal to 0, and p 0 is set to 0, if p i is 1, p i 0 is set to 1;

膨胀通过消除图像汇总像素点之间的微小孔洞,根据结构化元素所定义的模板来扩展像素点的轮廓,膨胀将亮度高的像素周边的像素的亮度增加,使灰度值高的像素面积变大。Dilation eliminates the tiny holes between the image summary pixels and expands the outline of the pixels according to the template defined by the structuring elements. Dilation increases the brightness of the pixels around the pixels with high brightness, and makes the area of pixels with high gray values. big.

作为上述技术方案的进一步改进,获取外部红外光源主动照射前后图像中目标摄像头区域或灰度阶跃的特点实现目标检测并得到输入图像,包括:As a further improvement of the above technical solution, the characteristics of the target camera area or grayscale steps in the images before and after the active illumination of the external infrared light source are obtained to realize the target detection and obtain the input image, including:

将图像分为多个区域并对其进行处理,检测出其中的噪声,不同的区域根据其实际状况来自适应模块的大小,对检查出来的模块进行处理以去除其中的噪声;Divide the image into multiple regions and process them to detect the noise in them. Different regions adapt to the size of the module according to their actual conditions, and process the checked modules to remove the noise;

根据标准图像建立一个参考坐标系,并创建一个或多个ROI感兴趣搜索区域,ROI包含产品图像的稳定特征和检测内容;Establish a reference coordinate system based on the standard image, and create one or more ROI search regions of interest, the ROI contains the stable features and detection content of the product image;

以参考系为标准通过算法定位功能,边缘检测或模板匹配以确定待检测图像的坐标系,基于坐标系跟踪图像中对象的位置和方向。The coordinate system of the image to be detected is determined by the algorithm positioning function, edge detection or template matching based on the reference system, and the position and orientation of the object in the image are tracked based on the coordinate system.

作为上述技术方案的进一步改进,根据标准图像建立一个参考坐标系,并创建一个或多个ROI感兴趣搜索区域,包括:As a further improvement of the above technical solution, a reference coordinate system is established according to the standard image, and one or more ROI search regions of interest are created, including:

获取待处理区域并绘制ROI,将待处理特征乘以感兴趣区域或预设的掩膜,使待处理区域像素的灰度值不变,其他区域灰度值为零;Obtain the area to be processed and draw the ROI, multiply the feature to be processed by the area of interest or a preset mask, so that the gray value of the pixel in the area to be processed remains unchanged, and the gray value of other areas is zero;

去除干扰将干扰特征通过掩膜屏蔽掉,使其不参与运算;Remove the interference to shield the interference features through the mask, so that they do not participate in the operation;

获取目标特征,采用相似形状或模板匹配的算法来检测和获取待测画面中与掩膜类似的形态特征。Obtain target features, and use similar shape or template matching algorithms to detect and obtain morphological features similar to masks in the image to be tested.

作为上述技术方案的进一步改进,使用直方图和图像熵的目标分割算法得到可疑目标种子点,包括:As a further improvement of the above technical solution, the target segmentation algorithm using histogram and image entropy is used to obtain suspicious target seed points, including:

使用直方图阈值分割算法提取固定比例的高灰度区域,以提取真实,目标区域,结合图像全局二维信息熵,采用香农熵来度量随机变量的不确定性,其表达式为

Figure BDA0003517281100000041
其中H(x)越大,表示x的不确定性越大,将其累加,则代表整个系统的总体熵,表征信息源的总信息量,x为一个随机离散变量,满足x∈{x1,x2,x3...},其概率分布的表达式为p(X=xi)=pi,i=1,2,3...n,其中pi表示图像中的每一个灰度级所出现的概率值;The histogram threshold segmentation algorithm is used to extract a fixed proportion of high-gray areas to extract the real and target areas. Combined with the global two-dimensional information entropy of the image, the Shannon entropy is used to measure the uncertainty of random variables, and its expression is
Figure BDA0003517281100000041
The larger H(x) is, the greater the uncertainty of x is, and it is accumulated to represent the overall entropy of the entire system, representing the total amount of information of the information source, x is a random discrete variable, satisfying x∈{x 1 ,x 2 ,x 3 ... }, the expression of its probability distribution is p(X=x i )=pi , i =1,2,3...n, where pi represents each The probability value of gray level occurrence;

对于待处理图像Idst,分别计算阈值q所分割得到的背景与前景I0、I1的熵H0(q)、H1(q),其表达式分别为:

Figure BDA0003517281100000042
Figure BDA0003517281100000043
P0(q)、P1(q)分别表示Idst经阈值q(0≤q≤k-1)分割后背景与前景的累计概率,两者志合为1,其中估算I0、I1的概率密度函数表示为I0:
Figure BDA0003517281100000044
I1:
Figure BDA0003517281100000045
其中
Figure BDA0003517281100000046
计算得到I0、I1的熵H0(q)、H1(q)后,得到使得Idst经阈值分割后的熵H(q)最大的q,H(q)=H0(q)+H1(q)。For the image I dst to be processed, the entropy H 0 (q) and H 1 (q) of the background and foreground I 0 and I 1 obtained by dividing the threshold q are calculated respectively, and their expressions are respectively:
Figure BDA0003517281100000042
Figure BDA0003517281100000043
P 0 (q) and P 1 (q) respectively represent the cumulative probability of background and foreground after I dst is segmented by the threshold q (0≤q≤k-1), and the two are equal to 1, where I 0 and I 1 are estimated. The probability density function of is expressed as I 0 :
Figure BDA0003517281100000044
I 1 :
Figure BDA0003517281100000045
in
Figure BDA0003517281100000046
After calculating the entropy H 0 (q) and H 1 (q) of I 0 and I 1 , obtain the q that maximizes the entropy H(q) after I dst is divided by the threshold, H(q)=H 0 (q) +H 1 (q).

作为上述技术方案的进一步改进,按灰度值从高到低,从图像直方图上选取固定比例的像素点个数对应的灰度值得到基于直方图的目标分割阈值th,th=[p(gt>th)≤10%],其中gt为图像中各像素的灰度值,t表示图像中的各个像素点,p()表示图像Idst中满足条件像素点的概率值。As a further improvement of the above technical solution, according to the gray value from high to low, select the gray value corresponding to the number of pixels in a fixed proportion from the image histogram to obtain the target segmentation threshold th based on the histogram, th=[p( gt>th)≤10%], where gt is the gray value of each pixel in the image, t represents each pixel in the image, and p() represents the probability value of the pixel satisfying the condition in the image I dst .

作为上述技术方案的进一步改进,获取完整高光区域,并通过目标摄像头的特征描述子进行目标判别对可疑目标的判别进行筛选,包括:As a further improvement of the above technical solution, the complete highlight area is obtained, and the target discrimination is performed through the feature descriptor of the target camera to screen for the discrimination of suspicious targets, including:

从种子点开始将与种子点具有相同属性的相邻像素合并到同一区域,以实现区域扩增;From the seed point, the adjacent pixels with the same attributes as the seed point are merged into the same area to realize area amplification;

分别对增长区域的尺寸和中心灰度与外围灰度对比度进行限定,取Ri(Ri∈φ,i=1,2,3...t)中任意一个点作为种子点,种子点相邻像素进行判别,使停止区域增长。The size of the growth area and the contrast between the central grayscale and the peripheral grayscale are respectively defined, and any point in R i (R i ∈ φ, i=1, 2, 3...t) is taken as the seed point, and the seed point is similar to Neighboring pixels are discriminated to make the stop region grow.

作为上述技术方案的进一步改进,获取完整高光区域包括:As a further improvement of the above technical solution, obtaining a complete highlight area includes:

采用列灰度值的阈值将相应的灰度值转化为逻辑值0或1;Use the threshold of the column gray value to convert the corresponding gray value into a logical value of 0 or 1;

根据数据比特分辨率将获得的逻辑值下采样为比特信息;Down-sampling the obtained logic value into bit information according to the data bit resolution;

将检测到的数据帧头解码得到携带的数据信息以实现信号的解调。Decode the detected data frame header to obtain the carried data information to demodulate the signal.

第二方面,本发明还提供了一种基于图像传感器像素阵列的手机摄像头检测装置,包括:In a second aspect, the present invention also provides a mobile phone camera detection device based on an image sensor pixel array, including:

获取模块,用于获取外部红外光源主动照射前后图像中目标摄像头区域或灰度阶跃的特点实现目标检测并得到输入图像,其中使用EL-NIR图像与NL-NIR图像作为输入;The acquisition module is used to acquire the characteristics of the target camera area or grayscale steps in the images before and after the active irradiation of the external infrared light source to realize the target detection and obtain the input image, wherein the EL-NIR image and the NL-NIR image are used as input;

分割模块,用于对输入图像进行预处理以提高图像信噪比,使用直方图和图像熵的目标分割算法得到可疑目标种子点;The segmentation module is used to preprocess the input image to improve the signal-to-noise ratio of the image, and use the target segmentation algorithm of histogram and image entropy to obtain suspicious target seed points;

筛选模块,用于获取完整高光区域,并通过目标摄像头的特征描述子进行目标判别对可疑目标的判别进行筛选,其中,筛选过程包括对EL-NIR图像与NL-NIR图像进行图像差分获得差分图像实现初步背景抑制,使用形态学滤波提高真实目标在图像中的显著性,通过目标分割获取目标高光区域碎片,使用自适应区域增长获取目标完整高光区域;The screening module is used to obtain the complete highlight area, and perform target discrimination through the feature descriptor of the target camera to screen suspicious targets. The screening process includes performing image difference between the EL-NIR image and the NL-NIR image to obtain a differential image. Achieve preliminary background suppression, use morphological filtering to improve the saliency of the real target in the image, obtain target highlight area fragments through target segmentation, and use adaptive area growth to obtain the target complete highlight area;

检测模块,用于通过检测聚类算法确定目标重复检测情况,将检测结果以RGB彩色图像进行展示。The detection module is used to determine the repeated detection of the target through the detection clustering algorithm, and display the detection result as an RGB color image.

本发明提供了一种基于图像传感器像素阵列的手机摄像头检测方法及装置,相对于现有技术,具有以下的有益效果:The present invention provides a mobile phone camera detection method and device based on an image sensor pixel array, which has the following beneficial effects compared to the prior art:

通过获取外部红外光源主动照射前后图像中目标摄像头区域或灰度阶跃的特点实现目标检测并得到输入图像,对输入图像进行预处理以提高图像信噪比,使用直方图和图像熵的目标分割算法得到可疑目标种子点,获取完整高光区域,并通过目标摄像头的特征描述子进行目标判别对可疑目标的判别进行筛选,通过检测聚类算法确定目标重复检测情况,将检测结果以RGB彩色图像进行展示。在平滑背景下能够准确检测出目标,复杂背景下能够在检测出真实目标,同时带人较少的虚警,判别条件简单,在保证检测性能时具有良好的运行性能,改变目标掩膜的形状会降低后期特征分析和计算的准确度,影响最终目标判定的效果。利用复检目标在物理距离上必然相近的事实,对判别结果进行聚类,消除目标重复检测的情形,一定程度上也提高了摄像头检测的精度和效率。By obtaining the characteristics of the target camera area or grayscale steps in the image before and after the active illumination of the external infrared light source, the target detection is realized and the input image is obtained, the input image is preprocessed to improve the image signal-to-noise ratio, and the target segmentation using histogram and image entropy is used. The algorithm obtains the seed point of the suspicious target, obtains the complete highlight area, and uses the feature descriptor of the target camera to perform target discrimination to screen the suspicious target. exhibit. The target can be accurately detected in a smooth background, the real target can be detected in a complex background, and there are fewer false alarms, the discrimination conditions are simple, and the detection performance is guaranteed with good running performance, changing the shape of the target mask It will reduce the accuracy of later feature analysis and calculation, and affect the final target determination effect. Using the fact that the re-inspection targets must be close in physical distance, the discrimination results are clustered to eliminate the situation of repeated target detection, and to a certain extent, the accuracy and efficiency of camera detection are also improved.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本发明的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and therefore do not It should be regarded as a limitation of the scope, and for those of ordinary skill in the art, other related drawings can also be obtained according to these drawings without any creative effort.

图1为本发明的基于图像传感器像素阵列的手机摄像头检测方法的流程图;1 is a flowchart of a mobile phone camera detection method based on an image sensor pixel array of the present invention;

图2为本发明的噪声检测的流程图;Fig. 2 is the flow chart of the noise detection of the present invention;

图3为本发明的去除噪声的流程图;Fig. 3 is the flowchart of the noise removal of the present invention;

图4为本发明的采集完整高光区域的流程图;Fig. 4 is the flow chart of the acquisition complete highlight area of the present invention;

图5为本发明的基于图像传感器像素阵列的手机摄像头检测装置的结构框图。FIG. 5 is a structural block diagram of a mobile phone camera detection device based on an image sensor pixel array of the present invention.

具体实施方式Detailed ways

下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本发明,而不能理解为对本发明的限制。The following describes in detail the embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary, only used to explain the present invention, and should not be construed as a limitation of the present invention.

参阅图1,本发明提供了一种基于图像传感器像素阵列的手机摄像头检测方法,包括以下步骤:Referring to FIG. 1, the present invention provides a mobile phone camera detection method based on an image sensor pixel array, including the following steps:

S10:获取外部红外光源主动照射前后图像中目标摄像头区域或灰度阶跃的特点实现目标检测并得到输入图像,其中使用EL-NIR图像与NL-NIR图像作为输入;S10: Obtain the characteristics of the target camera area or grayscale steps in the images before and after the active illumination of the external infrared light source to achieve target detection and obtain an input image, in which the EL-NIR image and the NL-NIR image are used as input;

S11:对输入图像进行预处理以提高图像信噪比,使用直方图和图像熵的目标分割算法得到可疑目标种子点;S11: Preprocess the input image to improve the signal-to-noise ratio of the image, and use the target segmentation algorithm of histogram and image entropy to obtain suspicious target seed points;

S12:获取完整高光区域,并通过目标摄像头的特征描述子进行目标判别对可疑目标的判别进行筛选,其中,筛选过程包括对EL-NIR图像与NL-NIR图像进行图像差分获得差分图像实现初步背景抑制,使用形态学滤波提高真实目标在图像中的显著性,通过目标分割获取目标高光区域碎片,使用自适应区域增长获取目标完整高光区域;S12: Obtain the complete highlight area, and perform target discrimination through the feature descriptor of the target camera to screen the suspicious target, wherein the screening process includes performing image difference between the EL-NIR image and the NL-NIR image to obtain a difference image to achieve a preliminary background Suppression, use morphological filtering to improve the saliency of the real target in the image, obtain target highlight area fragments through target segmentation, and use adaptive area growth to obtain the target complete highlight area;

S13:通过检测聚类算法确定目标重复检测情况,将检测结果以RGB彩色图像进行展示。S13: Determine the repeated detection situation of the target through the detection clustering algorithm, and display the detection result as an RGB color image.

本实施例中,筛选过程包括对EL-NIR图像与NL-NIR图像进行图像差分获得差分图像实现初步背景抑制,通过将两幅图像的像素值对应相减达到削弱图像的相似部分,突出显示图像变化的部分,差分图像的获取方式包括当前图像与固定背景差分、连续两幅图像之间的差分;经图像差分后获得的表达式为Idif(x,y)=Ip(x,y)-In(x,y),其中ip、In分别为EL-NIR图像与NL-NIR图像,Idif为得到的差分图像,(x,y)为图像对齐进行差分的像素点坐标;目标摄像头在红外光照射下所形成的为小尺寸的类圆状光斑,通过分析目标形状特征和灰度分别特征,以提高图像的信噪比,其表达式为

Figure BDA0003517281100000071
其中Idst为经背景抑制算法处理后的背景抑制图像,Idif为差分图像,
Figure BDA0003517281100000072
为膨胀运算,
Figure BDA0003517281100000073
为腐蚀运算,Md为算法中的膨胀结构元素,Me为算法中的腐蚀结构元素。In this embodiment, the screening process includes performing image difference between the EL-NIR image and the NL-NIR image to obtain a difference image to achieve preliminary background suppression, and by correspondingly subtracting the pixel values of the two images to weaken the similar part of the image, and highlight the image For the changed part, the acquisition method of the difference image includes the difference between the current image and the fixed background, and the difference between two consecutive images; the expression obtained after the image difference is I dif (x, y)=I p (x, y) -In ( x , y), wherein i p and In are the EL-NIR image and the NL-NIR image respectively, I dif is the difference image obtained, (x, y) is the pixel coordinate of the image alignment for difference; The small-sized circular light spot formed by the target camera under the irradiation of infrared light can improve the signal-to-noise ratio of the image by analyzing the target shape characteristics and grayscale characteristics, and its expression is as follows:
Figure BDA0003517281100000071
where I dst is the background suppression image processed by the background suppression algorithm, and I dif is the difference image,
Figure BDA0003517281100000072
for the expansion operation,
Figure BDA0003517281100000073
is the erosion operation, M d is the expansion structure element in the algorithm, and Me is the erosion structure element in the algorithm.

需要说明的是,腐蚀通过消除图像边缘中相对孤立的像素,并根据结构化元素定义的模板腐蚀颗粒的轮廓,使得灰度值高的像素面积减少,对于任何一个给定的像素p0,结构化元素以p0为中心,由结构化元素屏蔽的元素等于1,并表示为pi,则像素pi的值等于0,将p0设为0,若pi是1将p0设置为1;膨胀通过消除图像汇总像素点之间的微小孔洞,根据结构化元素所定义的模板来扩展像素点的轮廓,膨胀将亮度高的像素周边的像素的亮度增加,使灰度值高的像素面积变大。It should be noted that the erosion eliminates relatively isolated pixels in the edge of the image, and erodes the outline of the particles according to the template defined by the structuring element, so that the area of pixels with high gray value is reduced. For any given pixel p 0 , the structure The element is centered on p 0 , the element masked by the structuring element is equal to 1, and denoted as p i , then the value of pixel p i is equal to 0, set p 0 to 0, and if p i is 1 set p 0 to 1; Expansion eliminates the tiny holes between the image summary pixels, expands the outline of the pixel points according to the template defined by the structural element, and the expansion increases the brightness of the pixels around the pixels with high brightness, so that the pixels with high gray value area becomes larger.

应理解,通过背景抑制算法消除大部分背景后,真实目标在图像中的显著性得到进一步提高。为了检测图像中可能存在的目标摄像头,需要经过目标分割提取候选目标区域。为了实现提取真实目标的同时,避免直方图分割算法值过大导致的目标过分割图像,通过求取几何加权平均数达到平滑阈值的目的。使用基于直方图的阈值风格得到的实际结果虽然分出了真实目标,但造成了过分割的现象,带入了大量噪点,过分割现象不仅为后续目标判别缓解引入了大量无意义的工作量,也将降低算法整体的检测效果。平滑背景下,自适应区域增长算法能够在目标分割结果的基础上较好的扩增目标摄像头高光区域,在复杂背景下,自适应区域增长算法不仅能够优化真实目标的目标分割结果,还具备对于线状、块状等伪目标的提取能力,有助于滤除虚警。It should be understood that the saliency of the real object in the image is further improved after most of the background is eliminated by the background suppression algorithm. In order to detect possible target cameras in the image, it is necessary to extract candidate target regions through target segmentation. In order to extract the real target and avoid the target over-segmented image caused by the excessive value of the histogram segmentation algorithm, the smooth threshold is achieved by calculating the geometric weighted average. The actual results obtained using the histogram-based thresholding style separated the real target, but caused the phenomenon of over-segmentation and brought in a lot of noise. The over-segmentation phenomenon not only introduced a lot of meaningless workload for subsequent target discrimination mitigation, It will also reduce the overall detection effect of the algorithm. In a smooth background, the adaptive region growing algorithm can better expand the highlight area of the target camera based on the target segmentation results. In a complex background, the adaptive region growing algorithm can not only optimize the target segmentation results of the real target, but also have the The ability to extract false targets such as lines and blocks helps to filter out false alarms.

参阅图2,可选地,获取外部红外光源主动照射前后图像中目标摄像头区域或灰度阶跃的特点实现目标检测并得到输入图像,包括:Referring to FIG. 2, optionally, acquiring the characteristics of the target camera area or grayscale steps in the images before and after the active illumination of the external infrared light source to achieve target detection and obtain the input image, including:

S20:将图像分为多个区域并对其进行处理,检测出其中的噪声,不同的区域根据其实际状况来自适应模块的大小,对检查出来的模块进行处理以去除其中的噪声;S20: Divide the image into multiple regions and process them to detect noise in them. Different regions adapt to the size of the modules according to their actual conditions, and process the checked modules to remove the noise;

S21:根据标准图像建立一个参考坐标系,并创建一个或多个ROI感兴趣搜索区域,ROI包含产品图像的稳定特征和检测内容;S21: Establish a reference coordinate system according to the standard image, and create one or more ROI search regions of interest, where the ROI contains the stable features and detection content of the product image;

S22:以参考系为标准通过算法定位功能,边缘检测或模板匹配以确定待检测图像的坐标系,基于坐标系跟踪图像中对象的位置和方向。S22: Determine the coordinate system of the image to be detected by using the algorithm positioning function, edge detection or template matching based on the reference system, and track the position and direction of the object in the image based on the coordinate system.

本实施例中,在大多数情况下,待测物在相机的视野内的位置无法完全固定,需要在产品位置发生偏移时,ROI搜索区域也要相对于坐标系随之移动,需要对摄像头四个角落的胶水进行检测,即ROI区域为摄像头的四个角落。图像掩膜是一个二进制的图像,掩膜本身的大小要求小于或等于待检测的图像,图像掩膜模块会在被处理图像中对相对应的模块大小进行检测处理,若一个像素在图像掩膜中有一个非零值,则相应的像素将会在检测图像过程中进行处理,反之,若一个像素在图像掩膜中的灰度值为零,则相应的像素在图像处理中对其忽略不计,待测物的四个角落的UV胶水部分被单独提取出来,给后续的算法处理和分析提供了效率和稳定性。In this embodiment, in most cases, the position of the object to be measured in the field of view of the camera cannot be completely fixed, and when the product position shifts, the ROI search area also moves relative to the coordinate system. The glue in the four corners is used for detection, that is, the ROI area is the four corners of the camera. The image mask is a binary image. The size of the mask itself is required to be less than or equal to the image to be detected. The image mask module will detect the corresponding module size in the processed image. If a pixel is in the image mask If there is a non-zero value in the image, the corresponding pixel will be processed in the process of detecting the image. On the contrary, if the gray value of a pixel in the image mask is zero, the corresponding pixel will be ignored in the image processing. , the UV glue part of the four corners of the object to be tested is extracted separately, which provides efficiency and stability for subsequent algorithm processing and analysis.

参阅图3,可选地,根据标准图像建立一个参考坐标系,并创建一个或多个ROI感兴趣搜索区域,包括:Referring to Figure 3, optionally, a reference coordinate system is established according to the standard image, and one or more ROI search regions of interest are created, including:

S30:获取待处理区域并绘制ROI,将待处理特征乘以感兴趣区域或预设的掩膜,使待处理区域像素的灰度值不变,其他区域灰度值为零;S30: Obtain the region to be processed and draw a ROI, multiply the feature to be processed by the region of interest or a preset mask, so that the gray value of the pixel in the region to be processed remains unchanged, and the gray value of other regions is zero;

S31:去除干扰将干扰特征通过掩膜屏蔽掉,使其不参与运算;S31: remove the interference and shield the interference feature through the mask, so that it does not participate in the operation;

S32:获取目标特征,采用相似形状或模板匹配的算法来检测和获取待测画面中与掩膜类似的形态特征。S32: Obtain target features, and use a similar shape or template matching algorithm to detect and obtain morphological features similar to the mask in the image to be tested.

本实施例中,使用直方图和图像熵的目标分割算法得到可疑目标种子点,使用直方图阈值分割算法提取固定比例的高灰度区域,以提取真实,目标区域,结合图像全局二维信息熵,采用香农熵来度量随机变量的不确定性,其表达式为

Figure BDA0003517281100000091
其中H(x)越大,表示x的不确定性越大,将其累加,则代表整个系统的总体熵,表征信息源的总信息量,x为一个随机离散变量,满足x∈{x1,x2,x3...},其概率分布的表达式为p(X=xi)=pi,i=1,2,3...n,其中pi表示图像中的每一个灰度级所出现的概率值;对于待处理图像Idst,分别计算阈值q所分割得到的背景与前景I0、I1的熵H0(q)、H1(q),其表达式分别为:
Figure BDA0003517281100000101
P0(q)、P1(q)分别表示Idst经阈值q(0≤q≤k-1)分割后背景与前景的累计概率,两者志合为1,其中估算I0、I1的概率密度函数表示为I0:
Figure BDA0003517281100000102
I1:
Figure BDA0003517281100000103
其中
Figure BDA0003517281100000104
计算得到I0、I1的熵H0(q)、H1(q)后,得到使得Idst经阈值分割后的熵H(q)最大的q,H(q)=H0(q)+H1(q)。In this embodiment, the target segmentation algorithm of histogram and image entropy is used to obtain suspicious target seed points, and the histogram threshold segmentation algorithm is used to extract a fixed-proportion high-gray area to extract the real, target area, combined with the global two-dimensional information entropy of the image , the Shannon entropy is used to measure the uncertainty of random variables, and its expression is
Figure BDA0003517281100000091
The larger H(x) is, the greater the uncertainty of x is, and it is accumulated to represent the overall entropy of the entire system, representing the total amount of information of the information source, x is a random discrete variable, satisfying x∈{x 1 ,x 2 ,x 3 ... }, the expression of its probability distribution is p(X=x i )=pi , i =1,2,3...n, where pi represents each The probability value of gray level occurrence; for the image I dst to be processed, the entropy H 0 (q) and H 1 (q) of the background and foreground I 0 and I 1 obtained by dividing the threshold q are calculated respectively, and their expressions are respectively for:
Figure BDA0003517281100000101
P 0 (q) and P 1 (q) respectively represent the cumulative probability of background and foreground after I dst is segmented by the threshold q (0≤q≤k-1), and the two are equal to 1, where I 0 and I 1 are estimated. The probability density function of is expressed as I 0 :
Figure BDA0003517281100000102
I 1 :
Figure BDA0003517281100000103
in
Figure BDA0003517281100000104
After calculating the entropy H 0 (q) and H 1 (q) of I 0 and I 1 , obtain the q that maximizes the entropy H(q) after I dst is divided by the threshold, H(q)=H 0 (q) +H 1 (q).

需要说明的是,按灰度值从高到低,从图像直方图上选取固定比例的像素点个数对应的灰度值得到基于直方图的目标分割阈值th,th=[p(gt>th)≤10%],其中gt为图像中各像素的灰度值,t表示图像中的各个像素点,p()表示图像Idst中满足条件像素点的概率值。It should be noted that, according to the gray value from high to low, select the gray value corresponding to the number of pixels in a fixed proportion from the image histogram to obtain the target segmentation threshold th based on the histogram, th=[p(g t > th)≤10%], where g t is the gray value of each pixel in the image, t represents each pixel in the image, and p( ) represents the probability value of the pixel that satisfies the condition in the image I dst .

参阅图4,可选地,获取完整高光区域包括:Referring to Figure 4, optionally, obtaining the complete highlight area includes:

S40:采用列灰度值的阈值将相应的灰度值转化为逻辑值0或1;S40: using the threshold value of the column gray value to convert the corresponding gray value into a logical value of 0 or 1;

S41:根据数据比特分辨率将获得的逻辑值下采样为比特信息;S41: down-sampling the obtained logic value into bit information according to the data bit resolution;

S42:将检测到的数据帧头解码得到携带的数据信息以实现信号的解调。S42: Decode the detected data frame header to obtain the carried data information to demodulate the signal.

本实施例中,获取完整高光区域,并通过目标摄像头的特征描述子进行目标判别对可疑目标的判别进行筛选,从种子点开始将与种子点具有相同属性的相邻像素合并到同一区域,以实现区域扩增;分别对增长区域的尺寸和中心灰度与外围灰度对比度进行限定,取Ri(Ri∈φ,i=1,2,3...t)中任意一个点作为种子点,种子点相邻像素进行判别,使停止区域增长。In this embodiment, the complete highlight area is obtained, and the target discrimination is performed by the feature descriptor of the target camera to screen the suspicious target. Realize area amplification; the size of the growing area and the contrast between the central grayscale and the peripheral grayscale are respectively defined, and any point in R i (R i ∈ φ, i=1, 2, 3...t) is taken as the seed Point, the adjacent pixels of the seed point are discriminated, so that the stop area grows.

参阅图5,本发明还提供了一种基于图像传感器像素阵列的手机摄像头检测装置,包括:Referring to FIG. 5, the present invention also provides a mobile phone camera detection device based on an image sensor pixel array, including:

获取模块,用于获取外部红外光源主动照射前后图像中目标摄像头区域或灰度阶跃的特点实现目标检测并得到输入图像,其中使用EL-NIR图像与NL-NIR图像作为输入;The acquisition module is used to acquire the characteristics of the target camera area or grayscale steps in the images before and after the active irradiation of the external infrared light source to realize the target detection and obtain the input image, wherein the EL-NIR image and the NL-NIR image are used as input;

分割模块,用于对输入图像进行预处理以提高图像信噪比,使用直方图和图像熵的目标分割算法得到可疑目标种子点;The segmentation module is used to preprocess the input image to improve the signal-to-noise ratio of the image, and use the target segmentation algorithm of histogram and image entropy to obtain suspicious target seed points;

筛选模块,用于获取完整高光区域,并通过目标摄像头的特征描述子进行目标判别对可疑目标的判别进行筛选,其中,筛选过程包括对EL-NIR图像与NL-NIR图像进行图像差分获得差分图像实现初步背景抑制,使用形态学滤波提高真实目标在图像中的显著性,通过目标分割获取目标高光区域碎片,使用自适应区域增长获取目标完整高光区域;The screening module is used to obtain the complete highlight area, and perform target discrimination through the feature descriptor of the target camera to screen suspicious targets. The screening process includes performing image difference between the EL-NIR image and the NL-NIR image to obtain a differential image. Achieve preliminary background suppression, use morphological filtering to improve the saliency of the real target in the image, obtain target highlight area fragments through target segmentation, and use adaptive area growth to obtain the target complete highlight area;

检测模块,用于通过检测聚类算法确定目标重复检测情况,将检测结果以RGB彩色图像进行展示。The detection module is used to determine the repeated detection of the target through the detection clustering algorithm, and display the detection result as an RGB color image.

本实施例中,由于目标分割算法割裂同一目标的连通域,使其被重复召回,同一目标被重复检测将使得系统产生不必要的触发报警,造成扔重复检测和浪费人力。在可疑目标提取阶段使用形态学开闭运算连通割裂区域,再进行目标判定,目标判定后,使用聚类算法,将聚类相近的检测结果视为一个目标。改变目标掩膜的形状会降低后期特征分析和计算的准确度,影响最终目标判定的效果。利用复检目标在物理距离上必然相近的事实,对判别结果进行聚类,消除目标重复检测的情形。In this embodiment, since the target segmentation algorithm splits the connected domain of the same target and makes it recalled repeatedly, repeated detection of the same target will cause the system to generate unnecessary trigger alarms, resulting in repeated detection and waste of manpower. In the suspicious target extraction stage, the morphological opening and closing operation is used to connect the split regions, and then the target is determined. After the target is determined, the clustering algorithm is used to treat the detection results with similar clusters as one target. Changing the shape of the target mask will reduce the accuracy of later feature analysis and calculation, and affect the final target determination effect. Using the fact that the re-examination targets must be close in physical distance, the discriminant results are clustered to eliminate the situation of repeated detection of targets.

在这里示出和描述的所有示例中,任何具体值应被解释为仅仅是示例性的,而不是作为限制,因此,示例性实施例的其他示例可以具有不同的值。In all examples shown and described herein, any specific value should be construed as merely exemplary and not as limiting, as other examples of exemplary embodiments may have different values.

应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。It should be noted that like numerals and letters refer to like items in the following figures, so once an item is defined in one figure, it does not require further definition and explanation in subsequent figures.

以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本发明范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。The above-mentioned embodiments only represent several embodiments of the present invention, and the descriptions thereof are specific and detailed, but should not be construed as limiting the scope of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can also be made, which all belong to the protection scope of the present invention.

Claims (10)

1.一种基于图像传感器像素阵列的手机摄像头检测方法,其特征在于,包括以下步骤:1. a mobile phone camera detection method based on an image sensor pixel array, is characterized in that, comprises the following steps: 获取外部红外光源主动照射前后图像中目标摄像头区域或灰度阶跃的特点实现目标检测并得到输入图像,其中使用EL-NIR图像与NL-NIR图像作为输入;Obtain the characteristics of the target camera area or grayscale step in the image before and after the active illumination of the external infrared light source to achieve target detection and obtain the input image, in which the EL-NIR image and the NL-NIR image are used as input; 对输入图像进行预处理以提高图像信噪比,使用直方图和图像熵的目标分割算法得到可疑目标种子点;The input image is preprocessed to improve the image signal-to-noise ratio, and the target segmentation algorithm using histogram and image entropy is used to obtain suspicious target seed points; 获取完整高光区域,并通过目标摄像头的特征描述子进行目标判别对可疑目标的判别进行筛选,其中,筛选过程包括对EL-NIR图像与NL-NIR图像进行图像差分获得差分图像实现初步背景抑制,使用形态学滤波提高真实目标在图像中的显著性,通过目标分割获取目标高光区域碎片,使用自适应区域增长获取目标完整高光区域;Obtain the complete highlight area, and use the feature descriptor of the target camera to perform target discrimination to screen suspicious targets. The screening process includes performing image difference between the EL-NIR image and the NL-NIR image to obtain a differential image to achieve preliminary background suppression. Use morphological filtering to improve the saliency of the real target in the image, obtain target highlight area fragments through target segmentation, and use adaptive area growth to obtain the target complete highlight area; 通过检测聚类算法确定目标重复检测情况,将检测结果以RGB彩色图像进行展示。The detection clustering algorithm is used to determine the repeated detection of the target, and the detection results are displayed in RGB color images. 2.根据权利要求1所述的基于图像传感器像素阵列的手机摄像头检测方法,其特征在于,筛选过程包括对EL-NIR图像与NL-NIR图像进行图像差分获得差分图像实现初步背景抑制,包括:2. the mobile phone camera detection method based on image sensor pixel array according to claim 1, is characterized in that, screening process comprises that EL-NIR image and NL-NIR image are carried out image difference to obtain difference image and realize preliminary background suppression, comprising: 通过将两幅图像的像素值对应相减达到削弱图像的相似部分,突出显示图像变化的部分,差分图像的获取方式包括当前图像与固定背景差分、连续两幅图像之间的差分;The similar parts of the images are weakened by correspondingly subtracting the pixel values of the two images, and the changed parts of the images are highlighted. The acquisition method of the difference image includes the difference between the current image and the fixed background, and the difference between two consecutive images; 经图像差分后获得的表达式为Idif(x,y)=Ip(x,y)-In(x,y),其中ip、In分别为EL-NIR图像与NL-NIR图像,Idif为得到的差分图像,(x,y)为图像对齐进行差分的像素点坐标;The expression obtained after image difference is Idif ( x ,y)= Ip ( x ,y)-In(x,y), where ip and In are EL-NIR image and NL-NIR image respectively , I dif is the obtained differential image, (x, y) is the pixel coordinate of the image alignment for differential; 目标摄像头在红外光照射下所形成的为小尺寸的类圆状光斑,通过分析目标形状特征和灰度分别特征,以提高图像的信噪比,其表达式为
Figure FDA0003517281090000021
其中Idst为经背景抑制算法处理后的背景抑制图像,Idif为差分图像,
Figure FDA0003517281090000022
为膨胀运算,
Figure FDA0003517281090000023
为腐蚀运算,Md为算法中的膨胀结构元素,Me为算法中的腐蚀结构元素。
The small-sized circular light spot formed by the target camera under the irradiation of infrared light can improve the signal-to-noise ratio of the image by analyzing the target shape characteristics and grayscale characteristics, and its expression is as follows:
Figure FDA0003517281090000021
where I dst is the background suppression image processed by the background suppression algorithm, and I dif is the difference image,
Figure FDA0003517281090000022
for the expansion operation,
Figure FDA0003517281090000023
is the erosion operation, M d is the expansion structure element in the algorithm, and Me is the erosion structure element in the algorithm.
3.根据权利要求2所述的基于图像传感器像素阵列的手机摄像头检测方法,其特征在于,腐蚀通过消除图像边缘中相对孤立的像素,并根据结构化元素定义的模板腐蚀颗粒的轮廓,使得灰度值高的像素面积减少,对于任何一个给定的像素p0,结构化元素以p0为中心,由结构化元素屏蔽的元素等于1,并表示为pi,则像素pi的值等于0,将p0设为0,若pi是1将p0设置为1;3. The method for detecting a mobile phone camera based on an image sensor pixel array according to claim 2, wherein the corrosion is performed by eliminating relatively isolated pixels in the edge of the image, and according to the template defined by the structuring element to corrode the outline of the particles, so that the gray The area of a pixel with a high degree value decreases. For any given pixel p 0 , the structuring element is centered at p 0 , the element masked by the structuring element is equal to 1, and denoted by p i , then the value of pixel p i is equal to 0, set p 0 to 0, if p i is 1, set p 0 to 1; 膨胀通过消除图像汇总像素点之间的微小孔洞,根据结构化元素所定义的模板来扩展像素点的轮廓,膨胀将亮度高的像素周边的像素的亮度增加,使灰度值高的像素面积变大。Dilation eliminates the tiny holes between the image summary pixels and expands the outline of the pixels according to the template defined by the structuring elements. Dilation increases the brightness of the pixels around the pixels with high brightness, and makes the area of pixels with high gray values. big. 4.根据权利要求1所述的基于图像传感器像素阵列的手机摄像头检测方法,其特征在于,获取外部红外光源主动照射前后图像中目标摄像头区域或灰度阶跃的特点实现目标检测并得到输入图像,包括:4. The mobile phone camera detection method based on an image sensor pixel array according to claim 1, characterized in that, acquiring the characteristics of the target camera area or grayscale steps in the images before and after the active irradiation of the external infrared light source to achieve target detection and obtain the input image ,include: 将图像分为多个区域并对其进行处理,检测出其中的噪声,不同的区域根据其实际状况来自适应模块的大小,对检查出来的模块进行处理以去除其中的噪声;Divide the image into multiple regions and process them to detect the noise in them. Different regions adapt to the size of the module according to their actual conditions, and process the checked modules to remove the noise; 根据标准图像建立一个参考坐标系,并创建一个或多个ROI感兴趣搜索区域,ROI包含产品图像的稳定特征和检测内容;Establish a reference coordinate system based on the standard image, and create one or more ROI search regions of interest, the ROI contains the stable features and detection content of the product image; 以参考系为标准通过算法定位功能,边缘检测或模板匹配以确定待检测图像的坐标系,基于坐标系跟踪图像中对象的位置和方向。The coordinate system of the image to be detected is determined by the algorithm positioning function, edge detection or template matching based on the reference system, and the position and orientation of the object in the image are tracked based on the coordinate system. 5.根据权利要求4所述的基于图像传感器像素阵列的手机摄像头检测方法,其特征在于,根据标准图像建立一个参考坐标系,并创建一个或多个ROI感兴趣搜索区域,包括:5. the mobile phone camera detection method based on image sensor pixel array according to claim 4, is characterized in that, establishes a reference coordinate system according to standard image, and creates one or more ROI interest search area, comprising: 获取待处理区域并绘制ROI,将待处理特征乘以感兴趣区域或预设的掩膜,使待处理区域像素的灰度值不变,其他区域灰度值为零;Obtain the area to be processed and draw the ROI, multiply the feature to be processed by the area of interest or a preset mask, so that the gray value of the pixel in the area to be processed remains unchanged, and the gray value of other areas is zero; 去除干扰将干扰特征通过掩膜屏蔽掉,使其不参与运算;Remove the interference to shield the interference features through the mask, so that they do not participate in the operation; 获取目标特征,采用相似形状或模板匹配的算法来检测和获取待测画面中与掩膜类似的形态特征。Obtain target features, and use similar shape or template matching algorithms to detect and obtain morphological features similar to masks in the image to be tested. 6.根据权利要求1所述的基于图像传感器像素阵列的手机摄像头检测方法,其特征在于,使用直方图和图像熵的目标分割算法得到可疑目标种子点,包括:6. the mobile phone camera detection method based on image sensor pixel array according to claim 1, is characterized in that, uses the target segmentation algorithm of histogram and image entropy to obtain suspicious target seed point, comprising: 使用直方图阈值分割算法提取固定比例的高灰度区域,以提取真实,目标区域,结合图像全局二维信息熵,采用香农熵来度量随机变量的不确定性,其表达式为
Figure FDA0003517281090000031
其中H(x)越大,表示x的不确定性越大,将其累加,则代表整个系统的总体熵,表征信息源的总信息量,x为一个随机离散变量,满足x∈{x1,x2,x3...},其概率分布的表达式为p(X=xi)=pi,i=1,2,3...n,其中pi表示图像中的每一个灰度级所出现的概率值;
The histogram threshold segmentation algorithm is used to extract a fixed proportion of high-gray areas to extract the real and target areas. Combined with the global two-dimensional information entropy of the image, the Shannon entropy is used to measure the uncertainty of random variables, and its expression is
Figure FDA0003517281090000031
The larger H(x) is, the greater the uncertainty of x is, and it is accumulated to represent the overall entropy of the entire system, representing the total amount of information of the information source, x is a random discrete variable, satisfying x∈{x 1 ,x 2 ,x 3 ... }, the expression of its probability distribution is p(X=x i )=pi , i =1,2,3...n, where pi represents each The probability value of gray level occurrence;
对于待处理图像Idst,分别计算阈值q所分割得到的背景与前景I0、I1的熵H0(q)、H1(q),其表达式分别为:
Figure FDA0003517281090000032
Figure FDA0003517281090000033
P0(q)、P1(q)分别表示Idst经阈值q(0≤q≤k-1)分割后背景与前景的累计概率,两者志合为1,其中估算I0、I1的概率密度函数表示为
Figure FDA0003517281090000034
其中
Figure FDA0003517281090000035
计算得到I0、I1的熵H0(q)、H1(q)后,得到使得Idst经阈值分割后的熵H(q)最大的q,H(q)=H0(q)+H1(q)。
For the image I dst to be processed, the entropy H 0 (q) and H 1 (q) of the background and foreground I 0 and I 1 obtained by dividing the threshold q are calculated respectively, and their expressions are respectively:
Figure FDA0003517281090000032
Figure FDA0003517281090000033
P 0 (q) and P 1 (q) respectively represent the cumulative probability of background and foreground after I dst is segmented by the threshold q (0≤q≤k-1), and the two are equal to 1, where I 0 and I 1 are estimated. The probability density function of is expressed as
Figure FDA0003517281090000034
in
Figure FDA0003517281090000035
After calculating the entropy H 0 (q) and H 1 (q) of I 0 and I 1 , obtain the q that maximizes the entropy H(q) after I dst is divided by the threshold, H(q)=H 0 (q) +H 1 (q).
7.根据权利要求6所述的基于图像传感器像素阵列的手机摄像头检测方法,其特征在于,还包括:7. The method for detecting a mobile phone camera based on an image sensor pixel array according to claim 6, further comprising: 按灰度值从高到低,从图像直方图上选取固定比例的像素点个数对应的灰度值得到基于直方图的目标分割阈值th,th=[p(gt>th)≤10%],其中gt为图像中各像素的灰度值,t表示图像中的各个像素点,p()表示图像Idst中满足条件像素点的概率值。According to the gray value from high to low, select the gray value corresponding to the number of pixels in a fixed proportion from the image histogram to obtain the target segmentation threshold th based on the histogram, th=[p(g t >th)≤10% ], where gt is the gray value of each pixel in the image, t represents each pixel in the image, and p() represents the probability value of the pixel that satisfies the condition in the image I dst . 8.根据权利要求1所述的基于图像传感器像素阵列的手机摄像头检测方法,其特征在于,获取完整高光区域,并通过目标摄像头的特征描述子进行目标判别对可疑目标的判别进行筛选,包括:8. the mobile phone camera detection method based on image sensor pixel array according to claim 1, is characterized in that, obtain complete highlight area, and carry out target discrimination by the feature descriptor of target camera and screen the discrimination of suspicious target, comprising: 从种子点开始将与种子点具有相同属性的相邻像素合并到同一区域,以实现区域扩增;From the seed point, the adjacent pixels with the same attributes as the seed point are merged into the same area to realize area amplification; 分别对增长区域的尺寸和中心灰度与外围灰度对比度进行限定,取Ri(Ri∈φ,i=1,2,3...t)中任意一个点作为种子点,种子点相邻像素进行判别,使停止区域增长。The size of the growth area and the contrast between the central grayscale and the peripheral grayscale are respectively defined, and any point in R i (R i ∈ φ, i=1, 2, 3...t) is taken as the seed point, and the seed point is similar to Neighboring pixels are discriminated to make the stop region grow. 9.根据权利要求8所述的基于图像传感器像素阵列的手机摄像头检测方法,其特征在于,获取完整高光区域包括:9. The mobile phone camera detection method based on an image sensor pixel array according to claim 8, wherein obtaining a complete highlight area comprises: 采用列灰度值的阈值将相应的灰度值转化为逻辑值0或1;Use the threshold of the column gray value to convert the corresponding gray value into a logical value of 0 or 1; 根据数据比特分辨率将获得的逻辑值下采样为比特信息;Down-sampling the obtained logic value into bit information according to the data bit resolution; 将检测到的数据帧头解码得到携带的数据信息以实现信号的解调。Decode the detected data frame header to obtain the carried data information to demodulate the signal. 10.一种根据权利要求1-9任一项所述的基于图像传感器像素阵列的手机摄像头检测方法的基于图像传感器像素阵列的手机摄像头检测装置,其特征在于,包括:10. A mobile phone camera detection device based on an image sensor pixel array according to the mobile phone camera detection method based on an image sensor pixel array according to any one of claims 1-9, characterized in that, comprising: 获取模块,用于获取外部红外光源主动照射前后图像中目标摄像头区域或灰度阶跃的特点实现目标检测并得到输入图像,其中使用EL-NIR图像与NL-NIR图像作为输入;The acquisition module is used to acquire the characteristics of the target camera area or grayscale steps in the images before and after the active irradiation of the external infrared light source to realize the target detection and obtain the input image, wherein the EL-NIR image and the NL-NIR image are used as input; 分割模块,用于对输入图像进行预处理以提高图像信噪比,使用直方图和图像熵的目标分割算法得到可疑目标种子点;The segmentation module is used to preprocess the input image to improve the signal-to-noise ratio of the image, and use the target segmentation algorithm of histogram and image entropy to obtain suspicious target seed points; 筛选模块,用于获取完整高光区域,并通过目标摄像头的特征描述子进行目标判别对可疑目标的判别进行筛选,其中,筛选过程包括对EL-NIR图像与NL-NIR图像进行图像差分获得差分图像实现初步背景抑制,使用形态学滤波提高真实目标在图像中的显著性,通过目标分割获取目标高光区域碎片,使用自适应区域增长获取目标完整高光区域;The screening module is used to obtain the complete highlight area, and perform target discrimination through the feature descriptor of the target camera to screen suspicious targets. The screening process includes performing image difference between the EL-NIR image and the NL-NIR image to obtain a differential image. Achieve preliminary background suppression, use morphological filtering to improve the saliency of the real target in the image, obtain target highlight area fragments through target segmentation, and use adaptive area growth to obtain the target complete highlight area; 检测模块,用于通过检测聚类算法确定目标重复检测情况,将检测结果以RGB彩色图像进行展示。The detection module is used to determine the repeated detection of the target through the detection clustering algorithm, and display the detection result as an RGB color image.
CN202210170072.5A 2022-02-23 2022-02-23 Mobile phone camera detection method and device based on image sensor pixel array Pending CN114554188A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210170072.5A CN114554188A (en) 2022-02-23 2022-02-23 Mobile phone camera detection method and device based on image sensor pixel array

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210170072.5A CN114554188A (en) 2022-02-23 2022-02-23 Mobile phone camera detection method and device based on image sensor pixel array

Publications (1)

Publication Number Publication Date
CN114554188A true CN114554188A (en) 2022-05-27

Family

ID=81677336

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210170072.5A Pending CN114554188A (en) 2022-02-23 2022-02-23 Mobile phone camera detection method and device based on image sensor pixel array

Country Status (1)

Country Link
CN (1) CN114554188A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115396660A (en) * 2022-07-08 2022-11-25 深圳市中西视通科技有限公司 Semi-reflective lens based camera finished product testing device and testing method
CN116027181A (en) * 2023-03-30 2023-04-28 浙江瑞测科技有限公司 Parallel image processing device and method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7009644B1 (en) * 1999-12-15 2006-03-07 Logitech Europe S.A. Dynamic anomalous pixel detection and correction
CN109544535A (en) * 2018-11-26 2019-03-29 马杰 It is a kind of that camera detection method and system are pried through based on infrared cutoff filter optical filtration characteristic

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7009644B1 (en) * 1999-12-15 2006-03-07 Logitech Europe S.A. Dynamic anomalous pixel detection and correction
CN109544535A (en) * 2018-11-26 2019-03-29 马杰 It is a kind of that camera detection method and system are pried through based on infrared cutoff filter optical filtration characteristic

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
张振山: ""基于手机摄像头的可见光通信关键技术研究"", 《中国优秀硕士学位论文全文数据库》, 15 August 2019 (2019-08-15), pages 3 *
林红;孙雅娟;: "形态学和信息熵在红外目标检测算法中的应用研究", 制造业自动化, no. 20, 25 October 2013 (2013-10-25) *
柯学: ""基于机器视觉的隐蔽摄像头检测与识别方法研究"", 《中国优秀硕士学位论文全文数据库》, 15 March 2020 (2020-03-15), pages 3 *
王文彬: ""基于机器视觉的智能手机摄像头模组组装线设计"", 《中国优秀硕士学位论文全文数据库》, 15 January 2021 (2021-01-15), pages 3 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115396660A (en) * 2022-07-08 2022-11-25 深圳市中西视通科技有限公司 Semi-reflective lens based camera finished product testing device and testing method
CN116027181A (en) * 2023-03-30 2023-04-28 浙江瑞测科技有限公司 Parallel image processing device and method
CN116027181B (en) * 2023-03-30 2023-07-18 浙江瑞测科技有限公司 Parallel image processing device and method

Similar Documents

Publication Publication Date Title
Yousif et al. Toward an optimized neutrosophic K-means with genetic algorithm for automatic vehicle license plate recognition (ONKM-AVLPR)
WO2018145470A1 (en) Image detection method and device
CN110415208B (en) An adaptive target detection method and its device, equipment and storage medium
WO2022099598A1 (en) Video dynamic target detection method based on relative statistical features of image pixels
CN109934224B (en) Small target detection method based on Markov random field and visual contrast mechanism
CN112364865B (en) A detection method for moving small objects in complex scenes
CN110335233B (en) Highway guardrail plate defect detection system and method based on image processing technology
WO2022121025A1 (en) Certificate category increase and decrease detection method and apparatus, readable storage medium, and terminal
WO2017135120A1 (en) Computationally efficient frame rate conversion system
CN111028263B (en) Moving object segmentation method and system based on optical flow color clustering
Zhu et al. Automatic object detection and segmentation from underwater images via saliency-based region merging
CN105447489B (en) A kind of character of picture OCR identifying system and background adhesion noise cancellation method
CN114554188A (en) Mobile phone camera detection method and device based on image sensor pixel array
CN116596899A (en) Method, device, terminal and medium for identifying circulating tumor cells based on fluorescence image
CN107992875B (en) A kind of well-marked target detection method based on image bandpass filtering
CN112329572B (en) Rapid static living body detection method and device based on frame and flash point
Tong et al. Document image binarization based on NFCM
CN113450373A (en) Optical live image-based real-time discrimination method for characteristic events in carrier rocket flight process
CN116485648A (en) Target identification method, device, electronic equipment and storage medium
Satish et al. Edge assisted fast binarization scheme for improved vehicle license plate recognition
CN110717500A (en) A method for initial positioning of two-dimensional barcode
Wu et al. Video surveillance object recognition based on shape and color features
Huang et al. An efficient method of license plate location in natural-scene image
Wei et al. Feature point screening for image matching
Zhao et al. IR saliency detection via a GCF-SB visual attention framework

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220527