CN114708232A - Image processing method and device, storage medium and electronic equipment - Google Patents
Image processing method and device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN114708232A CN114708232A CN202210375698.XA CN202210375698A CN114708232A CN 114708232 A CN114708232 A CN 114708232A CN 202210375698 A CN202210375698 A CN 202210375698A CN 114708232 A CN114708232 A CN 114708232A
- Authority
- CN
- China
- Prior art keywords
- light spot
- intensity
- spot
- light
- pixel
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/50—Depth or shape recovery
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Length Measuring Devices By Optical Means (AREA)
Abstract
Description
技术领域technical field
本申请涉及计算机技术领域,尤其涉及一种图像处理方法、装置、存储介质及电子设备。The present application relates to the field of computer technology, and in particular, to an image processing method, apparatus, storage medium, and electronic device.
背景技术Background technique
目前在三维成像场景中,主要基于双目相机、结果光法和飞行时间法来实现。以飞行时间法中的间接时间飞行法(iTOF法)为例,iTOF法是通过测量经过调制的发射光与接收光之间的相位关系,确定与待测目标之间距离的方法,其广泛应用在三维深度视觉相关的手势识别、人脸识别、三维建模、体感游戏、机器视觉、辅助对焦、安防、自动驾驶等相关应用场景下。At present, in the 3D imaging scene, it is mainly based on the binocular camera, the result light method and the time-of-flight method. Taking the indirect time-of-flight method (iTOF method) in the time-of-flight method as an example, the iTOF method is a method for determining the distance to the target to be measured by measuring the phase relationship between the modulated emitted light and the received light, and it is widely used. In 3D depth vision related gesture recognition, face recognition, 3D modeling, somatosensory games, machine vision, assisted focus, security, automatic driving and other related application scenarios.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种图像处理方法、装置、存储介质及电子设备,所述技术方案如下:Embodiments of the present application provide an image processing method, device, storage medium, and electronic device, and the technical solutions are as follows:
第一方面,本申请实施例提供了一种图像处理方法,所述方法包括:In a first aspect, an embodiment of the present application provides an image processing method, the method comprising:
获取反射强度图,确定所述反射强度图中的至少一个光斑;acquiring a reflection intensity map, and determining at least one light spot in the reflection intensity map;
获取所述光斑中光斑像素点对应的像素特征参数;obtaining the pixel characteristic parameters corresponding to the pixel points of the light spot in the light spot;
基于所述像素特征参数,从所述至少一个光斑中确定干扰光斑。Interfering light spots are determined from the at least one light spot based on the pixel characteristic parameters.
第二方面,本申请实施例提供了一种图像处理装置,所述装置包括:In a second aspect, an embodiment of the present application provides an image processing apparatus, and the apparatus includes:
光斑确定模块,用于获取反射强度图,确定所述反射强度图中的至少一个光斑;a light spot determination module, configured to acquire a reflection intensity map, and determine at least one light spot in the reflection intensity map;
参数获取模块,用于获取所述光斑中光斑像素点对应的像素特征参数;a parameter acquisition module, configured to acquire pixel characteristic parameters corresponding to the pixel points of the light spot in the light spot;
干扰确定模块,用于基于所述像素特征参数,从所述至少一个光斑中确定干扰光斑。An interference determination module, configured to determine an interference light spot from the at least one light spot based on the pixel characteristic parameter.
第三方面,本申请实施例提供一种计算机存储介质,所述计算机存储介质存储有多条指令,所述指令适于由处理器加载并执行上述的方法步骤。In a third aspect, an embodiment of the present application provides a computer storage medium, where the computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the above method steps.
第四方面,本申请实施例提供一种电子设备,可包括:处理器和存储器;其中,所述存储器存储有计算机程序,所述计算机程序适于由所述处理器加载并执行上述的方法步骤。In a fourth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein, the memory stores a computer program, and the computer program is adapted to be loaded by the processor and execute the above method steps .
本申请一些实施例提供的技术方案带来的有益效果至少包括:The beneficial effects brought by the technical solutions provided by some embodiments of the present application include at least:
在本申请一个或多个实施例中,通过获取反射强度图,确定反射强度图中的至少一个光斑,然后获取所述光斑中光斑像素点对应的像素特征参数,基于像素特征参数在干扰光斑与有效光斑上像素特征参数的差异,可以从至少一个光斑中准确确定干扰光斑,可以辅助消除由于多个光斑的边缘信号叠加造成的光斑干扰;整个图像干扰处理过程减轻了对诸如设备硬件、复杂算法的依赖,实现了准确识别光斑干扰,能够辅助输出高精度的深度测量结果,提升了深度测量场景下的鲁棒性。In one or more embodiments of the present application, by acquiring a reflection intensity map, at least one light spot in the reflection intensity map is determined, and then pixel feature parameters corresponding to the pixel points of the light spot in the light spot are obtained, and based on the pixel feature parameters, the difference between the interference light spot and the light spot is obtained. The difference of pixel characteristic parameters on the effective light spot can accurately determine the interference light spot from at least one light spot, which can help to eliminate the light spot interference caused by the superposition of the edge signals of multiple light spots; Relying on , realizes accurate identification of light spot interference, can assist in outputting high-precision depth measurement results, and improves the robustness in depth measurement scenarios.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1是本申请实施例提供的一种图像处理方法的流程示意图;1 is a schematic flowchart of an image processing method provided by an embodiment of the present application;
图2是本申请实施例提供的图像处理方法涉及的一种反射强度图中部分区域的示意图;2 is a schematic diagram of a partial area in a reflection intensity map involved in an image processing method provided by an embodiment of the present application;
图3是本申请实施例提供的图像处理方法涉及的一种涉及光斑干扰点的场景局部示意图;3 is a partial schematic diagram of a scene involving light spot interference points involved in the image processing method provided by the embodiment of the present application;
图4是本申请实施例提供的另一种图像处理方法的流程示意图;4 is a schematic flowchart of another image processing method provided by an embodiment of the present application;
图5是本申请实施例提供的另一种图像处理方法的流程示意图;5 is a schematic flowchart of another image processing method provided by an embodiment of the present application;
图6是本申请实施例提供的一种光斑的场景示意图;6 is a schematic diagram of a scene of a light spot provided by an embodiment of the present application;
图7是本申请实施例提供的一种涉及干扰光斑的场景示意图;7 is a schematic diagram of a scene involving interference light spots provided by an embodiment of the present application;
图8是本申请实施例提供的一种图像处理装置的结构示意图;FIG. 8 is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present application;
图9是本申请实施例提供的一种干扰确定模块的结构示意图;9 is a schematic structural diagram of an interference determination module provided by an embodiment of the present application;
图10是本申请实施例提供的另一种图像处理装置的结构示意图;10 is a schematic structural diagram of another image processing apparatus provided by an embodiment of the present application;
图11是本申请实施例提供的一种干扰验证模块的结构示意图;11 is a schematic structural diagram of an interference verification module provided by an embodiment of the present application;
图12是本申请实施例提供的一种电子设备的结构示意图;12 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图13是本申请实施例提供的操作系统和用户空间的结构示意图;13 is a schematic structural diagram of an operating system and a user space provided by an embodiment of the present application;
图14是图13中安卓操作系统的架构图;Figure 14 is an architecture diagram of the Android operating system in Figure 13;
图15是图13中IOS操作系统的架构图。FIG. 15 is an architectural diagram of the IOS operating system in FIG. 13 .
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
在本申请的描述中,需要理解的是,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。在本申请的描述中,需要说明的是,除非另有明确的规定和限定,“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本申请中的具体含义。此外,在本申请的描述中,除非另有说明,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。In the description of the present application, it should be understood that the terms "first", "second" and the like are used for descriptive purposes only, and should not be construed as indicating or implying relative importance. In the description of the present application, it should be noted that, unless otherwise expressly specified and defined, "including" and "having" and any modifications thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally also includes For other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood in specific situations. Also, in the description of the present application, unless otherwise specified, "a plurality" means two or more. "And/or", which describes the association relationship of the associated objects, means that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist at the same time, and B exists alone. The character "/" generally indicates that the associated objects are an "or" relationship.
下面结合具体的实施例对本申请进行详细说明。The present application will be described in detail below with reference to specific embodiments.
在一个实施例中,如图1所示,特提出了一种图像处理方法,该方法可依赖于计算机程序实现,可运行于基于冯诺依曼体系的图像处理装置上。该计算机程序可集成在应用中,也可作为独立的工具类应用运行。所述图像处理装置可以为终端,包括但不限于:个人电脑、平板电脑、手持设备、车载设备、可穿戴设备、计算设备或连接到无线调制解调器的其它处理设备等。在不同的网络中终端设备可以叫做不同的名称,例如:用户设备、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置、蜂窝电话、无绳电话、5G网络或未来演进网络中的终端设备等。In one embodiment, as shown in FIG. 1 , an image processing method is proposed, which can be implemented by relying on a computer program and can be run on an image processing device based on the von Neumann system. The computer program can be integrated into an application or run as a stand-alone utility application. The image processing apparatus may be a terminal, including but not limited to: a personal computer, a tablet computer, a handheld device, a vehicle-mounted device, a wearable device, a computing device, or other processing devices connected to a wireless modem. Terminal equipment may be called by different names in different networks, for example: user equipment, access terminal, subscriber unit, subscriber station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication Equipment, user agent or user equipment, cellular phone, cordless phone, terminal equipment in 5G network or future evolution network, etc.
具体的,该图像处理方法包括:Specifically, the image processing method includes:
S101:获取反射强度图,确定所述反射强度图中的至少一个光斑;S101: Obtain a reflection intensity map, and determine at least one light spot in the reflection intensity map;
所述反射强度图基于终端所搭载的TOF相机得到,TOF相机是使用飞行时间法3D成像的相机;终端通过TOF相机发出经调制的光束,遇到物体后反射,终端可以通过诸如TOF相机的感光元件(Sensor)接收经物体反射后的反射光信号,生成反射强度图。反射强度图可以用于反馈至少一个像素点对应的像素点强度,至少一个像素点对应接收的光能量正比于反射强度图中像素点的像素强度,也即像素点对应接收的光能量越强,该像素点的像素强度也越高。在实际应用场景中,终端通过TOF相机进行场景成像,可以得到当前场景下的深度图(目标场景深度距离图,也称Depth图)和反射强度图。The reflection intensity map is obtained based on the TOF camera mounted on the terminal. The TOF camera is a camera that uses the time-of-flight method for 3D imaging; the terminal emits a modulated light beam through the TOF camera, and when it encounters an object, it is reflected. The element (Sensor) receives the reflected light signal reflected by the object, and generates a reflection intensity map. The reflection intensity map can be used to feed back the pixel intensity corresponding to at least one pixel, and the light energy received corresponding to at least one pixel is proportional to the pixel intensity of the pixel in the reflection intensity map, that is, the stronger the light energy corresponding to the pixel is received, The pixel intensity of the pixel is also higher. In practical application scenarios, the terminal performs scene imaging through the TOF camera, and can obtain the depth map (target scene depth distance map, also called Depth map) and reflection intensity map in the current scene.
可以理解的,TOF相机基于飞行时间法3D成像,飞行时间法根据获取的信号结果的不同,可以分为直接飞行时间法(dTOF)和间接飞行时间法(iTOF),直接飞行时间法获取的信号结果是时间差,间接飞行时间法获取的信号结果是相位差;It is understandable that the TOF camera is based on the time-of-flight method for 3D imaging. The time-of-flight method can be divided into direct time-of-flight (dTOF) and indirect time-of-flight (iTOF) according to the obtained signal results. Signals obtained by the direct time-of-flight method The result is the time difference, and the result of the signal obtained by the indirect time-of-flight method is the phase difference;
可以理解的,TOF相机可以理解为集成在终端中的TOF模组,TOF模组通常包括光接收端(RX)和光发射端(TX);It can be understood that a TOF camera can be understood as a TOF module integrated in the terminal, and the TOF module usually includes a light receiving end (RX) and a light transmitting end (TX);
示意性的,光接收端通常包括镜头、窄带滤光片(例如940nm窄带滤光片)、TOF传感器等,光发射端通常包括垂直腔面发射激光器(Vertical-Cavity Surface-EmittingLaser,VCSEL)阵列、准直镜头、光学衍射元件(Diffractive Optical Elements,DOE)等,DOE可以是扩散器Diffuser。VCSEL阵列中的VCSEL均匀排列在一个平面上,用于发射具有二维规则图案的光束;准直镜头用于接收并汇聚光束,保证光束具有平行光路;DOE用于对经准直镜头处理后的光束进行散射,并按照一定视场角投射到所处场景的物体上,投射到物体上反射后被光接收端接收之后所形成的亮斑即为散斑。例如,VCSEL阵列通常包括至少两个VCSEL,且上述至少两个VCSEL均匀排列,在使用均匀排列的VCSEL发出光束时,可以得到规则均匀的散斑。Schematically, the light-receiving end usually includes a lens, a narrow-band filter (such as a 940nm narrow-band filter), a TOF sensor, etc., and the light-emitting end usually includes a Vertical-Cavity Surface-Emitting Laser (VCSEL) array, Collimating lens, Diffractive Optical Elements (DOE), etc., DOE can be a diffuser Diffuser. The VCSELs in the VCSEL array are evenly arranged on a plane, and are used to emit light beams with two-dimensional regular patterns; the collimating lens is used to receive and condense the light beams to ensure that the light beams have parallel light paths; DOE is used to The light beam is scattered and projected onto the object in the scene according to a certain field of view. The bright spot formed after being reflected on the object and received by the light receiving end is the speckle. For example, a VCSEL array usually includes at least two VCSELs, and the at least two VCSELs are uniformly arranged. When the uniformly arranged VCSELs are used to emit light beams, regular and uniform speckles can be obtained.
在实际应用中,通常将光发射端(RX)每个Pixel(像素)接收到的光强度值表征该像素(点)解算生成深度值的置信度,即Confidence。而反射强度图可以理解为用于反馈每个Pixel(像素)接收到的光强度值,在一些实施例中,反射强度图也可称之为置信度图(Confidence图),置信度图中的每个像素点的参数值以接收到信号光的强度来表征,进而作为该点目标距离测量值的置信度。In practical applications, the light intensity value received by each pixel (pixel) at the light emitting end (RX) is usually used to represent the confidence of the pixel (point) to generate a depth value, that is, Confidence. The reflection intensity map can be understood as being used to feed back the light intensity value received by each Pixel. In some embodiments, the reflection intensity map can also be called a confidence map (Confidence map). The parameter value of each pixel is characterized by the intensity of the received signal light, which is then used as the confidence of the measured value of the target distance at that point.
可选的,终端所搭载的TOF相机可以是支持散斑iTOF模式的器件,也即可作为散斑iTOF相机,终端通过TOF相机在散斑iTOF模式下由光发射端(TX)发射的调制红外光是若干束一束一束的光束,经场景目标物体反射后,RX端上接收到的是若干光斑,即深度图上被光斑照亮的区域才会存在有效的深度值,剩余区域都是无效值,若剩余这些区域出现了有效的深度值,则这区域出现的深度值像素点为干扰点,可以进行相应去除处理。在本申请中,可以通过执行所述图像处理方法,基于反射强度图准确识别出光斑干扰。Optionally, the TOF camera mounted on the terminal can be a device that supports the speckle iTOF mode, that is, it can be used as a speckle iTOF camera. Light is several beams of light beams. After being reflected by the target object in the scene, several light spots are received on the RX end, that is, the area illuminated by the light spot on the depth map has an effective depth value, and the remaining areas are all Invalid value, if there are valid depth values in the remaining areas, the depth value pixels in this area are interference points and can be removed accordingly. In the present application, speckle interference can be accurately identified based on the reflection intensity map by executing the image processing method.
可以理解的,经场景目标物体反射后,RX端上接收到的若干光斑实则是若干散斑,通常至少一个散斑会覆盖若干像素点,但每个散斑在深度图像、测距等应用场景中只对应生成一个有效深度值。It can be understood that after being reflected by the target object in the scene, several light spots received on the RX end are actually several speckles, usually at least one speckle will cover several pixels, but each speckle is used in depth images, ranging and other application scenarios. Only one valid depth value is generated in correspondence.
在一种可行的实施方式中,终端在获取到反射强度图之后,可以基于反射强度图中至少一个像素点的强度分布信息来确定至少一个光斑。In a feasible implementation manner, after acquiring the reflection intensity map, the terminal may determine at least one light spot based on the intensity distribution information of at least one pixel point in the reflection intensity map.
示意性的,通常反射强度图中光斑形态是呈现二维高斯形态,也即光斑中心强度高,光斑四周逐渐变弱;也就是说,可以基于反射强度图中的光斑形态可以识别出至少一个光斑。Schematically, usually, the shape of the spot in the reflection intensity graph is a two-dimensional Gaussian shape, that is, the intensity of the spot is high at the center and gradually weakens around the spot; that is, at least one spot can be identified based on the spot shape in the reflection intensity graph. .
S102:获取所述光斑中光斑像素点对应的像素特征参数;S102: Obtain pixel feature parameters corresponding to the pixel points of the light spot in the light spot;
示意性的,在反射强度图中至少一个光斑所处的区域可以覆盖到多个光斑像素点。如图2所示,图2是一种反射强度图中部分区域的示意图,在图2中,虚线圆形框可视作一个光斑,该虚线圆形框对应的光斑呈现二维高斯形态,也即光斑中心强度高,光斑四周逐渐变弱。图2中每个像素格可以视作一个像素点,虚线圆形框所覆盖的区域通常包含多个像素点,这些像素点也即光斑像素点。所述像素特征参数可以是光斑像素点的像素强度参数、像素位置参数等。像素特征参数基于反射强度图可以直接获取到。Illustratively, in the reflection intensity map, the region where at least one light spot is located may cover multiple light spot pixel points. As shown in Figure 2, Figure 2 is a schematic diagram of a part of the reflection intensity map. In Figure 2, the dotted circular frame can be regarded as a light spot, and the light spot corresponding to the dotted circular frame presents a two-dimensional Gaussian shape, which is also That is, the intensity of the center of the light spot is high, and the surrounding area of the light spot gradually becomes weaker. In Fig. 2, each pixel grid can be regarded as a pixel point, and the area covered by the dotted circle frame usually contains multiple pixel points, and these pixel points are also called light spot pixels. The pixel characteristic parameter may be a pixel intensity parameter, a pixel position parameter, and the like of the light spot pixel point. Pixel feature parameters can be directly obtained based on the reflection intensity map.
S103:基于所述像素特征参数,从所述至少一个光斑中确定干扰光斑。S103: Determine an interference light spot from the at least one light spot based on the pixel characteristic parameter.
可以理解的,由于反射回来的光束会产生发散(也即在反射强度图中一个光斑所覆盖多个像素点),在反射强度图中通常光斑的光斑形态是呈现二维高斯形态,中心光能量最强,也即图2中所示的光斑图像。而干扰光斑是由于至少两个光斑的发散边缘信号相互叠加产生,例如,若多个光斑距离较近,这些多个光斑的发散边缘信号会相互叠加,在这几个光斑之间形成一个“伪光斑”,这个“伪光斑”也符合二维高斯形态,但是接收到光能量远小于理论设计值,在后续应用场景中信噪比较差,实际应用场景中这些“伪光斑”由于也能生成一个大致的深度值会被误识别为一个光斑,但由于大多精度很差会对后端应用造成干扰,即为干扰点。It is understandable that since the reflected light beam will diverge (that is, a light spot covers multiple pixels in the reflection intensity map), the light spot shape of the light spot in the reflection intensity map is usually a two-dimensional Gaussian shape, and the central light energy The strongest, i.e. the spot image shown in Figure 2. The interference light spot is caused by the superposition of the divergent edge signals of at least two light spots. For example, if the distance between multiple light spots is relatively close, the divergent edge signals of these multiple light spots will be superimposed on each other, forming a "pseudo" between the light spots. Light spot", this "pseudo light spot" also conforms to the two-dimensional Gaussian shape, but the received light energy is much smaller than the theoretical design value, and the signal-to-noise ratio is poor in subsequent application scenarios. In practical application scenarios, these "pseudo light spots" can also be generated because A rough depth value will be mistakenly identified as a light spot, but because most of the poor precision will cause interference to the back-end application, that is, the interference point.
示意性的,例如由于镜头畸变、光信号发散等客观因素的存在,当至少两个光斑之间的间距较近时(如两两光斑之间的间距约为光斑中心区域间距的2倍)时,相互影响的光斑之间会出现一个“伪光斑”也即光斑干扰点,例如,如图3所示,图3是一种涉及光斑干扰点的场景局部示意图,在某实际应用场景下场景的某物体表面上实际对应有4个光斑,生成的4个光斑的光斑强度都很接近(在深度图(Depth图)或反射强度图中的数值相当),后端诸如虚拟现实、测距等应用场景会认为这4个光斑对应的区域表面是个平面,但这4个光斑之间由于信号发散(可以理解为由于出厂阶段硬件设计等原因,导致至少一个光斑可能在反射强度图中一个光斑实际覆盖多个像素点的情况)且至少两两光斑之间的边缘信号存在信号叠加现象,也就是说由于信号叠加现象会存在一个干扰光斑,如图3所示,图3所示的中间光斑实际为一个由于多个光斑之间边缘信号叠加产生的干扰光斑,通常将干扰光斑所覆盖区域中像素强度高的像素点可作为干扰光斑点,可以理解的,由于干扰光斑与实际光斑的参数相差较大(例如在深度图中的深度值、反射强度图中的像素强度值),后端应用场景下可能会将这5个点的表面拟合为一个曲面,造成严重的错误。可以基于此干扰光斑点对诸如深度图中对应位置的深度像素点的消除,以减小光斑干扰。Schematically, for example, due to the existence of objective factors such as lens distortion and optical signal divergence, when the distance between at least two light spots is relatively close (for example, the distance between two light spots is about twice the distance between the central areas of the light spots) , a "pseudo-spot", that is, a spot interference point, will appear between the mutually influencing spots. For example, as shown in Figure 3, Figure 3 is a partial schematic diagram of a scene involving spot interference points. There are actually 4 light spots on the surface of an object, and the light spot intensities of the generated 4 light spots are very close (the values in the depth map (Depth map) or reflection intensity map are equivalent), and the back-end applications such as virtual reality and ranging The scene will think that the surface of the area corresponding to these 4 light spots is a plane, but due to signal divergence between these 4 light spots (it can be understood that due to the hardware design at the factory stage, etc., at least one light spot may actually be covered by a light spot in the reflection intensity map. The case of multiple pixels) and at least the edge signals between the two light spots have a signal superposition phenomenon, that is to say, there will be an interference light spot due to the signal superposition phenomenon, as shown in Figure 3, the middle light spot shown in Figure 3 is actually An interference light spot caused by the superposition of edge signals between multiple light spots. Usually, the pixel with high pixel intensity in the area covered by the interference light spot can be used as the interference light spot. It is understandable that the parameters of the interference light spot and the actual light spot are quite different. (For example, the depth value in the depth map, the pixel intensity value in the reflection intensity map), in the back-end application scenario, the surface of these 5 points may be fitted to a surface, causing serious errors. Depth pixel points such as corresponding positions in the depth map can be eliminated based on the interference light spots, so as to reduce the light spot interference.
可以理解的,通过基于所述像素特征参数,对至少一个光斑进行干扰光斑检测,以检测出实际光斑与由于多个实际光斑的边缘光信号叠加产生的干扰光斑之间像素点所对应的像素特征参数(如像素强度参数、像素位置参数)的差异,基于此终端可以从至少一个光斑中确定干扰光斑;例如可以基于像素强度参数,对至少一个光斑进行干扰光斑强度检测,终端可以从至少一个光斑中确定干扰光斑;例如可以基于像素位置参数,对至少一个光斑进行干扰光斑强度检测,终端可以从至少一个光斑中确定干扰光斑;在实际应用场景中,终端通常可以从至少一个光斑中确定一个干扰光斑,基于实际应用场景将干扰光斑所覆盖的至少一个像素点作为干扰光斑。It can be understood that the interference spot detection is performed on at least one light spot based on the pixel characteristic parameters, so as to detect the pixel feature corresponding to the pixel point between the actual light spot and the interference light spot caused by the superposition of the edge light signals of multiple actual light spots. Differences in parameters (such as pixel intensity parameters, pixel position parameters), based on this, the terminal can determine the interference light spot from at least one light spot; for example, based on the pixel intensity parameter, the interference light spot intensity detection can be performed on at least one light spot, and the terminal can determine the interference light spot from at least one light spot. For example, based on the pixel position parameters, the intensity of at least one light spot can be detected by the interference light spot, and the terminal can determine the interference light spot from at least one light spot; in practical application scenarios, the terminal can usually determine an interference light spot from at least one light spot Light spot, based on the actual application scenario, at least one pixel point covered by the interference light spot is used as the interference light spot.
在本申请涉及的一个或多个实施例中,通过获取反射强度图,确定反射强度图中的至少一个光斑,然后获取所述光斑中光斑像素点对应的像素特征参数,基于像素特征参数在干扰光斑与有效光斑上像素特征参数的差异,可以从至少一个光斑中准确确定干扰光斑,可以辅助消除由于多个光斑的边缘信号叠加造成的光斑干扰;整个图像干扰处理过程减轻了对设备硬件、复杂算法的依赖,实现了准确识别光斑干扰,能够辅助输出高精度的深度测量结果,提升了深度测量场景下的鲁棒性。In one or more embodiments involved in the present application, by acquiring a reflection intensity map, at least one light spot in the reflection intensity map is determined, and then pixel feature parameters corresponding to the pixel points of the light spots in the light spot are obtained, and based on the pixel feature parameters, the interference The difference between the pixel characteristic parameters of the light spot and the effective light spot can accurately determine the interference light spot from at least one light spot, which can help to eliminate the light spot interference caused by the superposition of the edge signals of multiple light spots; The dependence of the algorithm realizes the accurate identification of light spot interference, can assist in the output of high-precision depth measurement results, and improve the robustness in depth measurement scenarios.
请参见图4,图4是本申请提出的一种图像处理方法的另一种实施例的流程示意图。具体的:Please refer to FIG. 4 , which is a schematic flowchart of another embodiment of an image processing method proposed in the present application. specific:
S201:获取反射强度图,确定所述反射强度图中的至少一个光斑;S201: Obtain a reflection intensity map, and determine at least one light spot in the reflection intensity map;
具体可参见本申请涉及一个或多个实施例的方法步骤,此处不再赘述。For details, reference may be made to the method steps involved in one or more embodiments of the present application, which will not be repeated here.
S202:获取所述光斑对应的光斑数量;若所述光斑数量大于数量阈值,则对相机曝光时间进行调整。S202: Acquire the number of light spots corresponding to the light spots; if the number of light spots is greater than a number threshold, adjust the exposure time of the camera.
根据一些实施例中,终端在获取到反射强度图之后,可以基于反射强度图中至少一个像素点的强度分布信息来确定至少一个光斑。According to some embodiments, after acquiring the reflection intensity map, the terminal may determine at least one light spot based on the intensity distribution information of at least one pixel point in the reflection intensity map.
示意性的,通常反射强度图中光斑形态是呈现二维高斯形态,也即光斑中心强度高,光斑四周逐渐变弱;也就是说,可以基于反射强度图中的光斑形态可以识别出至少一个光斑,然后对所有光斑的数量进行计算,可以得到光斑对应的光斑数量,也即反射强度图中光斑的光斑数量。可以理解的,所统计的光斑数量可能会存在干扰光斑。Schematically, usually, the shape of the spot in the reflection intensity graph is a two-dimensional Gaussian shape, that is, the intensity of the spot is high at the center and gradually weakens around the spot; that is, at least one spot can be identified based on the spot shape in the reflection intensity graph. , and then calculate the number of all light spots to obtain the number of light spots corresponding to the light spots, that is, the number of light spots in the reflection intensity graph. It is understandable that there may be interfering light spots in the counted number of light spots.
在本申请说明书中,数量阈值是用于衡量干扰光斑数量所产生影响设置的门限值。若检测出的光斑数量大于数量阈值,则可认为干扰光斑数量巨大,且这些干扰光斑能量通常也较大,在深度图中干扰光斑对应的干扰光斑点的深度值也较高。In the specification of this application, the number threshold is a threshold value set for measuring the influence caused by the number of interfering light spots. If the number of detected light spots is greater than the number threshold, it can be considered that the number of interference light spots is huge, and the energy of these interference light spots is usually large, and the depth value of the interference light spots corresponding to the interference light spots in the depth map is also high.
可以理解的,在实际应用场景中,终端所搭载的TOF相机可以是支持散斑iTOF模式的器件,如散斑iTOF相机;终端所搭载的TOF相机在设备出厂阶段,通常已经根据使用实际场景(目标探测距离、探测精度、目标物体反射率、是否在户外使用等)进行软硬件定制且软硬件调校完成,包括Sensor选型,光源设计(包括光源光功率、发光点排布)、镜头设计等软硬件方面。在出厂之后的终端使用阶段,终端基于某散斑iTOF模式下进行工作,某散斑iTOF模式下光接收端理论接收的光斑理论数量、光斑覆盖区域理论像素点数量等已经确定。例如,散斑iTOF相机在实际应用阶段之后,视场内理论会有多少个光斑,每个光斑理论会覆盖几个像素点,光斑对应理论的数量阈值通常已经设置完成,终端可以随之获取到。可选的,针对光斑的数量阈值通常大于理论光斑数量(也即实际光斑数量)。It is understandable that, in practical application scenarios, the TOF camera mounted on the terminal may be a device that supports the speckle iTOF mode, such as the speckle iTOF camera; the TOF camera mounted on the terminal is usually used according to the actual scene ( Target detection distance, detection accuracy, target object reflectivity, whether it is used outdoors, etc.) are customized for software and hardware, and the software and hardware are adjusted, including Sensor selection, light source design (including light source optical power, luminous point arrangement), and lens design. and other hardware and software. In the terminal use stage after leaving the factory, the terminal works based on a speckle iTOF mode, and the theoretical number of light spots received by the light receiving end in a speckle iTOF mode and the theoretical number of pixels in the coverage area of the light spot have been determined. For example, after the speckle iTOF camera is in the actual application stage, how many spots will theoretically be in the field of view, and each spot will theoretically cover several pixels. . Optionally, the threshold for the number of light spots is generally greater than the theoretical number of light spots (ie, the actual number of light spots).
在一种具体的实施场景中,若检测出的光斑数量大于数量阈值,则可认为干扰光斑数量巨大,且这些干扰光斑能量通常也较大,在深度图中干扰光斑对应的干扰光斑点的深度值也较高。此时一种可能的场景是终端整个TOF相机视场都是近距离的目标物体,即使是深度图或反射强度图中原本非光斑的区域,也能接收到由于近距离目标物体的光信号的散射光,且彼此之间产生的干扰光斑或干扰光斑点的数量较多、能量以及强度均较高。终端可以对相机曝光时间进行调整。在终端中通常会存在相机模块,如自动曝光(Auto Focus,AE)算法模块,终端可以基于反射强度图反馈的光斑数量情况向AE(Auto Focus自动曝光)算法模块发送指示信号,辅助AE(Auto Focus自动曝光)算法模块的过曝判断流程,在判断过曝时降低曝光时间,以保证近距离目标物体深度距离的测量。从而实现基于反射强度图中光斑数量实现一种光斑数量作为过曝判决条件,优化自动曝光流程,进一步增加了终端诸如iTOF相机的实用性。In a specific implementation scenario, if the number of detected light spots is greater than the number threshold, it can be considered that the number of interference light spots is huge, and the energy of these interference light spots is usually large, and the depth of the interference light spots corresponding to the interference light spots in the depth map value is also higher. At this time, a possible scenario is that the entire field of view of the TOF camera of the terminal is a close-range target object. Even the original non-spot area in the depth map or reflection intensity map can receive the light signal due to the close-range target object. Scattered light, and the interference light spots or interference light spots generated by each other are more in number, energy and intensity are higher. The terminal can adjust the camera exposure time. There is usually a camera module in the terminal, such as the automatic exposure (Auto Focus, AE) algorithm module. The terminal can send an indication signal to the AE (Auto Focus automatic exposure) algorithm module based on the number of light spots fed back by the reflection intensity map, assisting the AE (Auto Focus) algorithm module. Focus automatic exposure) algorithm module overexposure judgment process, reduce the exposure time when judging overexposure, in order to ensure the measurement of the depth and distance of the close target object. Thereby, a number of light spots in the reflection intensity map can be realized as an overexposure judgment condition, the automatic exposure process is optimized, and the practicability of a terminal such as an iTOF camera is further increased.
可选的,终端执行对相机曝光时间进行调整之后,可以执行所述获取反射强度图,确定所述反射强度图中的至少一个光斑的步骤,也即完成对相机曝光时间之后,再重新获取反射强度图,以实现干扰优化,优化实际应用场景下的优化效果。Optionally, after adjusting the exposure time of the camera, the terminal may perform the step of acquiring the reflection intensity map, and determining at least one light spot in the reflection intensity map, that is, after completing the exposure time of the camera, re-acquiring the reflection intensity. Intensity map to achieve interference optimization and optimize the optimization effect in practical application scenarios.
S203:获取所述光斑中光斑像素点对应的像素特征参数;S203: Obtain pixel feature parameters corresponding to the pixel points of the light spot in the light spot;
具体可参见本申请涉及一个或多个实施例的方法步骤,此处不再赘述。For details, reference may be made to the method steps involved in one or more embodiments of the present application, which will not be repeated here.
S204:确定针对反射强度图的至少一种光斑干扰检测方式。S204: Determine at least one spot interference detection method for the reflection intensity map.
在一种具体的实施场景中,可以获取当前的应用场景,不同的应用场景对应不同的光斑干扰检测方式组合(组合中包含至少一种光斑干扰检测方式),在不同的应用场景下对于测量精度、干扰适应性等需求不同,预先可以基于不同的参考应用场景设置不同的参考光斑干扰检测方式组合,也即建立至少一个参考应用场景与其对应参考光斑干扰检测方式组合的干扰检测组合映射关系,实际应用中,在确定当前的应用场景之后,可以基于前述干扰检测组合映射关系,确定当前的应用场景下的光斑干扰检测方式组合,以基于光斑干扰检测方式组合确定针对反射强度图的至少一种光斑干扰检测方式。In a specific implementation scenario, the current application scenario can be obtained, and different application scenarios correspond to different combinations of light spot interference detection methods (the combination includes at least one light spot interference detection method). , interference adaptability and other requirements, different reference spot interference detection method combinations can be set in advance based on different reference application scenarios, that is, the interference detection combination mapping relationship of at least one reference application scenario and its corresponding reference spot interference detection method combination is established. In the application, after the current application scenario is determined, the combination of light spot interference detection methods in the current application scenario can be determined based on the aforementioned interference detection combination mapping relationship, and at least one light spot for the reflection intensity map can be determined based on the light spot interference detection method combination. Interference detection method.
示意性的,干扰检测组合映射关系可以是以映射组合、映射列表、映射数组等形式进行表征,此处不作具体限定。Illustratively, the interference detection combination mapping relationship may be represented in the form of a mapping combination, a mapping list, a mapping array, etc., which is not specifically limited here.
示意性的,不同的参考应用场景可以是终端涉及的远距离深度测量、虚拟现实应用、视觉环境重建、虚拟现实游戏、平面检测等类型下的应用场景。Illustratively, different reference application scenarios may be application scenarios involving remote depth measurement, virtual reality applications, visual environment reconstruction, virtual reality games, plane detection, etc. involved in the terminal.
可选的,所述光斑干扰检测方式包括但不限于像素点强度检测方式、能量比例检测方式、像素点均值检测方式、能量总强度检测方式、光斑位置检测方式等检测方式中的一种或多种的拟合。Optionally, the light spot interference detection method includes but is not limited to one or more detection methods such as pixel point intensity detection method, energy ratio detection method, pixel point average value detection method, total energy intensity detection method, and spot position detection method. species fit.
可选的,在确定当前应用场景下的光斑干扰检测方式为至少两个的情况下,至少一个光斑干扰检测方式之间的检测时序不作限制,至少一个光斑干扰检测方式可以同步执行也可以异步执行。Optionally, when it is determined that there are at least two light spot interference detection methods in the current application scenario, the detection timing between at least one light spot interference detection method is not limited, and at least one light spot interference detection method can be executed synchronously or asynchronously. .
可选的,在确定当前应用场景下的光斑干扰检测方式为至少一种的情况下,基于每一种光斑干扰检测方式可得到相应的干扰光斑,干扰光斑或干扰光斑对应的干扰光斑点是否去除可结合实际场景下所设置的干扰光斑去除策略进行去除。例如,可以结合多种光斑干扰检测方式得到多个干扰光斑(如第一干扰光斑、第二干扰光斑、第三干扰光斑、第四干扰光斑、第五干扰光斑等),可以对这些干扰光斑取交集,例如基于实际应用场景下设置的干扰光斑去除策略,某一光斑同时被检测为属于“第一干扰光斑、第二干扰光斑、第三干扰光斑、第四干扰光斑、第五干扰光斑”,则将该某一光斑去除。Optionally, when it is determined that the light spot interference detection method in the current application scenario is at least one, a corresponding interference light spot can be obtained based on each light spot interference detection method, and whether the interference light spot or the interference light spot corresponding to the interference light spot is removed. It can be removed in combination with the interference spot removal strategy set in the actual scene. For example, multiple interference light spots (such as the first interference light spot, the second interference light spot, the third interference light spot, the fourth interference light spot, the fifth interference light spot, etc.) can be obtained by combining a variety of light spot interference detection methods. Intersection, for example, based on the interference spot removal strategy set in the actual application scenario, a certain spot is simultaneously detected as belonging to "the first interference spot, the second interference spot, the third interference spot, the fourth interference spot, and the fifth interference spot", Then remove the certain spot.
S205:基于所述像素特征参数采用所述光斑干扰检测方式对至少一个所述光斑进行光斑干扰检测处理,得到干扰光斑。S205: Perform a spot interference detection process on at least one of the light spots by using the light spot interference detection method based on the pixel characteristic parameters, to obtain an interference light spot.
在一种可行的实施方式中,光斑干扰检测方式可以是像素点强度检测方式,通过对光斑像素点的像素点强度进行检测,以从识别出的多个光斑中区分出干扰光斑。在实际应用场景中,例如通过散斑iTOF相机的光接收端来得到当前视场下的反射强度图,其中,反射强度图中所有实际光斑覆盖像素点数量占整个反射强度图中像素点数量的比例通常比较小,例如大约在百分之几到百分之十几。在实际光斑未覆盖到的区域,反射强度图或深度图中像素点的值或者说像素强度值(也即Confidence值)并不是0,这是由于环境光、电路、暗电路等噪声的存在导致的。但这些实际光斑未覆盖到的区域像素强度值(也即Confidence值)通常很低(即使存在干扰光斑的情况下通常干扰光斑像素强度值要远低于实际光斑的像素强度值),在一些场景下,干扰光斑或边缘区域比实际光斑信号光的像素强度值(也即Confidence值)低一个到几个数量级。基于此,可对反射强度图中识别出的所有光斑所覆盖的光斑像素点对应的光斑强度参数进行检测,以此了从识别出的光斑中确定干扰光斑,也即确定干扰光斑点。In a feasible implementation manner, the light spot interference detection method may be a pixel point intensity detection method. By detecting the pixel point intensity of the light spot pixel points, the interference light spots are distinguished from the identified multiple light spots. In practical application scenarios, for example, the light receiving end of the speckle iTOF camera is used to obtain the reflection intensity map in the current field of view. The ratio is usually relatively small, such as about a few percent to ten percent. In the area not covered by the actual light spot, the value of the pixel in the reflection intensity map or the depth map or the pixel intensity value (that is, the Confidence value) is not 0. This is due to the existence of noise such as ambient light, circuits, and dark circuits. of. However, the pixel intensity value (that is, the Confidence value) of the area not covered by these actual light spots is usually very low (even if there is interference light spot, the pixel intensity value of the interference light spot is usually much lower than the pixel intensity value of the actual light spot), in some scenes Under these conditions, the interference spot or edge area is one to several orders of magnitude lower than the pixel intensity value (ie, the Confidence value) of the actual spot signal light. Based on this, the spot intensity parameters corresponding to the spot pixels covered by all the spots identified in the reflection intensity map can be detected, so as to determine the interference spot from the identified spots, that is, determine the disturbance spot.
可以理解的,终端确定光斑干扰检测方式之后,若所述光斑干扰检测方式为像素点强度检测方式,则终端可以基于像素强度参数对至少一个光斑进行像素点强度检测处理,以此得到第一干扰光斑;所述第一干扰光斑也即通过像素点强度检测方式检测出的干扰光斑。It can be understood that after the terminal determines the light spot interference detection method, if the light spot interference detection method is the pixel intensity detection method, the terminal can perform pixel intensity detection processing on at least one light spot based on the pixel intensity parameter, so as to obtain the first interference. Light spot; the first interference light spot is the interference light spot detected by the pixel intensity detection method.
可选的,像素点强度检测方式具体可以是绘制强度统计图,如表征像素点强度的强度直方图,强度直方图可以用于表征所有光斑所覆盖的光斑像素点的像素强度情况,例如可以反馈相同像素强度值的光斑像素点,例如可以反馈各光斑像素点的强度优先级。Optionally, the pixel intensity detection method may specifically be to draw an intensity statistics map, such as an intensity histogram representing the intensity of the pixel point, and the intensity histogram can be used to represent the pixel intensity of the pixel points of the light spot covered by all the light spots, for example, it can be fed back. For spot pixels with the same pixel intensity value, for example, the intensity priority of each spot pixel can be fed back.
可以理解的,在出厂之后的终端使用阶段,终端基于某散斑iTOF模式下进行工作,某散斑iTOF模式下光接收端理论接收的光斑理论数量、光斑覆盖区域理论像素点数量等已经确定。例如,散斑iTOF相机在实际应用阶段之后,视场内理论会有多少个光斑,光斑理论会覆盖几个像素点;进一步,由于预先理论光斑像素点(不含干扰点)的目标光斑点数量可确定,或,理论光斑像素点(不含干扰点)的目标光斑点占比(理论光斑像素点与图总像素点的比例)可确定。基于此,像素点强度检测时仅需从所有光斑像素点中确定目标光斑点占比或目标光斑点数量指示的参考光斑点(一些实施例可称之为第一光斑点获第二光斑点),将参考光斑点对应的光斑强度参数作为阈值进行干扰点筛选即可。It is understandable that in the terminal use stage after leaving the factory, the terminal works based on a speckle iTOF mode, and the theoretical number of light spots received by the light receiving end in a speckle iTOF mode and the theoretical number of pixels in the coverage area of the light spot have been determined. For example, after the speckle iTOF camera is in the actual application stage, how many spots will theoretically be in the field of view, and how many pixels will be covered by the theory of the spot; It can be determined, or, the target light spot ratio (the ratio of the theoretical light spot pixel points to the total image pixel points) of the theoretical light spot pixel points (excluding interference points) can be determined. Based on this, it is only necessary to determine the proportion of target light spots or the reference light spots indicated by the number of target light spots from all the light spot pixels during pixel intensity detection (in some embodiments, it may be referred to as the first light spot and the second light spot) , the light spot intensity parameter corresponding to the reference light spot can be used as the threshold to filter the interference points.
在一种可行的实施方式中,光斑干扰检测方式可以是能量比例检测方式,通过对光斑所包含像素点的能量比例进行检测,以从识别出的多个光斑中区分出干扰光斑。示意性的,能量比例检测方式可以遍历至少一个光斑,计算光斑中心像素点像素强度参数(也即Confidence值)与光斑除光斑中心点之外该光斑的其他像素点Confidence值的能量比例,通常实际光斑的信号光能量集中,其能量比例会大于干扰光斑。In a feasible implementation manner, the light spot interference detection method may be an energy ratio detection method. By detecting the energy ratio of the pixel points included in the light spot, the interference light spot can be distinguished from the identified multiple light spots. Illustratively, the energy ratio detection method can traverse at least one spot, and calculate the energy ratio of the pixel intensity parameter (that is, the Confidence value) of the pixel at the center of the spot and the Confidence value of other pixels of the spot except the center of the spot. The signal light energy of the spot is concentrated, and its energy ratio will be greater than that of the interference spot.
可以理解的,终端确定光斑干扰检测方式之后,若所述光斑干扰检测方式为能量比例检测方式,则终端可以基于所述像素强度参数对至少一个光斑进行能量比例检测处理,以此得到第二干扰光斑;所述第二干扰光斑也即通过能量比例检测方式检测出的干扰光斑。示意性的,通常可以是对相邻的两两光斑计算能量比例,然后比较两两光斑的能量比例,通常若某光斑为干扰光斑,实际光斑的能量比例要远大于邻近的干扰光斑。It can be understood that after the terminal determines the light spot interference detection method, if the light spot interference detection method is the energy proportional detection method, the terminal can perform energy proportional detection processing on at least one light spot based on the pixel intensity parameter, so as to obtain the second interference. Light spot; the second interference light spot is the interference light spot detected by the energy proportional detection method. Illustratively, it is usually possible to calculate the energy ratio of adjacent pairs of light spots, and then compare the energy ratio of each pair of light spots. Usually, if a certain light spot is an interference light spot, the actual energy ratio of the light spot is much larger than that of the adjacent interference light spots.
在一种可行的实施方式中,光斑干扰检测方式可以是像素点均值检测方式,像素点均值检测方式可以是检测“某一光斑覆盖到反射强度图中所有像素点像素强度参数(如Confidence值)之和”与“该光斑一定邻域范围内所有像素点像素强度参数(如Confidence值)之和”的比值,以将该比值作为像素点均值;In a feasible implementation manner, the light spot interference detection method may be the pixel point average detection method, and the pixel point average detection method may be to detect "a certain light spot covers all pixels in the reflection intensity map. The pixel intensity parameter (such as the Confidence value) The ratio of the "sum" to "the sum of all pixel intensity parameters (such as the Confidence value) of all pixels within a certain neighborhood of the spot", to use the ratio as the pixel mean;
可选的,像素点均值检测方式可以是“光斑像素强度参数(如Confidence值)之和除以覆盖到像素点数的平均值”与“该光斑一定邻域范围内所有像素点的光斑像素强度参数(如Confidence值)除以覆盖到像素点数的平均值”的比值,以将该比值作为像素点均值;通常比值越小,该光斑为干扰光斑的可能性越大Optionally, the pixel point mean detection method can be "the sum of the pixel intensity parameters of the spot (such as the Confidence value) divided by the average value of the number of pixels covered" and "the spot pixel intensity parameter of all pixels within a certain neighborhood range of the spot. (such as the Confidence value) divided by the ratio of "the average value of the number of pixels covered" to use the ratio as the average value of the pixel points; generally, the smaller the ratio, the greater the possibility that the light spot is an interference light spot
可以理解的,终端确定光斑干扰检测方式之后,若所述光斑干扰检测方式为像素点均值检测方式,则终端基于所述像素强度参数对至少一个光斑进行像素点均值检测处理,以此从多个光斑中得到第三干扰光斑;例如像素点均值检测处理之后得到光斑的像素点均值,然后将像素点均值与均值阈值进行比较,以此从多个光斑中确定干扰光斑,也即确定干扰光斑点。It can be understood that, after the terminal determines the light spot interference detection method, if the light spot interference detection method is the pixel point average detection method, the terminal performs pixel point average detection processing on at least one light spot based on the pixel intensity parameter, so as to obtain information from multiple light spots. The third interference light spot is obtained from the light spot; for example, the pixel average value of the light spot is obtained after the pixel point average detection processing, and then the pixel average value is compared with the average threshold value, so as to determine the interference light spot from multiple light spots, that is, determine the interference light spot .
在一种可行的实施方式中,光斑干扰检测方式可以是能量总强度检测方式,通常在反射强度图对应的至少一个小范围区域内,在该小范围区域理论光斑的数量预先可设置,且该小范围区域内多个实际光斑(不含干扰光斑)彼此总能量应相当,如该小范围区域对应视觉场景中的目标对象的某一个二维平面,而产生的干扰光斑的总能量要远小于该小范围区域内实际光斑。示意性的,可不确定某个小范围区域,通常反射能量图中光斑数量较多,一个光斑通常处理之后仅对应诸如深度图中的一个像素点的参数值,也就是说可以设置任取n(n通常是一个较小值)个相邻光斑进行比较。In a feasible implementation manner, the light spot interference detection method may be a total energy intensity detection method. Usually, in at least one small area corresponding to the reflection intensity map, the number of theoretical light spots in the small area can be preset in advance, and the The total energy of multiple actual light spots (excluding interference light spots) in a small area should be equal to each other. For example, the small area corresponds to a two-dimensional plane of the target object in the visual scene, and the total energy of the interference light spots is much less than The actual spot in this small area. Schematically, a small area may not be determined. Usually, the number of light spots in the reflected energy map is large, and a light spot usually only corresponds to the parameter value of one pixel in the depth map after processing, that is to say, you can set any value of n( n is usually a small value) adjacent spots are compared.
可以理解的,终端确定光斑干扰检测方式之后,若所述光斑干扰检测方式为能量总强度检测方式,则终端基于所述像素强度参数对至少一个光斑进行能量总强度检测处理,得到第四干扰光斑;例如能量总强度检测处理之后得到多个光斑的能量总强度,然后将至少一个光斑的能量总强度进行比较,当某一光斑的能量总强度较小时,较小能量总强度指示的光斑可作为干扰光斑,也即可将可将干扰光斑所覆盖的所有像素点中的至少其一确定为干扰光斑点,例如将干扰光斑所覆盖的最大像素强度参数指示的像素点作为干扰光斑点。It can be understood that after the terminal determines the light spot interference detection method, if the light spot interference detection method is the total energy intensity detection method, the terminal performs total energy intensity detection processing on at least one light spot based on the pixel intensity parameter to obtain a fourth interference light spot. ; For example, after the total energy intensity detection processing, the total energy intensity of multiple light spots is obtained, and then the total energy intensity of at least one light spot is compared. When the total energy intensity of a certain light spot is small, the light spot indicated by the smaller total energy intensity can be used as For the interference light spot, at least one of all the pixel points covered by the interference light spot can be determined as the interference light spot, for example, the pixel point indicated by the maximum pixel intensity parameter covered by the interference light spot is used as the interference light spot.
在一种可行的实施方式中,光斑干扰检测方式可以是光斑位置检测方式,也可理解为固定位置检测,根据一些实施例中,散斑iTOF相机在出厂阶段,光斑在光接收端得到的反射强度图上的位置通常比较固定,但可能会由于远近距离视差、信发散等客观原因发生几个像素的偏移,基于此,可以在出厂阶段设置光斑的位置范围,将至少一个光斑的位置范围记录下来,若光斑出现在这些位置以外,大概率为干扰光斑。In a feasible implementation manner, the speckle interference detection method may be a light spot position detection method, which can also be understood as a fixed position detection. The position on the intensity map is usually relatively fixed, but it may be offset by several pixels due to objective reasons such as distance and distance parallax, signal divergence, etc. Based on this, the position range of the light spot can be set at the factory, and the position range of at least one light spot can be set. Record, if the spot appears outside these positions, there is a high probability of disturbing the spot.
可以理解的,终端确定光斑干扰检测方式之后,若所述光斑干扰检测方式为光斑位置检测方式,则终端可以基于像素位置参数对至少一个光斑进行光斑位置检测处理,得到第五干扰光斑。例如光斑位置检测处理时得到多个光斑的光斑位置,将该光斑的光斑位置与其对应的位置范围进行匹配,以此可以从多个光斑中确定干扰光斑。It can be understood that, after the terminal determines the light spot interference detection method, if the light spot interference detection method is the light spot position detection method, the terminal can perform light spot position detection processing on at least one light spot based on the pixel position parameter to obtain a fifth interference light spot. For example, in the light spot position detection process, the light spot positions of multiple light spots are obtained, and the light spot positions of the light spots are matched with their corresponding position ranges, so that the interference light spots can be determined from the plurality of light spots.
在一些实施例,终端在确定干扰光斑之后,对干扰光斑进行干扰消除处理。示意性的,终端基于反射强度图中的Confidence信息确定干扰光斑后,可以在反射强度图中去除干扰光斑所包含的至少一个像素点,如对整个干扰光斑进行去除。示意性的,终端确定干扰光斑后,可以基于干扰光斑的位置确定该干扰光斑在深度图中的干扰位置,以对深度图进行干扰光斑消除。In some embodiments, after determining the interference light spot, the terminal performs interference cancellation processing on the interference light spot. Illustratively, after determining the interference light spot based on the Confidence information in the reflection intensity map, the terminal may remove at least one pixel point included in the interference light spot in the reflection intensity map, such as removing the entire interference light spot. Illustratively, after determining the interference light spot, the terminal may determine the interference position of the interference light spot in the depth map based on the position of the interference light spot, so as to eliminate the interference light spot on the depth map.
在一种可行的实施场景中,在确定干扰光斑之后,还可以结合诸如RGB等彩色图像和深度图像对干扰光斑进行干扰验证,以确定该干扰光斑是否为正确的干扰点。In a feasible implementation scenario, after the interference light spot is determined, the interference light spot can also be verified by combining a color image such as RGB and a depth image to determine whether the interference light spot is a correct interference spot.
可以理解的,终端可以获取彩色图像和深度图像,所述反射强度图、所述深度图像和所述彩色图像为针对同一目标对象的不同类图像;也就是说,终端在针对当前场景中的目标对象进行成像时,终端可以同时拍摄针对同一目标对象的反射强度图、所述深度图和所述彩色图像,彩色图像通常可以是RGB图像。在确定干扰光斑之后,然后获取拍摄的彩色图像。It can be understood that the terminal can obtain a color image and a depth image, and the reflection intensity map, the depth image, and the color image are different types of images for the same target object; that is, the terminal is targeting the target in the current scene. When imaging an object, the terminal may simultaneously capture the reflection intensity map, the depth map and the color image for the same target object, and the color image may usually be an RGB image. After identifying the interfering light spot, the captured color image is then acquired.
可以理解的,终端可以确定干扰光斑在深度图像中的第一位置,以及可以确定所述干扰光斑对应的至少一个邻近光斑在所述深度图像中的第二位置;基于所述第一位置以及所述第二位置,得到针对所述干扰光斑的深度像素验证结果。It can be understood that the terminal can determine the first position of the interference light spot in the depth image, and can determine the second position of at least one adjacent light spot corresponding to the interference light spot in the depth image; based on the first position and the The second position is used to obtain a depth pixel verification result for the interference light spot.
可以理解的,终端再确定所述干扰光斑在所述彩色图像中的第三位置,以及确定所述干扰光斑对应的至少一个邻近光斑在所述彩色图像中的第四位置;基于所述第三位置以及所述第四位置,得到针对所述干扰光斑的彩色像素验证结果;It is understandable that the terminal then determines the third position of the interference light spot in the color image, and determines the fourth position of at least one adjacent light spot corresponding to the interference light spot in the color image; position and the fourth position, obtain the color pixel verification result for the interference light spot;
示意性的,在反射强度图中,至少一个光斑通常会覆盖多个光斑像素点,而在深度图像以及彩色图像通常仅对应一个像素点;Illustratively, in the reflection intensity map, at least one light spot usually covers multiple light spot pixels, while in the depth image and color image, it usually corresponds to only one pixel;
示意性的,一个光斑可能覆盖多个像素点,但该光斑只在光斑某个像素位置(如光斑重心像素点)解算生成一个深度值,该深度值在深度图像中表征该光斑所处邻近小区域的深度距离值;例如:可以是在原始图像(RAW图像,TOF相机输出的原始图像)中结合光斑所覆盖所有像素点的原始信息,取光斑的重心位置对应的光斑重心像素点来生成一个有效深度值,有效深度值会基于光斑覆盖所有像素点的原始信息来计算一个深度值。Illustratively, a light spot may cover multiple pixels, but the light spot is only calculated at a certain pixel position of the light spot (such as the pixel point of the center of gravity of the light spot) to generate a depth value, which represents the proximity of the light spot in the depth image. The depth distance value of a small area; for example, it can be generated by combining the original information of all pixels covered by the light spot in the original image (RAW image, the original image output by the TOF camera), and taking the pixel point corresponding to the center of gravity of the light spot. An effective depth value. The effective depth value calculates a depth value based on the original information that the spot covers all pixels.
示意性的,通常在确定干扰光斑之后即可确定其在深度图像中的位置,也即第一位置,也即取干扰光斑对应有效深度值的位置作为第一位置(通常为干扰光斑的最大像素强度指示的像素点对应深度图像中的位置)。Schematically, usually after the interference spot is determined, its position in the depth image, that is, the first position, that is, the position of the interference spot corresponding to the effective depth value is taken as the first position (usually the largest pixel of the interference spot). The pixels indicated by the intensity correspond to the positions in the depth image).
进一步的,深度图像通常由设备的TOF相机拍摄得到,彩色图像诸如RGB图像通常由设备的RGB相机拍摄得到,通过对RGB相机和TOF相机的标定,可以确定深度图像和彩色图像之间的坐标变换关系(可以是以图像坐标变换式的形式存在),终端确定干扰光斑之后,获取干扰光斑在深度图像中对应的干扰光斑点,将该干扰光斑点在深度图像中的位置作为第一位置;然后基于前述深度图像中第一位置根据坐标变换关系确定干扰光斑在彩色图像中的第三位置;同理,获取干扰光斑对应的至少一个邻近光斑,然后可以参照前述方式,获取至少一个邻近光斑在深度图像中对应的邻近光斑点,将该邻近光斑点在深度图像中的位置作为第二位置;然后基于第二位置根据坐标变换关系确定邻近光斑在彩色图像中的第四位置;可以理解的,在干扰光斑对应的邻近光斑的数量为多个的情况下,则按照前述方式获取至少一个邻近光斑在深度图像中的第二位置以及在彩色图像中的第四位置。Further, depth images are usually captured by the TOF camera of the device, and color images such as RGB images are usually captured by the RGB camera of the device. By calibrating the RGB camera and the TOF camera, the coordinate transformation between the depth image and the color image can be determined. relationship (which can exist in the form of image coordinate transformation), after the terminal determines the interference light spot, obtains the interference light spot corresponding to the interference light spot in the depth image, and takes the position of the interference light spot in the depth image as the first position; then; Based on the first position in the aforementioned depth image, determine the third position of the interference light spot in the color image according to the coordinate transformation relationship; in the same way, obtain at least one adjacent light spot corresponding to the interference light spot, and then obtain the depth of the at least one adjacent light spot by referring to the foregoing method. For the corresponding adjacent light spot in the image, the position of the adjacent light spot in the depth image is taken as the second position; then based on the second position, the fourth position of the adjacent light spot in the color image is determined according to the coordinate transformation relationship; When the number of adjacent light spots corresponding to the interference light spot is multiple, the second position of at least one adjacent light spot in the depth image and the fourth position in the color image are acquired in the aforementioned manner.
可选的,至少一个邻近光斑与干扰光斑的位置关系为相邻关系,邻近光斑的数量可以是预设个数。可以在深度图像中获取邻近光斑对应的邻近像素点所处的第二位置,基于邻近像素点的第二位置根据图像坐标系变换关系确定邻近光斑在彩色图像中的第四位置;Optionally, the positional relationship between at least one adjacent light spot and the interference light spot is an adjacent relationship, and the number of adjacent light spots may be a preset number. The second position of the adjacent pixel point corresponding to the adjacent light spot can be obtained in the depth image, and based on the second position of the adjacent pixel point, the fourth position of the adjacent light spot in the color image is determined according to the transformation relationship of the image coordinate system;
在实际应用中:诸如RGB图像等彩色图像的分辨率较高,且可以提供彩色信息;深度图像可以提供深度信息。如果前述步骤判断为干扰光斑,可以对干扰光斑进行干扰验证。具体实施中:可以在深度图像中找到干扰光斑对应干扰光斑点所处的第一位置,以及在深度图像中找到邻近光斑对应邻近光斑点所处的第二位置,然后在RGB图像上找到干扰光斑对应干扰光斑点所处的第三位置以及该干扰光斑对应的邻近光斑在RGB图像的邻近光斑点所处的第四位置;In practical applications: color images such as RGB images have higher resolution and can provide color information; depth images can provide depth information. If it is determined as an interference light spot in the preceding steps, the interference verification can be performed on the interference light spot. In the specific implementation, the first position of the interference light spot corresponding to the interference light spot can be found in the depth image, and the second position of the adjacent light spot corresponding to the adjacent light spot can be found in the depth image, and then the interference light spot can be found on the RGB image. The third position corresponding to the interference light spot and the fourth position of the adjacent light spot corresponding to the interference light spot in the adjacent light spot of the RGB image;
示意性的,干扰光斑点在第一位置处指示的深度值与其他邻近光斑点在第二位置处指示的深度值相差较大,如“第一位置的深度值”和“第二位置的深度值”之间的深度差值大于某一深度差值阈值,而RGB图像给出的彩色信息中,干扰光斑在RGB图像中“干扰光斑点与邻近光斑点”这几个点对应的颜色信息相近,如“第三位置的彩色像素值(如RGB值)”和“第三位置的彩色像素值(如RGB值)”之间的彩色像素差值(如RGB差值)小于某一彩色差值阈值(如针对RGB值设置的门限值或临界值);说明这几个点有可能是同一物体表面,则干扰光斑判断正确的可能性较大;反之,干扰光斑对应的干扰光斑点可能来自于远距离或者其他低反射率目标或者光滑镜面反射的目标,即有可能该干扰光斑不是属于干扰光斑类型而有可能属于有效光斑类型。Illustratively, the depth value indicated by the interference light spot at the first position is quite different from the depth value indicated by other adjacent light spots at the second position, such as "depth value of the first position" and "depth of the second position". The depth difference between the "value" is greater than a certain depth difference threshold, and in the color information given by the RGB image, the color information corresponding to the "interference light spots and adjacent light spots" of the interference spots in the RGB image is similar. , such as the color pixel difference (such as RGB difference) between "color pixel value (such as RGB value) at the third position" and "color pixel value (such as RGB value) at the third position" is less than a certain color difference value Threshold value (such as the threshold value or critical value set for RGB value); indicating that these points may be the same surface of the object, the probability of correct judgment of the interference light spot is high; otherwise, the interference light spot corresponding to the interference light spot may come from For long-distance or other low-reflectivity targets or targets with smooth specular reflection, it is possible that the interference spot is not an interference spot type but an effective spot type.
具体实施中,基于所述第一位置以及所述第二位置,得到针对所述干扰光斑的深度像素验证结果可以是:获取第一位置对应的第一深度值以及获取第二位置对应的第二深度值,计算第一深度值与第二深度值的深度值差值,若深度值差值大于深度阈值,深度像素验证结果为第一结果,如True,反之为第二结果如,False;In a specific implementation, based on the first position and the second position, obtaining the depth pixel verification result for the interference light spot may be: obtaining a first depth value corresponding to the first position and obtaining a second depth value corresponding to the second position Depth value, calculate the depth value difference between the first depth value and the second depth value, if the depth value difference is greater than the depth threshold, the depth pixel verification result is the first result, such as True, otherwise it is the second result, such as False;
进一步的,基于所述第三位置以及所述第四位置,得到针对所述干扰光斑的彩色像素验证结果,可以是:获取第三位置对应的第一彩色值(如RGB值)以及获取第四位置对应的第二彩色值,计算第一彩色值与第二彩色值的彩色值差值,若彩色值差值小于彩色阈值,则通常干扰光斑点与邻近光斑点的颜色信息相近,彩色像素验证结果为第一结果,如True;反之,彩色像素验证结果为为第二结果,如False;Further, based on the third position and the fourth position, obtaining the color pixel verification result for the interference light spot may be: obtaining the first color value (such as RGB value) corresponding to the third position and obtaining the fourth color value. The second color value corresponding to the position, calculate the color value difference between the first color value and the second color value, if the color value difference is less than the color threshold, the color information of the interference light spot and the adjacent light spot is usually similar, and the color pixel verification The result is the first result, such as True; otherwise, the color pixel verification result is the second result, such as False;
然后结合深度像素验证结果和彩色像素验证结果,确定针对干扰光斑的干扰验证结果。示意性的,若深度像素验证结果和彩色像素验证结果均为第一结果,如True,则针对所述干扰光斑的干扰验证结果为:干扰验证通过,反之,则针对所述干扰光斑的干扰验证结果为:干扰验证不通过。Then combined with the depth pixel verification results and the color pixel verification results, the interference verification results for the interference light spots are determined. Illustratively, if both the depth pixel verification result and the color pixel verification result are the first results, such as True, then the interference verification result for the interference light spot is: the interference verification is passed, otherwise, the interference verification for the interference light spot is The result is: the interference verification fails.
在本申请实施例中,通过获取反射强度图,确定反射强度图中的至少一个光斑,然后获取所述光斑中光斑像素点对应的像素特征参数,基于像素特征参数在干扰光斑与有效光斑上像素特征参数的差异,可以从至少一个光斑中准确确定干扰光斑,可以辅助消除由于多个光斑的边缘信号叠加造成的光斑干扰;整个图像干扰处理过程减轻了对设备硬件、复杂算法的依赖,实现了准确识别光斑干扰,能够辅助输出高精度的深度测量结果,提升了深度测量场景下的鲁棒性;以及,可以结合深度图和彩色图进行干扰光斑的验证,进一步提升了干扰光斑识别的准确性;结合不同的检测方式或基于实际应用场景确定的不同时序的检测方式,优化了干扰光斑的检测流程。In the embodiment of the present application, by acquiring the reflection intensity map, at least one light spot in the reflection intensity map is determined, and then the pixel feature parameters corresponding to the pixel points of the light spot in the light spot are obtained, and the pixels on the interference light spot and the effective light spot are based on the pixel feature parameters. The difference in characteristic parameters can accurately determine the interference spot from at least one spot, and can assist in eliminating the spot interference caused by the superposition of the edge signals of multiple spots; Accurately identify light spot interference, which can assist in outputting high-precision depth measurement results and improve the robustness in depth measurement scenarios; and can combine depth map and color map for interference light spot verification, further improving the accuracy of interference light spot identification ; Combined with different detection methods or different timing detection methods determined based on actual application scenarios, the detection process of interference light spots is optimized.
请参见图5,图5是本申请提出的一种图像处理方法的另一种实施例的流程示意图。具体的:Please refer to FIG. 5 , which is a schematic flowchart of another embodiment of an image processing method proposed in the present application. specific:
S301:获取反射强度图,确定所述反射强度图中的至少一个光斑,获取所述光斑中光斑像素点对应的像素特征参数;S301: Obtain a reflection intensity map, determine at least one light spot in the reflection intensity map, and obtain pixel feature parameters corresponding to the pixel points of the light spot in the light spot;
S302:确定针对反射强度图的至少一种光斑干扰检测方式。S302: Determine at least one light spot interference detection method for the reflection intensity map.
具体可参见本申请涉及一个或多个实施例的方法步骤,此处不再赘述。For details, reference may be made to the method steps involved in one or more embodiments of the present application, which will not be repeated here.
S303:若所述光斑干扰检测方式为像素点强度检测方式,则基于所述像素强度参数确定所述光斑像素点对应的第一强度优先级,以及获取针对反射强度图的目标光斑点占比;S303: If the light spot interference detection method is a pixel point intensity detection method, determine the first intensity priority corresponding to the light spot pixel point based on the pixel intensity parameter, and obtain the target light spot ratio for the reflection intensity map;
根据一些实施例中,光斑干扰检测方式可以是像素点强度检测方式,通过对光斑像素点的像素点强度进行检测,以从识别出的多个光斑中区分出干扰光斑。在实际应用场景中,例如通过散斑iTOF相机的光接收端来得到当前视场下的反射强度图,其中,反射强度图中所有实际光斑覆盖像素点数量占整个反射强度图中像素点数量的比例通常比较小,例如大约在百分之几到百分之十几。在实际光斑未覆盖到的区域,反射强度图或深度图中像素点的值或者说像素强度值(也即Confidence值)并不是0,这是由于环境光、电路、暗电路等噪声的存在导致的。但这些实际光斑(也可以理解为除干扰光斑之外的有效光斑)未覆盖到的区域像素强度值(也即未覆盖到的区域中像素点的Confidence值)通常很低(即使存在干扰光斑的情况下通常干扰光斑中像素点强度值要远低于实际光斑中像素点强度值),在一些场景下,干扰光斑或边缘区域比实际光斑信号光的像素强度值(也即Confidence值)低一个到几个数量级。基于此,可对反射强度图中识别出的所有光斑所覆盖的光斑像素点对应的光斑强度参数(如光斑像素点对应的Confidence值)进行检测,以此从识别出的多个光斑中确定干扰光斑,也即确定干扰光斑点。According to some embodiments, the light spot interference detection method may be a pixel point intensity detection method, by detecting the pixel point intensity of the light spot pixel points, so as to distinguish the interference light spots from the identified multiple light spots. In practical application scenarios, for example, the light receiving end of the speckle iTOF camera is used to obtain the reflection intensity map in the current field of view. The ratio is usually relatively small, such as about a few percent to ten percent. In the area not covered by the actual light spot, the value of the pixel in the reflection intensity map or the depth map or the pixel intensity value (that is, the Confidence value) is not 0. This is due to the existence of noise such as ambient light, circuits, and dark circuits. of. However, the pixel intensity values of the areas not covered by these actual light spots (which can also be understood as effective light spots other than the interference light spots) (that is, the Confidence value of the pixels in the uncovered areas) are usually very low (even if there are interference light spots). In some cases, the pixel intensity value in the interference spot is usually much lower than the pixel intensity value in the actual spot). In some scenarios, the pixel intensity value of the interference spot or edge area is one lower than the pixel intensity value of the actual spot signal light (that is, the Confidence value). to several orders of magnitude. Based on this, the spot intensity parameters (such as the Confidence value corresponding to the spot pixels) corresponding to the spot pixels covered by all the spots identified in the reflection intensity map can be detected, so as to determine the interference from the identified multiple spots. Light spot, that is, to determine the interference light spot.
可以理解的,终端确定光斑干扰检测方式之后,若所述光斑干扰检测方式为像素点强度检测方式,则终端可以基于像素强度参数对至少一个光斑进行像素点强度检测处理,具体实施中,可以基于反射强度图(也可称之为Confidence图)中光斑所覆盖光斑像素点的像素强度参数(如光斑所覆盖光斑像素点的Confidence值),按照所有光斑覆盖像素点(光斑所覆盖光斑像素点的数量可以是多个)的像素强度参数的数值大小进行优先级排序,确定至少一个光斑像素点(也即光斑所覆盖光斑像素点)对应的第一强度优先级,可以理解的像素强度参数与第一强度优先级正相关,以及获取针对反射强度图的目标光斑点占比。It can be understood that after the terminal determines the light spot interference detection method, if the light spot interference detection method is the pixel intensity detection method, the terminal can perform pixel intensity detection processing on at least one light spot based on the pixel intensity parameter. In the reflection intensity map (also called the Confidence map), the pixel intensity parameters of the pixel points of the light spot covered by the light spot (such as the Confidence value of the pixel points of the light spot covered by the light spot), according to the pixel points covered by all the light spots (the number of pixels of the light spot covered by the light spot) The number of pixel intensity parameters can be more than one) to prioritize the value of the pixel intensity parameters, and determine the first intensity priority corresponding to at least one spot pixel point (that is, the spot pixel point covered by the spot). An intensity priority is positively correlated, and the ratio of target light spots obtained for the reflection intensity map.
可选的,确定至少一个光斑像素点(也即光斑所覆盖的像素点)对应的第一强度优先级可以是通过绘制强度统计图确定的,如强度统计图可以是表征光斑像素点的像素强度参数(光斑像素点对应的Confidence值)的强度直方图,强度直方图可以用于表征所有光斑所覆盖的光斑像素点的像素强度情况,例如可以反馈相同像素强度参数(如同一Confidence值)的光斑像素点,例如可以反馈至少一个光斑像素点的强度优先级。Optionally, determining the first intensity priority corresponding to at least one light spot pixel point (that is, the pixel point covered by the light spot) may be determined by drawing an intensity statistic graph, for example, the intensity statistic graph may represent the pixel intensity of the light spot pixel point. The intensity histogram of the parameter (confidence value corresponding to the spot pixel), the intensity histogram can be used to represent the pixel intensity of the spot pixel covered by all the spots, for example, the spot with the same pixel intensity parameter (such as the same Confidence value) can be fed back For pixel points, for example, the intensity priority of at least one light spot pixel point can be fed back.
可以理解的,在出厂之后的终端使用阶段,终端基于某散斑iTOF模式下进行工作,某散斑iTOF模式下光接收端接收的光斑理论数量、光斑所覆盖的理论光斑像素点数量等已经确定。例如,散斑iTOF相机在实际应用阶段之后,视场内理论会有多少个光斑,至少一个光斑理论会覆盖几个光斑像素点;进一步,由于光斑所覆盖的理论光斑像素点数量(在一些实施方式中也可称之为参考像素点数量)可确定,或,理论光斑像素点(不含干扰点)的目标光斑点占比(理论光斑像素点与图像总像素点的比例)可确定。基于此,像素点强度检测时仅需从所有光斑像素点中确定参考光斑点(一些实施例可称之为第一光斑点或第二光斑点),将参考光斑点对应的像素强度参数作为阈值进行干扰筛选即可。It can be understood that in the terminal use stage after leaving the factory, the terminal works based on a speckle iTOF mode. The theoretical number of light spots received by the light receiving end in a speckle iTOF mode, the theoretical number of light spot pixels covered by the light spot, etc. have been determined. . For example, after the actual application stage of a speckle iTOF camera, how many spots will theoretically be in the field of view, and at least one spot will theoretically cover several spot pixels; further, due to the theoretical number of spot pixels covered by the spot (in some implementations It can also be referred to as the number of reference pixels in the method) can be determined, or, the target light spot ratio (the ratio of theoretical light spot pixels to total image pixels) of theoretical light spot pixels (excluding interference points) can be determined. Based on this, the pixel intensity detection only needs to determine the reference light spot (which may be referred to as the first light spot or the second light spot in some embodiments) from all the light spot pixels, and use the pixel intensity parameter corresponding to the reference light spot as the threshold Perform interference screening.
示意性的,直方图统计即统计整个Confidence图像的直方图,根据先验知识,散斑iTOF相机在设计好之后,视场内会有多少个光斑,至少一个光斑会覆盖几个像素点都是可以从理论推导出来。Schematically, the histogram statistics is to count the histogram of the entire Confidence image. According to prior knowledge, after the speckle iTOF camera is designed, how many light spots will be in the field of view, and at least one light spot will cover several pixels. can be derived from theory.
S304:基于所述目标光斑点占比、所述光斑像素点的第一强度优先级以及所述光斑像素点的像素强度参数,确定强度阈值;基于所述强度阈值,从至少一个所述光斑中确定第一干扰光斑。S304: Determine an intensity threshold based on the target light spot ratio, the first intensity priority of the light spot pixel points, and the pixel intensity parameter of the light spot pixel point; based on the intensity threshold, select from at least one of the light spots Determine the first interference spot.
在一种可行的实施方式中,可以基于所述目标光斑点占比以及所述光斑像素点的第一强度优先级确定第一光斑点以及获取第一光斑点对应的第一强度阈值,基于所述第一强度阈值从至少一个所述光斑中确定第一干扰光斑;In a feasible implementation manner, the first light spot may be determined based on the proportion of the target light spot and the first intensity priority of the light spot pixel point, and the first intensity threshold corresponding to the first light spot may be obtained. the first intensity threshold determines a first interference spot from at least one of the spots;
示意性的,假设目标光斑点占比(也即光斑像素点数量占比)为x%,所述光斑像素点的第一强度优先级可以是以Confidence图对应的直方图形式表征,则终端可以确定直方图从高到底前x%数量点,以此来确定第一光斑点(可以将第x%的数量点作为第一光斑点),第一光斑点的像素强度参数作为第一强度阈值,如第一光斑点对应的Confidence值为Cx,即理论上所有光斑覆盖的光斑像素点Confidence值都应当大于Cx。即可以将Cx为阈值筛选干扰光斑点,也即可以将所有光斑像素点的Confidence值与Cx进行比对,若光斑像素点的Confidence值大于Cx,则该光斑像素点为非干扰光斑点,若光斑像素点的Confidence值小于或等于Cx,则该光斑像素点可作为干扰光斑点,或该光斑像素点可作为疑似干扰光斑点,然后结合其他光斑干扰检测方式进一步确定,例如采用其他光斑干扰方式确定该光斑像素点符合干扰点判决条件,则将该光斑像素点作为干扰光斑点。干扰光斑点筛选出后即确定了第一干扰光斑,例如可以将干扰光斑点所对应的光斑作为第一干扰光斑,在实际光斑干扰检测中,通常第一干扰光斑所覆盖的大多数光斑像素点可能均会为干扰光斑点。Illustratively, it is assumed that the proportion of target light spots (that is, the proportion of the number of light spot pixels) is x%, and the first intensity priority of the light spot pixels can be represented in the form of a histogram corresponding to the Confidence graph, then the terminal can Determine the number of points from the top to the bottom of the histogram to determine the first light spot (the number of points in the x% can be used as the first light spot), and the pixel intensity parameter of the first light spot is used as the first intensity threshold, For example, the Confidence value corresponding to the first light spot is Cx, that is, theoretically, the Confidence value of the light spot pixel points covered by all the light spots should be greater than Cx. That is, Cx can be used as the threshold to filter the interference light spots, that is, the Confidence value of all light spot pixels can be compared with Cx. If the Confidence value of the light spot pixel point is greater than Cx, the light spot pixel point is a non-interfering light spot. If If the Confidence value of the light spot pixel is less than or equal to Cx, then the light spot pixel can be used as an interference light spot, or the light spot pixel can be used as a suspected interference light spot, and then further determined by combining other light spot interference detection methods, such as using other light spot interference methods It is determined that the light spot pixel point meets the interference point judgment condition, and the light spot pixel point is regarded as the interference light spot. After the interference light spot is screened out, the first interference light spot is determined. For example, the light spot corresponding to the interference light spot can be used as the first interference light spot. In the actual light spot interference detection, usually most of the light spot pixels covered by the first interference light spot are used. All may be interfering light spots.
在一种可行的实施方式中,获取所述光斑对应的参考像素点数量,参考像素点数量为光斑所覆盖的光斑像素点的理论数量,确定所述目标光斑点占比与所述参考像素点数量对应的目标比值,基于所述目标比值以及所述光斑像素点的第一强度优先级确定第二光斑点以及获取第二光斑点对应的第二强度阈值,基于所述第二强度阈值从至少一个所述光斑中确定第一干扰光斑;In a feasible implementation manner, the number of reference pixels corresponding to the light spot is obtained, and the number of reference pixels is the theoretical number of light spot pixels covered by the light spot, and the proportion of the target light spot and the reference pixel are determined. The target ratio corresponding to the number, the second light spot is determined based on the target ratio and the first intensity priority of the light spot pixel point, and the second intensity threshold corresponding to the second light spot is obtained, based on the second intensity threshold from at least determining a first interference light spot in one of the light spots;
示意性的,实际应用场景中,实际光斑的光斑边缘交汇区域像素点的Confidence值(可理解为像素点像素强度)通常大于环境光噪声或者电路噪声等像素点的Confidence值;而且在一般场景中,可能会有超出设计范围的远距离或者低反射率物体存在,此时这些远距离物体反射回来的信号光呈现在光接收端Sensor上的光斑能量很弱,也即像素强度参数的数值较低,可能会低于近距离光斑边缘交汇处干扰光斑中像素点的Confidence值,也就是说:当前反射强度图上有效光斑数量(可理解为除干扰光斑之外实际光斑的数量)可能会低于设置的阈值,如低于目标光斑点占比对应的像素点数量。为了提升光斑干扰的识别准确度。可以采用结合光斑对应的参考像素点数量来进行干扰光斑检测。Schematically, in practical application scenarios, the Confidence value (which can be understood as the pixel intensity of the pixel) of the pixel in the area where the edge of the actual light spot meets is usually greater than the Confidence value of the pixel such as ambient light noise or circuit noise; and in general scenarios , there may be long-distance or low-reflectivity objects that exceed the design range. At this time, the signal light reflected by these long-distance objects is displayed on the light-receiving end Sensor with very weak spot energy, that is, the pixel intensity parameter The value is low , may be lower than the Confidence value of the pixels in the interference spot at the intersection of the edge of the near spot The set threshold, such as the number of pixels below the target light spot ratio. In order to improve the recognition accuracy of light spot interference. Interference spot detection can be performed by combining the number of reference pixel points corresponding to the spot.
所述光斑对应的参考像素点数量可以理解为至少一个光斑理论覆盖的光斑像素点数量。可以理解的,例如,在出厂之后的终端使用阶段,终端基于某散斑iTOF模式下进行工作,某散斑iTOF模式下光接收端理论接收的光斑理论数量、目标光斑点占比、至少一个光斑覆盖区域理论像素点数量(也即参考像素点数量)等已经确定或可以计算得到。The number of reference pixel points corresponding to the light spot can be understood as the number of light spot pixel points theoretically covered by at least one light spot. It can be understood that, for example, in the terminal use stage after delivery, the terminal works based on a speckle iTOF mode. The theoretical number of pixels in the coverage area (that is, the number of reference pixels) has been determined or can be calculated.
可以理解的,可以基于至少一个光斑对应的参考像素点数量和目标光斑点占比进行结合,来确定第二强度阈值,以提升光斑干扰的识别准确度。It can be understood that the second intensity threshold can be determined based on the combination of the number of reference pixels corresponding to at least one light spot and the proportion of the target light spot, so as to improve the recognition accuracy of light spot interference.
示意性的,若一个光斑覆盖n个光斑像素点(也即参考像素点数量为n),以前述直方图为例,所述光斑像素点的第一强度优先级可以是以Confidence图对应的直方图形式得到的,则终端可以确定直方图从高到底前(x/n)%数量点,以此来确定第二光斑点(可以将第(x/n)%的数量点作为第二光斑点),第二光斑点的像素强度参数作为第二强度阈值,如第二光斑点对应的Confidence值作为第二强度阈值Cxna。进一步的,即理论上所有光斑覆盖像素点Confidence值都应当大于Cxna。即可以将Cxna为阈值筛选干扰光斑点若光斑像素点的Confidence值大于Cxna,则该光斑像素点非干扰光斑点,若光斑像素点的Confidence值小于或等于Cxna,则该光斑像素点可以作为干扰光斑点。可以根据干扰光斑点对应的光斑来确定第一干扰光斑。Illustratively, if a spot covers n spot pixels (that is, the number of reference pixels is n), taking the aforementioned histogram as an example, the first intensity priority of the spot pixels may be the histogram corresponding to the Confidence graph. The terminal can determine the number of points from the top to the bottom (x/n)% of the histogram, so as to determine the second light spot (the (x/n)% number of points can be used as the second light spot ), the pixel intensity parameter of the second light spot is used as the second intensity threshold, for example, the Confidence value corresponding to the second light spot is used as the second intensity threshold Cxna. Further, theoretically, the Confidence value of all the pixels covered by the light spot should be greater than Cxna. That is, Cxna can be used as the threshold to filter the interference light spots. If the Confidence value of the light spot pixel point is greater than Cxna, the light spot pixel point is not an interfering light spot. If the Confidence value of the light spot pixel point is less than or equal to Cxna, then the light spot pixel point can be used as interference Light spots. The first interference light spot may be determined according to the light spot corresponding to the interference light spot.
在一种可行的实施方式中,也可以结合第一强度阈值和第二强度阈值来进行平衡,以避免光斑干扰判决时的误差,实现干扰判决时的精准性,避免漏掉干扰光斑点。示意性的,可以从第一强度阈值和第二强度阈值中,也即Cx到Cxna中,Confidence阈值从小到大,对应的是干扰点越来越少,可以从第一强度阈值和第二强度阈值来结合实际应用场景来确定一个合适的阈值进行光斑干扰的判断。In a feasible implementation manner, the first intensity threshold and the second intensity threshold can also be used for balance, so as to avoid errors in light spot interference judgment, achieve accuracy in interference judgment, and avoid missing interference light spots. Illustratively, from the first intensity threshold and the second intensity threshold, that is, Cx to Cxna, the Confidence threshold increases from small to large, corresponding to fewer and fewer interference points, and can be calculated from the first intensity threshold and the second intensity. The threshold value is combined with the actual application scenario to determine an appropriate threshold value to judge the spot interference.
可以理解的,终端可以执行基于所述目标光斑点占比以及所述光斑像素点的第一强度优先级确定第一光斑点以及获取第一光斑点对应的第一强度阈值;基于所述目标光斑点占比以及所述光斑像素点的第一强度优先级确定第一光斑点以及获取第一光斑点对应的第一强度阈值,获取所述光斑对应的参考像素点数量,确定所述目标光斑点占比与所述参考像素点数量对应的目标比值,基于所述目标比值以及所述光斑像素点的第一强度优先级确定第二光斑点以及获取第二光斑点对应的第二强度阈值,基于所述第一强度阈值以及所述第二强度阈值从至少一个所述光斑中确定第一干扰光斑。It can be understood that the terminal can perform determining the first light spot based on the proportion of the target light spot and the first intensity priority of the light spot pixel point and obtain the first intensity threshold corresponding to the first light spot; based on the target light The spot ratio and the first intensity priority of the light spot pixels determine the first light spot and obtain the first intensity threshold corresponding to the first light spot, obtain the number of reference pixels corresponding to the light spot, and determine the target light spot accounting for a target ratio corresponding to the number of reference pixels, determining a second light spot based on the target ratio and the first intensity priority of the light spot pixels, and obtaining a second intensity threshold corresponding to the second light spot, based on The first intensity threshold and the second intensity threshold determine a first interfering light spot from at least one of the light spots.
可以理解的,从第一强度阈值和第二强度阈值中,也即Cx到Cxna中,Confidence阈值从小到大,对应的是干扰点越来越少,可以从第一强度阈值和第二强度阈值结合来确定一个阈值进行干扰滤除;具体实施中,终端基于所述第一强度阈值以及所述第二强度阈值确定阈值参考范围,如阈值参考范围为:[Cx,Cxna],然后从所述阈值参考范围中获取目标强度阈值,基于所述目标强度阈值从至少一个所述光斑中确定第一干扰光斑。It can be understood that from the first intensity threshold and the second intensity threshold, that is, from Cx to Cxna, the Confidence threshold increases from small to large, corresponding to fewer and fewer interference points. From the first intensity threshold and the second intensity threshold A threshold is combined to determine a threshold for interference filtering; in a specific implementation, the terminal determines a threshold reference range based on the first intensity threshold and the second intensity threshold. For example, the threshold reference range is: [Cx, Cxna], and then from the A target intensity threshold is obtained from the threshold reference range, and a first interference light spot is determined from at least one of the light spots based on the target intensity threshold.
可选的,目标强度阈值可以是从所述阈值参考范围中随机任取一个值作为目标强度阈值。Optionally, the target intensity threshold may be any value randomly selected from the threshold reference range as the target intensity threshold.
可选的,也可以从第一强度阈值和第二强度阈值结合当前的实际应用场景来确定一个阈值进行干扰滤除。Optionally, a threshold may also be determined from the first intensity threshold and the second intensity threshold in combination with the current practical application scenario to perform interference filtering.
示意性的,在不同的应用场景下对于测量精度、干扰适应性等需求不同,可以设置调节因子,针对多个参考应用场景分别设置参考调节因子,参考因子用来从阈值参考范围中确定目标强度阈值。在实际应用阶段,建立多个参考应用场景与其对应的参考调节因子的调节因子映射关系,在确定当前的应用场景之后,可以基于调节因子映射关系确定应用场景对应的调节因子。基于调节因子采用预设计算式子从阈值参考范围中确定目标强度阈值,如阈值参考范围为:[Cx,Cxna],假设调节因子为a,则目标强度阈值b=(Cxna-Cx)*a+Cx;Illustratively, in different application scenarios for different requirements such as measurement accuracy and interference adaptability, an adjustment factor can be set, and a reference adjustment factor is set separately for multiple reference application scenarios, and the reference factor is used to determine the target intensity from the threshold reference range. threshold. In the actual application stage, the adjustment factor mapping relationship between multiple reference application scenarios and their corresponding reference adjustment factors is established. After the current application scenario is determined, the adjustment factor corresponding to the application scenario can be determined based on the adjustment factor mapping relationship. Based on the adjustment factor, a preset calculation formula is used to determine the target intensity threshold from the threshold reference range. For example, the threshold reference range is: [Cx, Cxna], assuming that the adjustment factor is a, then the target intensity threshold b=(Cxna-Cx)*a +Cx;
S305:若所述光斑干扰检测方式为能量比例检测方式,则获取至少一个所述光斑对应的中心点强度值以及所述边缘点强度值;S305: If the light spot interference detection method is an energy proportional detection method, obtain the intensity value of the center point and the edge point intensity value corresponding to at least one of the light spots;
根据一些实施例中,能量比例检测方式,通过对光斑所包含像素点的能量比例进行检测,以从识别出的多个光斑中区分出干扰光斑。示意性的,能量比例检测方式可以遍历至少一个光斑,计算光斑中心像素点像素强度参数(也即Confidence值)与光斑除光斑中心点之外该光斑的其他像素点Confidence值的能量比例,通常实际光斑的信号光能量集中,其能量比例会大于干扰光斑。According to some embodiments, the energy ratio detection method detects the energy ratio of the pixel points included in the light spot, so as to distinguish the interference light spot from the identified multiple light spots. Illustratively, the energy ratio detection method can traverse at least one spot, and calculate the energy ratio of the pixel intensity parameter (that is, the Confidence value) of the pixel at the center of the spot and the Confidence value of other pixels of the spot except the center of the spot. The signal light energy of the spot is concentrated, and its energy ratio will be greater than that of the interference spot.
所述中心点强度值可以理解为光斑的光斑中心像素点的像素强度值(相当于Confidence值),在一些实施方式中,可以将光斑重心像素点作为光斑中心像素点,将光斑重心像素点的像素强度值作为中心点强度值。所述边缘点强度值可以理解为光斑中除中心像素点之外的边缘像素点的像素强度值(也即Confidence值)。所述中心点强度值以及所述边缘点强度值均可基于反射强度图直接获取到。The center point intensity value can be understood as the pixel intensity value (equivalent to the Confidence value) of the center pixel point of the light spot. The pixel intensity value is taken as the center point intensity value. The edge point intensity value can be understood as the pixel intensity value (that is, the Confidence value) of the edge pixel points in the light spot except the center pixel point. Both the center point intensity value and the edge point intensity value can be directly obtained based on the reflection intensity map.
示意性的,假设光斑覆盖m个光斑像素点,理论上从光斑中心到边缘,光斑像素点的强度逐渐衰减,也即对应的Confidence值逐渐衰减,且衰减规律基本符合高斯曲面,光斑所覆盖区域的某一行或某一列光斑像素点Confidence值符合高斯曲线。如图6所示,图6是一种涉及光斑的场景示意图,在图6中光斑某列光斑像素点Confidence值与光斑像素点位置关系如图6所示,在图6中两边的光斑可视作实际光斑或有效信号光斑,中间的光斑由于两边光斑的边缘信号光叠加产生,有效信号光斑如图6中(a)所示,有效信号光斑能量强度集中,中心像素Confidence值高,有效信号光斑的四周光斑能量迅速衰减。也就是说,有效光斑的中心像素点Confidence值与光斑四周Confidence值的比值较大。干扰信号光斑如图6中(b)所示,干扰信号光斑分布也呈现高斯曲面,但是干扰信号光斑能量分散,干扰信号光斑的中心像素点Confidence值与边缘Confidence值的比值远小于邻近两个有效光斑对应的比值。Schematically, it is assumed that the light spot covers m light spot pixels. In theory, from the center of the light spot to the edge, the intensity of the light spot pixel point gradually decays, that is, the corresponding Confidence value gradually decays, and the attenuation law basically conforms to the Gaussian surface. The area covered by the light spot The Confidence value of a certain row or column of spot pixels conforms to a Gaussian curve. As shown in Figure 6, Figure 6 is a schematic diagram of a scene involving light spots. In Figure 6, the relationship between the Confidence value of a certain column of light spot pixel points and the position of the light spot pixel points is shown in Figure 6. In Figure 6, the light spots on both sides are visible As an actual light spot or an effective signal light spot, the middle light spot is generated by the superposition of the edge signal light of the two light spots. The effective signal light spot is shown in (a) in Figure 6. The energy intensity of the effective signal light spot is concentrated, the central pixel Confidence value is high, and the effective signal light spot is The surrounding spot energy rapidly decays. That is to say, the ratio of the Confidence value of the central pixel point of the effective light spot to the Confidence value of the surrounding area of the light spot is larger. The interference signal spot is shown in (b) in Figure 6. The distribution of the interference signal spot also presents a Gaussian surface, but the energy of the interference signal spot is dispersed, and the ratio of the central pixel Confidence value of the interference signal spot to the edge Confidence value is much smaller than the adjacent two effective The ratio corresponding to the spot.
S306:基于所述中心点强度值以及所述边缘点强度值对至少一个光斑进行能量比例检测处理,从至少一个所述光斑中确定第二干扰光斑。S306: Perform energy proportional detection processing on at least one light spot based on the central point intensity value and the edge point intensity value, and determine a second interference light spot from at least one of the light spots.
根据一些实施例中,终端可以基于所述像素强度参数对至少一个光斑进行能量比例检测处理,以此得到第二干扰光斑;所述第二干扰光斑也即通过能量比例检测方式检测出的干扰光斑。示意性的,通常可以是对相邻的两两光斑计算能量比例,然后比较两两光斑的能量比例,通常若某光斑为干扰光斑,实际光斑的能量比例要远大于邻近的干扰光斑。According to some embodiments, the terminal may perform energy proportional detection processing on at least one light spot based on the pixel intensity parameter, so as to obtain a second interference light spot; the second interference light spot is the interference light spot detected by the energy proportional detection method . Illustratively, it is usually possible to calculate the energy ratio of adjacent pairs of light spots, and then compare the energy ratio of each pair of light spots. Usually, if a certain light spot is an interference light spot, the actual energy ratio of the light spot is much larger than that of the adjacent interference light spots.
可以理解的,1、终端可以基于所述中心点强度值与所述边缘点强度值确定所述光斑的第一强度比例;It can be understood that 1. The terminal can determine the first intensity ratio of the light spot based on the intensity value of the center point and the intensity value of the edge point;
所述第一强度比例也即光斑中心点强度值与边缘点强度值的比值。The first intensity ratio is the ratio of the intensity value of the center point of the light spot to the intensity value of the edge point.
示意性的,可以设置边缘距离,以光斑中心点为参考,取所述边缘距离指示的同一光斑的边缘点,例如边缘距离可以是2个像素点,则取光斑中心点间隔2个像素点的像素点作为边缘点。Schematically, the edge distance can be set, and the center point of the light spot is taken as a reference, and the edge point of the same light spot indicated by the edge distance is taken. Pixel points are used as edge points.
2、终端分别获取所述光斑对应的第一光斑,确定所述第一光斑的第二强度比例;2. The terminal obtains the first light spot corresponding to the light spot respectively, and determines the second intensity ratio of the first light spot;
示意性的,可以是获取与所述光斑相邻的邻近光斑,将所述邻近光斑作为所述光斑对应的第一光斑;考虑到邻近光斑的比值具备可比性。邻近可以理解为光斑与其对应的第一光斑具体很近,在真实场景中两个光斑可能来自于同一物体表面的相邻位置,即两个光斑的能量、解算出来的距离是相近的,也就是说这两个光斑具有可比性。如果光斑与其对应的第一光斑距离较远,则有可能一个来自近距离物体表面,而另一个来自于远距离背景,而远距离背景的反射光本身由于光程长,打在TOF相机光接收端Sensor上的光斑可能会存在能量较弱或能量不集中的情况,因此距离较远的光斑之间可比性较差。基于此,可以获取与所述光斑相邻的邻近光斑,将所述邻近光斑作为所述光斑对应的第一光斑。Illustratively, adjacent light spots adjacent to the light spot may be acquired, and the adjacent light spot may be used as the first light spot corresponding to the light spot; considering that the ratio of the adjacent light spots is comparable. Proximity can be understood as the fact that the light spot is very close to its corresponding first light spot. In a real scene, the two light spots may come from adjacent positions on the surface of the same object, that is, the energy of the two light spots and the calculated distance are similar. That is, the two spots are comparable. If the distance between the light spot and its corresponding first light spot is far, it is possible that one of the light spots comes from the surface of the object at a close distance, and the other comes from the background at a distance. The reflected light from the background at a distance itself, due to its long optical path, hits the TOF camera and receives light. The light spot on the end Sensor may have weak or inconcentrated energy, so the comparability between the light spots with a longer distance is poor. Based on this, adjacent light spots adjacent to the light spots may be acquired, and the adjacent light spots may be used as the first light spots corresponding to the light spots.
示意性的,还可以是设置一个固定距离,获取与至少一个所述光斑处于固定距离内的光斑作为第一光斑。Illustratively, a fixed distance may also be set, and a light spot within a fixed distance from at least one of the light spots is acquired as the first light spot.
示意性的,可以是设置一个距离阈值,终端可以获取所述光斑与至少一个第二光斑(第二光斑为当前除所述光斑之外的光斑)的目标距离,基于所述目标距离与距离阈值从所述至少一个第二光斑中确定所述光斑对应的第一光斑,也即取第二光斑与光斑之间的目标距离小于或等于距离阈值时所对应的第一光斑。Illustratively, a distance threshold may be set, and the terminal may obtain the target distance between the light spot and at least one second light spot (the second light spot is the light spot other than the current light spot), based on the target distance and the distance threshold. The first light spot corresponding to the light spot is determined from the at least one second light spot, that is, the first light spot corresponding to when the target distance between the second light spot and the light spot is less than or equal to the distance threshold is taken.
可以理解的,第二强度比例的确定方式与第一强度比例的确定方式类似,也即第一光斑的中心点强度值与边缘点强度值的比值。示意性的,第一光斑的“中心点与边缘点的选取”应与光斑的“中心点与边缘点的选取”一致,如基于同一边缘距离选取光斑中心点对应的边缘点和第一光斑中心点对应的边缘点。It can be understood that the determination method of the second intensity ratio is similar to the determination method of the first intensity ratio, that is, the ratio of the intensity value of the center point to the intensity value of the edge point of the first light spot. Schematically, the "center point and edge point selection" of the first light spot should be consistent with the "center point and edge point selection" of the light spot, for example, the edge point corresponding to the center point of the light spot and the center of the first light spot are selected based on the same edge distance. point corresponding to the edge point.
3、终端基于所述光斑的所述第一强度比例以及所述第二强度比例,从至少一个所述光斑中确定第二干扰光斑。3. The terminal determines a second interference light spot from at least one of the light spots based on the first intensity ratio and the second intensity ratio of the light spot.
在一种可行的实施方式中,可以是基于所述第一强度比例以及所述第二强度比例,确定目标差值;基于所述目标差值以及差值阈值从至少一个所述光斑中确定第二干扰光斑;In a possible implementation manner, the target difference value may be determined based on the first intensity ratio and the second intensity ratio; 2. Interference spot;
示意性的,所述目标差值也即第一强度比例以及所述第二强度比例的差值。差值阈值是基于预先的硬件需求和应用场景确定针对目标差值的门限值。若目标差值大于差值阈值,则可确定第一光斑为干扰光斑。若目标差值小于或等于差值阈值,则可通常第一光斑不为干扰光斑。Illustratively, the target difference is the difference between the first intensity ratio and the second intensity ratio. The difference threshold is a threshold value determined for the target difference based on the hardware requirements and application scenarios in advance. If the target difference is greater than the difference threshold, it can be determined that the first light spot is an interference light spot. If the target difference value is less than or equal to the difference value threshold, it is usually possible that the first light spot is not an interference light spot.
在一种可行的实施方式中,可以是以所述第一强度比例为参考,基于至少一个所述第二强度比例确定针对所述第一光斑的强度比例波动范围;基于所述强度比例波动范围和参考波动范围,从至少一个所述光斑中确定第二干扰光斑。In a feasible implementation manner, the first intensity ratio may be used as a reference, and an intensity ratio fluctuation range for the first light spot may be determined based on at least one of the second intensity ratios; based on the intensity ratio fluctuation range and the reference fluctuation range, a second disturbing light spot is determined from at least one of the light spots.
例如,包含当前光斑的某一个小区域内存在相邻k×k的第一光斑,这k×k个第一光斑的中心像素Confidence值与边缘Confidence值的比值波动范围(也即多个第二强度比例与当前第一强度比例所对应的强度比例波动范围)应当不超过参考波动范围,参考波动范围可以预先设置,若偏离参考波动范围,则将该光斑认定为第二干扰光斑。For example, if there are adjacent k×k first light spots in a certain small area including the current light spot, the fluctuation range of the ratio of the central pixel Confidence value to the edge Confidence value of these k×k first light spots (that is, a plurality of second intensities The intensity ratio fluctuation range corresponding to the ratio and the current first intensity ratio) should not exceed the reference fluctuation range. The reference fluctuation range can be preset. If it deviates from the reference fluctuation range, the light spot is identified as the second interference light spot.
在一个或多个实施例中,可以基于所述中心点强度值与所述边缘点强度值确定所述光斑的第一强度比例;示意性的,基于预先的硬件需求和应用场景确定针对第一强度比例的门限值,也即强度比例阈值;然后基于所述第一强度比例和强度比例阈值,从至少一个所述光斑中确定第二干扰光斑,例如,若所述第一强度比例大于强度比例阈值,则该光斑为有效光斑;若所述第一强度比例小于或等于强度比例阈值,则该光斑为干扰光斑。In one or more embodiments, the first intensity ratio of the light spot may be determined based on the intensity value of the center point and the intensity value of the edge point; a threshold value of the intensity ratio, that is, the intensity ratio threshold; then, based on the first intensity ratio and the intensity ratio threshold, a second interference spot is determined from at least one of the spots, for example, if the first intensity ratio is greater than the intensity If the first intensity ratio is less than or equal to the intensity ratio threshold, the light spot is an interference light spot.
S307:若所述光斑干扰检测方式为像素点均值检测方式,则确定至少一个所述光斑对应的目标像素区域,所述光斑位于所述目标像素区域内;S307: If the light spot interference detection method is a pixel point mean detection method, determine at least one target pixel area corresponding to the light spot, and the light spot is located in the target pixel area;
根据一些实施例中,光斑干扰检测方式可以是像素点均值检测方式,像素点均值检测方式可以是检测“某一光斑覆盖到反射强度图中所有光斑像素点的像素强度参数(如Confidence值)之和”与“该光斑一定邻域范围内所有区域像素点的像素强度参数(如Confidence值)之和”的比值,以将该比值作为像素点均值;According to some embodiments, the light spot interference detection method may be a pixel point average detection method, and the pixel point average detection method may be to detect "a certain light spot covers the pixel intensity parameters (such as the Confidence value) of all the light spot pixels in the reflection intensity map. The ratio of "sum" to "the sum of the pixel intensity parameters (such as the Confidence value) of all pixels in a certain neighborhood of the spot", to use the ratio as the pixel mean;
其中,光斑一定邻域范围也即前述目标像素区域,目标像素区域可以是一个矩形区域,该矩形区域包含某一个或多个光斑所覆盖的像素点即可。目标像素区域可以是一个圆形区域。目标像素区域可以是一个大于某一矩形区域内强度最大值某一比例的全部像素点,例如某一矩形区域内Confidence最大值为100,设置某一比例为a(如a为40%),则判定该某一矩形区域内所有Confidence值大于(a*100)的像素点均符合要求。Wherein, a certain neighborhood range of the light spot is the aforementioned target pixel area, and the target pixel area may be a rectangular area, and the rectangular area only needs to include the pixel points covered by one or more light spots. The target pixel area can be a circular area. The target pixel area can be all pixels that are larger than a certain ratio of the maximum intensity in a rectangular area. For example, the maximum value of Confidence in a rectangular area is 100, and a certain ratio is set to a (for example, a is 40%), then It is determined that all pixels with a Confidence value greater than (a*100) in a certain rectangular area meet the requirements.
S308:基于所述像素强度参数确定针对至少一个所述光斑的光斑像素点均值,确定至少一个所述目标像素区域对应的区域像素点均值;S308: Determine, based on the pixel intensity parameter, a pixel mean value of a light spot for at least one of the light spots, and determine a regional pixel mean value corresponding to at least one of the target pixel regions;
示意性的,可以获取至少一个所述光斑的全部光斑像素点对应的第一总强度以及光斑像素点总数量,将所述第一总强度与光斑像素点总数量的商作为所述光斑的光斑像素点均值;Schematically, the first total intensity corresponding to all the light spot pixels of at least one of the light spots and the total number of light spot pixels can be obtained, and the quotient of the first total intensity and the total number of light spot pixels can be used as the light spot of the light spot. pixel mean;
所述第一总强度也即一个光斑所覆盖的全部光斑像素点的像素强度参数(Confidenc值)之和。光斑像素点总数量也即该光斑的全部光斑像素点的总数量。假设光斑a覆盖6个光斑像素点,则第一总强度为6个光斑像素点的Confidenc值之和,光斑像素点总数量为6。The first total intensity is the sum of the pixel intensity parameters (Confidenc values) of all the pixel points of the light spot covered by one light spot. The total number of light spot pixel points is the total number of all light spot pixel points of the light spot. Assuming that the light spot a covers 6 light spot pixels, the first total intensity is the sum of the Confidenc values of the 6 light spot pixels, and the total number of light spot pixels is 6.
示意性的,可以获取至少一个所述目标像素区域的全部区域像素点对应的第二总强度以及区域像素点总数量,将所述第二总强度与区域像素点总数量的商作为所述目标像素区域对应的区域像素点均值。Illustratively, the second total intensity and the total number of regional pixels corresponding to all regional pixels of at least one of the target pixel regions can be obtained, and the quotient of the second total intensity and the total number of regional pixels is used as the target. The mean value of the area pixels corresponding to the pixel area.
所述第二总强度也即目标像素区域的全部区域像素点像素强度参数之和。区域像素点总数量也即区域内的全部光斑像素点的数量。假设目标像素区域b覆盖8个区域像素点,则第二总强度为8个区域像素点的Confidenc值之和,区域像素点总数量为8。The second total intensity is also the sum of the pixel intensity parameters of all area pixels of the target pixel area. The total number of area pixels is the number of all light spot pixels in the area. Assuming that the target pixel area b covers 8 area pixels, the second total intensity is the sum of the Confidenc values of the 8 area pixels, and the total number of area pixels is 8.
S309:基于所述光斑像素点均值以及所述区域像素点均值对至少一个光斑进行像素点均值检测处理,从至少一个所述光斑中确定第三干扰光斑。S309: Perform pixel point average detection processing on at least one light spot based on the light spot pixel average value and the regional pixel average value, and determine a third interference light spot from at least one of the light spots.
可选的,像素点均值检测方式可以是:针对某一光斑而言,计算“光斑像素强度参数(如Confidence值)之和(也即第一总强度)除以覆盖到像素点数(也即光斑像素点总数量)的平均值C1”,平均值C1可以作为光斑像素点均值;以及计算“目标像素区域内所有像素点的像素强度参数(也即第二总强度)除以覆盖到像素点数(也即区域像素点总数量)的平均值C2”,平均值C2可以作为区域像素点均值;平均值C1与平均值C2的比值(也即C1/C2),通常比值越小,该某一光斑为干扰光斑的可能性越大。其中,比值(也即C1/C2)可称之为参考比值。Optionally, the pixel point mean detection method may be: for a certain light spot, calculate "the sum of the pixel intensity parameters of the light spot (such as the Confidence value) (that is, the first total intensity) divided by the number of pixels covered (that is, the light spot). The average value C 1 ” of the total number of pixel points), the average value C 1 can be used as the average value of the light spot pixel points; and the calculation of “the pixel intensity parameter of all the pixel points in the target pixel area (that is, the second total intensity) divided by the coverage to the pixel The average value C 2 ” of the number of points (that is, the total number of pixel points in the area), the average value C 2 can be used as the average value of the area pixel points; the ratio of the average value C 1 to the average value C 2 (that is, C 1 /C 2 ), usually The smaller the ratio, the greater the possibility that a certain light spot is an interference light spot. Among them, the ratio (ie C 1 /C 2 ) can be referred to as a reference ratio.
可以理解的,若所述光斑干扰检测方式为像素点均值检测方式,则终端基于所述像素强度参数对至少一个光斑进行像素点均值检测处理,以此从多个光斑中得到第三干扰光斑;例如像素点均值检测处理之后得到针对至少一个光斑的比值(也即C1/C2),然后将比值(也即C1/C2)与某一比值阈值进行比较,若比值(也即C1/C2)小于某一比值阈值,则将该光斑作为干扰光斑,反之,通常该光斑为有效光斑;在光斑数量为多个的情况,可参见前述方式依次对多个光斑进行比较,以此从多个光斑中确定干扰光斑,基于干扰光斑可以确定干扰光斑点。It can be understood that, if the light spot interference detection method is a pixel point mean detection method, the terminal performs pixel point average detection processing on at least one light spot based on the pixel intensity parameter, so as to obtain a third interference light spot from multiple light spots; For example, after the pixel point mean detection process, the ratio for at least one light spot (ie C 1 /C 2 ) is obtained, and then the ratio (ie C 1 /C 2 ) is compared with a certain ratio threshold, if the ratio (
其中,比值阈值为针对参考比值(也即C1/C2)设置的门限值或临界值。The ratio threshold is a threshold or critical value set for the reference ratio (ie, C 1 /C 2 ).
示意性的,确定所述光斑像素点均值与所述区域像素点均值对应的参考比值;终端可以基于所述参考比值与比值阈值对至少一个光斑进行像素点均值检测处理,从至少一个所述光斑中确定第三干扰光斑。Illustratively, the reference ratio corresponding to the pixel point mean value of the light spot and the regional pixel point average value is determined; the terminal may perform pixel point average value detection processing on at least one light spot based on the reference ratio value and the ratio threshold value, and obtain the pixel value from at least one of the light spots. Determine the third interference spot.
可以理解的,像素点均值检测方式的依据也是有效光斑光能量很强且集中,从光斑中心到边缘能量和Confidence迅速衰减。对于有效光斑,C1/C2的比值也即参考比值远大于干扰点对应的比值。这是因为干扰点的光斑中心本身就是至少两个有效光斑边缘的叠加产生的,能量很弱。示意性的,通过设置针对参考比值的门限值可以实现干扰光斑的判决。It can be understood that the basis of the pixel point mean detection method is that the light energy of the effective spot is strong and concentrated, and the energy and confidence decay rapidly from the center of the spot to the edge. For the effective light spot, the ratio of C 1 /C 2 , that is, the reference ratio is much larger than the ratio corresponding to the interference point. This is because the center of the light spot of the interference point itself is generated by the superposition of at least two effective light spot edges, and the energy is very weak. Illustratively, by setting a threshold value for the reference ratio, the judgment of the interference light spot can be realized.
S310:若所述光斑干扰检测方式为能量总强度检测方式,则基于所述像素强度参数,确定参考区域内第三光斑的光斑强度以及所有第四光斑对应的光斑强度均值;S310: If the light spot interference detection method is the total energy intensity detection method, then, based on the pixel intensity parameter, determine the light spot intensity of the third light spot in the reference area and the average value of the light spot intensity corresponding to all the fourth light spots;
根据一些实施例中,光斑干扰检测方式可以是能量总强度检测方式,通常在反射强度图对应的至少一个参考区域(参考区域通常可以是一个预设尺寸规格的小区域范围)内,在该参考区域光斑的理论数量预先可设置或计算推导得到,且该参考区域内多个实际光斑(不含干扰光斑)彼此间光斑的总能量(也可理解为光斑能量)应相当,如该参考区域对应视觉场景中目标对象的某一个二维平面,而此时产生的干扰光斑的光斑能量通常要远小于该参考区域内实际光斑的光斑能量。According to some embodiments, the light spot interference detection method may be a total energy intensity detection method, usually within at least one reference area corresponding to the reflection intensity map (the reference area may usually be a small area range of a preset size specification), in the reference area The theoretical number of regional light spots can be pre-set or calculated and derived, and the total energy (also understood as the light spot energy) of multiple actual light spots (excluding interference light spots) in the reference area should be equivalent to each other. If the reference area corresponds to A certain two-dimensional plane of the target object in the visual scene, and the spot energy of the interference spot generated at this time is usually much smaller than the spot energy of the actual spot in the reference area.
所述光斑能量可以理解为光斑覆盖所有光斑像素点的像素强度参数之和,也即光斑覆盖所有光斑像素点的Confidence值之和,在一些实施方式中,光斑能量也可称之为光斑强度或光斑能量强度。The light spot energy can be understood as the sum of the pixel intensity parameters of the light spot covering all the light spot pixel points, that is, the sum of the Confidence values of the light spot covering all the light spot pixel points. In some embodiments, the light spot energy can also be called the light spot intensity or Spot energy intensity.
所述参考区域通常可以理解为一个预设尺寸规格的小区域范围;示意性的:参考区域可以是一个r×c个像素点的区域,可以理解为r×c个像素点为预设尺寸规格。The reference area can generally be understood as a small area range with a preset size specification; illustratively: the reference area may be an area with r×c pixels, which can be understood as r×c pixels as the preset size specification .
在一种具体的实施场景中,假设该参考区域理论应该包含2×2个光斑。In a specific implementation scenario, it is assumed that the reference area should theoretically contain 2×2 light spots.
一种可行的实施方式可以是:第三光斑可以是参考区域中所有光斑中的任一光斑;第三光斑也可以是参考区域中所有光斑中光斑强度最小的光斑;A feasible implementation manner may be: the third light spot may be any light spot among all the light spots in the reference area; the third light spot may also be the light spot with the smallest light spot intensity among all the light spots in the reference area;
可选的,第三光斑与第四光斑的关系可以是:所述参考区域包括的所有光斑为第四光斑以及所述第三光斑为所有所述第四光斑中的其一;Optionally, the relationship between the third light spot and the fourth light spot may be: all the light spots included in the reference area are the fourth light spot and the third light spot is one of all the fourth light spots;
例如,假设参考区域中有4个光斑:光斑A1、光斑A2、光斑A3、光斑A4;第四光斑也即光斑A1、光斑A2、光斑A3、光斑A4:第三光斑也即“光斑A1、光斑A2、光斑A3、光斑A4”中的其一,例如第三光斑可以是“光斑A1、光斑A2、光斑A3、光斑A4”中光斑强度最小的光斑,假设:光斑A1的光斑强度为:45、光斑A2的光斑强度为:99、光斑A3的光斑强度为:100、光斑A4的光斑强度为:101,则可以将参考区域中的光斑A1作为第三光斑。For example, suppose there are 4 spots in the reference area: spot A1, spot A2, spot A3, spot A4; the fourth spot is spot A1, spot A2, spot A3, spot A4: the third spot is also called spot A1, spot A2, spot A3, spot A4. A2, one of the light spot A3, the light spot A4", for example, the third light spot can be the light spot with the smallest light spot intensity among the "light spot A1, light spot A2, light spot A3, light spot A4", assuming: the light spot intensity of light spot A1 is: 45, The light spot intensity of light spot A2 is: 99, the light spot intensity of light spot A3 is: 100, and the light spot intensity of light spot A4 is: 101, then light spot A1 in the reference area can be used as the third light spot.
可选的,第三光斑与第四光斑的关系可以是:所述参考区域包括所述第三光斑和所有第四光斑Optionally, the relationship between the third light spot and the fourth light spot may be: the reference area includes the third light spot and all fourth light spots
例如,假设参考区域中有4个光斑:光斑B1、光斑B2、光斑B3、光斑B4;第三光斑可以是“光斑B1、光斑B2、光斑B3、光斑B4”中的其一;第四光斑也即“光斑B1、光斑B2、光斑B3、光斑B4”中除第三光斑之外的光斑:例如第三光斑可以是“光斑B1、光斑B2、光斑B3、光斑B4”中的光斑B3,则第四光斑为:除光斑B3之外的“光斑B1、光斑B2光斑B4”;示意性的,假设:光斑B1的光斑强度为:45、光斑B2的光斑强度为:99、光斑B3的光斑强度为:100、光斑B4的光斑强度为:101,则可以将参考区域光斑强度最小的光斑B1作为第三光斑。For example, suppose there are 4 light spots in the reference area: light spot B1, light spot B2, light spot B3, light spot B4; the third light spot can be one of "light spot B1, light spot B2, light spot B3, light spot B4"; the fourth light spot is also That is, the light spots except the third light spot in "light spot B1, light spot B2, light spot B3, light spot B4": for example, the third light spot can be the light spot B3 in "light spot B1, light spot B2, light spot B3, light spot B4", then the third light spot The four light spots are: "light spot B1, light spot B2 light spot B4" except for light spot B3; schematically, it is assumed that the light spot intensity of light spot B1 is: 45, the light spot intensity of light spot B2 is: 99, and the light spot intensity of light spot B3 is: : 100, the light spot intensity of the light spot B4 is: 101, then the light spot B1 with the smallest light spot intensity in the reference area can be used as the third light spot.
所述光斑强度为一个光斑所覆盖所有光斑像素点的像素强度参数(Confidence值)之和;例如:光斑有3个光斑像素点,至少一个光斑像素点的Confidence值分别为光斑像素点1:x1、光斑像素点2:x2、光斑像素点1:x3;则光斑强度为:(x1+x2+x3)/3。The light spot intensity is the sum of the pixel intensity parameters (Confidence values) of all the light spot pixel points covered by a light spot; for example: the light spot has 3 light spot pixel points, and the Confidence value of at least one light spot pixel point is the light spot pixel point 1:x 1. Light spot pixel point 2: x 2 , light spot pixel point 1: x 3 ; then the light spot intensity is: (x 1+ x 2+ x 3 )/3.
所述所有第四光斑对应的光斑强度均值中的“光斑强度均值”可以理解为:所有第四光斑的光斑强度之和(也即所有第四光斑的Confidence值之和)与第四光斑数量的比值。The "average light spot intensity" in the average light spot intensity corresponding to all the fourth light spots can be understood as: the sum of the light spot intensities of all the fourth light spots (that is, the sum of the Confidence values of all the fourth light spots) and the number of the fourth light spots. ratio.
所述所有第四光斑对应的光斑强度均值也即所有第四光斑的光斑强度之和与第四光斑总数量的比值。例如:第四光斑有4个分别为光斑A1、光斑A2、光斑A3、光斑A4,假设:光斑A1的光斑强度为:45、光斑A2的光斑强度为:99、光斑A3的光斑强度为:100、光斑A4的光斑强度为:101;则第四光斑总数量为4,所有第四光斑对应的光斑强度均值为:(45+99+100+101)/4。The mean value of the light spot intensity corresponding to all the fourth light spots is the ratio of the sum of the light spot intensities of all the fourth light spots to the total number of the fourth light spots. For example: the fourth spot has 4 spots, namely spot A1, spot A2, spot A3, spot A4. Suppose: spot intensity of spot A1 is: 45, spot intensity of spot A2 is: 99, spot intensity of spot A3 is: 100 , the light spot intensity of light spot A4 is: 101; then the total number of fourth light spots is 4, and the average light spot intensity corresponding to all fourth light spots is: (45+99+100+101)/4.
在一种可行的实施方式中,能量总强度检测方式也可以是非极大值抑制检测方式,根据一些实施例中诸如散斑iTOF相机在实际应用阶段,视场内某个参考区域理论会有多少个有效光斑,至少一个有效光斑理论会覆盖几个像素点,光斑对应理论的数量阈值通常已经确定;可以基于参考区域中实际光斑数量来进行非极大值抑制检测:在参考区域内所有光斑对应的光斑总数量小于或等于参考区域所对应的光斑数量阈值(在一些实施方式中,可基于理论光斑数量确定光斑数量阈值)时,也无需进行能量总强度检测,此时,参考区域中的实际光斑通常均为有效光斑;在实际光斑数量大于参考区域所对应的理论光斑数量,此时通常可以认为存在干扰光斑。In a feasible implementation manner, the total energy intensity detection method can also be a non-maximum value suppression detection method. According to some embodiments, such as the speckle iTOF camera in the actual application stage, how many theoretically there will be a certain reference area in the field of view At least one effective spot will theoretically cover several pixels, and the theoretical number threshold of the corresponding spot is usually determined; non-maximum suppression detection can be performed based on the actual number of spots in the reference area: all spots in the reference area correspond to When the total number of light spots is less than or equal to the threshold of the number of light spots corresponding to the reference area (in some embodiments, the threshold of the number of light spots can be determined based on the number of theoretical light spots), there is no need to perform total energy intensity detection. The light spots are usually effective light spots; when the actual number of light spots is greater than the theoretical light spot number corresponding to the reference area, it can usually be considered that there are interference light spots.
示意性的,参考区域可以是一个r×c个像素点的区域,可以理解为r×c个像素点为预设尺寸规格,假设该参考区域理论应该包含2×2个光斑,也即参考区域的光斑数量阈值为:4,而实际中,反射强度图中该参考区域所检测到的光斑数量为:5,也即参考区域对应的光斑总数量为5;此时:光斑总数量大于光斑数量阈值,则进行能量总强度检测,也即执行S310中的“基于所述像素强度参数,确定参考区域内第三光斑的光斑强度以及所有第四光斑对应的光斑强度均值”和S311。Illustratively, the reference area can be an area of r×c pixels, which can be understood as the preset size specification of r×c pixels. It is assumed that the reference area should theoretically contain 2×2 light spots, that is, the reference area. The threshold of the number of light spots is: 4, and in practice, the number of light spots detected in the reference area in the reflection intensity graph is: 5, that is, the total number of light spots corresponding to the reference area is 5; at this time: the total number of light spots is greater than the number of light spots If the threshold is set, the total energy intensity detection is performed, that is, “determine the spot intensity of the third spot in the reference area and the average spot intensity corresponding to all the fourth spots based on the pixel intensity parameter in S310” and S311.
可选的,可以将参考区域中所有光斑的光斑强度最小的光斑为作为干扰光斑。Optionally, the light spot with the smallest light spot intensity of all light spots in the reference area may be used as the interference light spot.
可选的,光斑数量阈值可以基于理论光斑数量确定,如光斑数量阈值可以等于理论光斑数量;光斑数量阈值也可以略大于理论光斑数量,以考虑实际场景下的光斑误差,提高鲁棒性。Optionally, the threshold of the number of light spots can be determined based on the number of theoretical light spots. For example, the threshold of the number of light spots can be equal to the number of theoretical light spots; the threshold of the number of light spots can also be slightly larger than the number of theoretical light spots, so as to consider the light spot error in the actual scene and improve the robustness.
在一种可行的实施方式中,上述参考区域内理论应该出现多少个有效光斑已经预先确定,因此,至少一个理论出现的光斑之间的间距或者说间距变化的范围也可确定,也就是说可以基于参考区域中两两光斑之间的光斑间隔距离进行非极大值抑制检测以进一步判断,通过设置针对光斑间隔距离的门限值也即光斑间隔距离阈值,在获取参考区域中两两光斑之间的光斑间隔距离之后,若所述光斑间隔距离小于间隔距离阈值,则可能视场参考区域内出现了干扰光斑,可以执行S310中的“基于所述像素强度参数,确定参考区域内第三光斑的光斑强度以及所有第四光斑对应的光斑强度均值”和S311。In a feasible implementation manner, the number of effective light spots that should theoretically appear in the above-mentioned reference area has been predetermined. Therefore, the distance between at least one theoretically occurring light spot or the range of the distance change can also be determined, that is to say, it can be The non-maximum value suppression detection is performed based on the distance between the two light spots in the reference area to further determine the non-maximum value suppression. After the light spot separation distance between the two, if the light spot separation distance is less than the separation distance threshold, it is possible that an interfering light spot appears in the reference area of the field of view, and the "Based on the pixel intensity parameter, determine the third light spot in the reference area" in S310 can be performed. The spot intensity of , and the mean value of the spot intensity corresponding to all the fourth spots” and S311.
可选的,若所述光斑间隔距离大于或等于间隔距离阈值,则可以进行忽略处理。Optionally, if the light spot separation distance is greater than or equal to the separation distance threshold, ignore processing may be performed.
可选的,前述两两光斑的位置关系可以为相邻位置关系。Optionally, the positional relationship between the aforementioned two light spots may be an adjacent positional relationship.
示意性的,若相邻的3个光斑之间的两两光斑的光斑间隔距离小于光斑间隔距离阈值时,而中间光斑的光斑强度小于两边光斑的光斑强度均值,或中间光斑的光斑强度均小于两边光斑的光斑强度,则中间光斑的能量强度较弱,可以将中间光斑作为干扰光斑,如图7所示,图7是一种涉及干扰光斑的场景示意图,在图7中相邻的3个光斑之间的两两光斑间隔距离小于间隔距离阈值,中间光斑的光斑强度小于两边光斑的光斑强度,也即中间光斑的能量强度较弱,可以将中间光斑作为干扰光斑,干扰光斑所覆盖的所有像素点中的至少其一可作为干扰光斑点,例如将干扰光斑所覆盖的所有像素点中像素强度参数(Confidence值)最大值指示的点作为干扰点。Illustratively, if the spot spacing distance between the two adjacent spots is less than the spot spacing distance threshold, and the spot intensity of the middle spot is less than the average spot intensity of the two sides, or the spot intensity of the middle spot is less than The intensity of the light spots on both sides, the energy intensity of the middle light spot is weaker, and the middle light spot can be used as the interference light spot, as shown in Figure 7, which is a schematic diagram of a scene involving interference light spots. The distance between the two spots between the spots is less than the separation distance threshold, and the spot intensity of the middle spot is smaller than the spot intensity of the two sides, that is, the energy intensity of the middle spot is weak, and the middle spot can be used as an interference spot, and all the light spots covered by the interference spot can be used. At least one of the pixel points can be used as the interference light spot, for example, the point indicated by the maximum value of the pixel intensity parameter (Confidence value) among all the pixel points covered by the interference light spot is used as the interference point.
S311:基于所述第三光斑的光斑强度以及所述光斑强度均值对所述第三光斑进行能量总强度检测处理,确定第四干扰光斑。S311: Perform a total energy intensity detection process on the third light spot based on the light spot intensity of the third light spot and the average value of the light spot intensity, and determine a fourth interference light spot.
在一种可行的实施方式中,确定所述第三光斑的光斑强度与所述光斑强度均值的强度差值,也即光斑强度与所述光斑强度均值之间的差值;通过设置针对强度差值的第一差值阈值来实现判决;In a feasible implementation manner, the intensity difference between the spot intensity of the third spot and the average intensity of the spots is determined, that is, the difference between the intensity of the spot and the average intensity of the spots; the first difference threshold of the value to realize the decision;
若所述的强度差值小于或等于第一差值阈值,则将所述的强度差值小于或等于第一差值阈值的第三光斑作为第四干扰光斑。If the intensity difference is less than or equal to the first difference threshold, the third light spot with the intensity difference less than or equal to the first difference threshold is used as the fourth interference light spot.
若所述的强度差值大于第一差值阈值,则进行忽略处理。If the intensity difference is greater than the first difference threshold, ignore processing is performed.
在一种可行的实施方式中,确定所述第三光斑的光斑强度与所述光斑强度均值的强度比例,也即光斑强度与所述光斑强度均值的比值;In a feasible implementation manner, determining the intensity ratio of the spot intensity of the third spot to the mean value of the spot intensity, that is, the ratio of the spot intensity to the mean value of the spot intensity;
若所述强度比例小于或等于第一比例阈值,则将第三光斑作为第四干扰光斑。其中,所述第一比例阈值为针对强度比例所设置的门限值。If the intensity ratio is less than or equal to the first ratio threshold, the third light spot is used as the fourth interference light spot. Wherein, the first ratio threshold is a threshold value set for the intensity ratio.
若所述强度比例大于第一比例阈值,则进行忽略处理。If the intensity ratio is greater than the first ratio threshold, ignore processing is performed.
在一种具体的实施场景中,可以理解的若参考区域内包括多个光斑,则可以获取这多个光斑分别对应光斑强度,基于这多个光斑的光斑强度选取最小光斑强度指示的第三光斑,然后确定参考区域内的所有第四光斑。一种方式是:将参考区域内所有的光斑均作为第四光斑;一种方式是:将参考区域内除第三光斑之外的光斑均作为第四光斑;然后计算所有第四光斑对应的光斑强度均值,然后计算第三光斑的光斑强度与光斑强度均值的商作为强度比例,若强度比例小于第一比例阈值,则将第三光斑作为第四干扰光斑。In a specific implementation scenario, it can be understood that if the reference area includes a plurality of light spots, the corresponding light spot intensities of the plurality of light spots can be obtained, and the third light spot indicated by the minimum light spot intensity is selected based on the light spot intensities of the plurality of light spots , and then determine all fourth spots within the reference area. One way is: take all the light spots in the reference area as the fourth light spot; one way is: take all the light spots in the reference area except the third light spot as the fourth light spot; then calculate the light spots corresponding to all the fourth light spots The average intensity is calculated, and then the quotient of the intensity of the third spot and the average intensity of the spot is calculated as the intensity ratio. If the intensity ratio is less than the first ratio threshold, the third spot is used as the fourth interference spot.
S312:若所述光斑干扰检测方式为光斑位置检测方式,则基于像素位置参数确定针对所述至少一个光斑的光斑位置;获取至少一个所述光斑对应的参考位置范围;S312: If the light spot interference detection method is a light spot position detection method, determine a light spot position for the at least one light spot based on a pixel position parameter; obtain a reference position range corresponding to at least one of the light spots;
可以理解的,光斑干扰检测方式可以是光斑位置检测方式,也可理解为固定位置检测,根据一些实施例中,散斑iTOF相机在出厂阶段,光斑在光接收端得到的反射强度图上的位置通常比较固定,但可能会由于远近距离视差、信发散等客观原因发生几个像素的偏移,基于此,可以在出厂阶段设置光斑的位置范围,将至少一个光斑的位置范围记录下来,若光斑出现在这些位置以外,大概率为干扰光斑。It can be understood that the spot interference detection method can be a spot position detection method, and can also be understood as a fixed position detection. According to some embodiments, the speckle iTOF camera is in the factory stage, and the spot position on the reflection intensity map obtained by the light receiving end. Usually it is relatively fixed, but a few pixels may shift due to objective reasons such as distance and distance parallax, signal divergence, etc. Based on this, the position range of the light spot can be set at the factory stage, and the position range of at least one light spot can be recorded. Appearing outside these positions is likely to interfere with light spots.
S313:若所述光斑的光斑位置与所述参考位置范围不匹配,则将所述光斑确定为第五干扰光斑。S313: If the light spot position of the light spot does not match the reference position range, determine the light spot as a fifth interference light spot.
可以理解的,终端确定光斑干扰检测方式之后,若所述光斑干扰检测方式为光斑位置检测方式,则终端可以基于像素位置参数对至少一个光斑进行光斑位置检测处理,得到第五干扰光斑。例如光斑位置检测处理时得到多个光斑的光斑位置,将该光斑的光斑位置与该光斑对应的位置范围进行匹配,以检测所述光斑位置是否落入到参考位置范围内,将所述光斑确定为第五干扰光斑;以此类推,可以从多个光斑中确定第五干扰光斑。It can be understood that, after the terminal determines the light spot interference detection method, if the light spot interference detection method is the light spot position detection method, the terminal can perform light spot position detection processing on at least one light spot based on the pixel position parameter to obtain a fifth interference light spot. For example, during the spot position detection process, the spot positions of multiple spots are obtained, and the spot position of the spot is matched with the position range corresponding to the spot to detect whether the spot position falls within the reference position range, and the spot is determined. is the fifth interference light spot; and so on, the fifth interference light spot can be determined from the plurality of light spots.
在本申请实施例中,通过获取反射强度图,确定反射强度图中的至少一个光斑,然后获取所述光斑中光斑像素点对应的像素特征参数,基于像素特征参数在干扰光斑与有效光斑上像素特征参数的差异,可以从至少一个光斑中准确确定干扰光斑,可以辅助消除由于多个光斑的边缘信号叠加造成的光斑干扰;整个图像干扰处理过程减轻了对设备硬件、复杂算法的依赖,实现了准确识别光斑干扰,能够辅助输出高精度的深度测量结果,提升了深度测量场景下的鲁棒性;以及,可以结合不同的光斑干扰检测方式或基于实际应用场景确定的不同时序的光斑干扰检测方式,优化了干扰光斑的检测流程。In the embodiment of the present application, by acquiring the reflection intensity map, at least one light spot in the reflection intensity map is determined, and then the pixel feature parameters corresponding to the pixel points of the light spot in the light spot are obtained, and the pixels on the interference light spot and the effective light spot are based on the pixel feature parameters. The difference in characteristic parameters can accurately determine the interference light spot from at least one light spot, and can assist in eliminating the light spot interference caused by the superposition of the edge signals of multiple light spots; Accurately identify light spot interference, which can assist in outputting high-precision depth measurement results and improve the robustness in depth measurement scenarios; and, it can combine different light spot interference detection methods or different time sequence light spot interference detection methods determined based on actual application scenarios. , which optimizes the detection process of interference light spots.
下面将结合图8,对本申请实施例提供的图像处理装置进行详细介绍。需要说明的是,图8所示的图像处理装置,用于执行本申请图1~图6所示实施例的方法,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请图1~图7所示的实施例。The image processing apparatus provided by the embodiment of the present application will be described in detail below with reference to FIG. 8 . It should be noted that the image processing apparatus shown in FIG. 8 is used to execute the methods of the embodiments shown in FIG. 1 to FIG. 6 of the present application. For convenience of description, only the parts related to the embodiments of the present application are shown, and the specific technology For details not disclosed, please refer to the embodiments shown in FIGS. 1 to 7 of the present application.
请参见图8,其示出本申请实施例的图像处理装置的结构示意图。该图像处理装置1可以通过软件、硬件或者两者的结合实现成为用户终端的全部或一部分。根据一些实施例,该图像处理装置1包括光斑确定模块11、参数获取模块12和干扰确定模块13,具体用于:Please refer to FIG. 8 , which shows a schematic structural diagram of an image processing apparatus according to an embodiment of the present application. The
光斑确定模块11,用于获取反射强度图,确定所述反射强度图中的至少一个光斑;a light
参数获取模块12,用于获取所述光斑中光斑像素点对应的像素特征参数;A
干扰确定模块13,用于基于所述像素特征参数,从所述至少一个光斑中确定干扰光斑。The
可选的,如图9所示,所述干扰确定模块13,包括:Optionally, as shown in FIG. 9 , the
检测确定单元131,用于确定针对反射强度图的至少一种光斑干扰检测方式;A detection and
干扰检测单元132,用于基于所述像素特征参数采用所述光斑干扰检测方式对至少一个所述光斑进行光斑干扰检测处理,得到干扰光斑。The
可选的,所述干扰检测单元132,具体用于:Optionally, the
若所述光斑干扰检测方式为像素点强度检测方式,则基于像素强度参数对至少一个光斑进行像素点强度检测处理,得到第一干扰光斑;If the light spot interference detection method is a pixel intensity detection method, performing pixel intensity detection processing on at least one light spot based on a pixel intensity parameter to obtain a first interference light spot;
若所述光斑干扰检测方式为能量比例检测方式,则基于所述像素强度参数对至少一个光斑进行能量比例检测处理,得到第二干扰光斑;If the light spot interference detection method is an energy proportional detection method, performing energy proportional detection processing on at least one light spot based on the pixel intensity parameter to obtain a second interference light spot;
若所述光斑干扰检测方式为像素点均值检测方式,则基于所述像素强度参数对至少一个光斑进行像素点均值检测处理,得到第三干扰光斑;If the light spot interference detection method is a pixel point average detection method, performing pixel point average detection processing on at least one light spot based on the pixel intensity parameter to obtain a third interference light spot;
若所述光斑干扰检测方式为能量总强度检测方式,则基于所述像素强度参数对至少一个光斑进行能量总强度检测处理,得到第四干扰光斑;If the light spot interference detection method is a total energy intensity detection method, performing total energy intensity detection processing on at least one light spot based on the pixel intensity parameter to obtain a fourth interference light spot;
若所述光斑干扰检测方式为光斑位置检测方式,则基于像素位置参数对至少一个光斑进行光斑位置检测处理,得到第五干扰光斑。If the light spot interference detection method is a light spot position detection method, the light spot position detection process is performed on at least one light spot based on the pixel position parameter to obtain a fifth interference light spot.
可选的,所述干扰检测单元132,具体用于:Optionally, the
基于所述像素强度参数确定所述光斑像素点对应的第一强度优先级,以及获取针对所述反射强度图的目标光斑点占比;Determine the first intensity priority corresponding to the light spot pixel point based on the pixel intensity parameter, and obtain the target light spot ratio for the reflection intensity map;
基于所述目标光斑点占比、所述光斑像素点的第一强度优先级以及所述光斑像素点的像素强度参数,确定强度阈值。An intensity threshold is determined based on the target light spot ratio, the first intensity priority of the light spot pixels, and the pixel intensity parameters of the light spot pixels.
基于所述强度阈值,从至少一个所述光斑中确定第一干扰光斑。Based on the intensity threshold, a first interfering light spot is determined from at least one of the light spots.
可选的,所述干扰检测单元132,具体用于:Optionally, the
基于所述目标光斑点占比以及所述光斑像素点的第一强度优先级确定第一光斑点以及获取第一光斑点对应的第一强度阈值,基于所述第一强度阈值从至少一个所述光斑中确定第一干扰光斑;或,Determine a first light spot based on the proportion of the target light spot and the first intensity priority of the light spot pixel point and obtain a first intensity threshold corresponding to the first light spot, based on the first intensity threshold from at least one of the Identify the first interfering spot in the spot; or,
获取所述光斑对应的参考像素点数量,确定所述目标光斑点占比与所述参考像素点数量对应的目标比值,基于所述目标比值以及所述光斑像素点的第一强度优先级确定第二光斑点以及获取第二光斑点对应的第二强度阈值,基于所述第二强度阈值从至少一个所述光斑中确定第一干扰光斑;或,Obtain the number of reference pixels corresponding to the light spot, determine the target ratio corresponding to the proportion of the target light spots and the number of reference pixels, and determine the first intensity priority based on the target ratio and the first intensity priority of the light spot pixels. two light spots and acquiring a second intensity threshold corresponding to the second light spot, and determining a first interference light spot from at least one of the light spots based on the second intensity threshold; or,
基于所述目标光斑点占比以及所述光斑像素点的第一强度优先级确定第一光斑点以及获取第一光斑点对应的第一强度阈值,获取所述光斑对应的参考像素点数量,确定所述目标光斑点占比与所述参考像素点数量对应的目标比值,基于所述目标比值以及所述光斑像素点的第一强度优先级确定第二光斑点以及获取第二光斑点对应的第二强度阈值,基于所述第一强度阈值以及所述第二强度阈值从至少一个所述光斑中确定第一干扰光斑。Determine the first light spot based on the proportion of the target light spot and the first intensity priority of the light spot pixel points, obtain the first intensity threshold corresponding to the first light spot, obtain the number of reference pixels corresponding to the light spot, and determine The target ratio corresponding to the proportion of the target light spots and the number of reference pixels, the second light spot is determined based on the target ratio and the first intensity priority of the light spot pixels, and the first light spot corresponding to the second light spot is obtained. Two intensity thresholds, a first interfering light spot is determined from at least one of the light spots based on the first intensity threshold and the second intensity threshold.
可选的,所述干扰检测单元132,具体用于:Optionally, the
基于所述第一强度阈值以及所述第二强度阈值确定阈值参考范围;determining a threshold reference range based on the first intensity threshold and the second intensity threshold;
从所述阈值参考范围中获取目标强度阈值,基于所述目标强度阈值从至少一个所述光斑中确定第一干扰光斑。A target intensity threshold is obtained from the threshold reference range, and a first interfering light spot is determined from at least one of the light spots based on the target intensity threshold.
可选的,所述干扰检测单元132,具体用于:Optionally, the
获取至少一个所述光斑对应的中心点强度值以及所述边缘点强度值;acquiring at least one intensity value of the center point corresponding to the light spot and the intensity value of the edge point;
基于所述中心点强度值以及所述边缘点强度值对至少一个光斑进行能量比例检测处理,从至少一个所述光斑中确定第二干扰光斑。An energy ratio detection process is performed on at least one light spot based on the central point intensity value and the edge point intensity value, and a second interference light spot is determined from at least one of the light spots.
可选的,所述干扰检测单元132,具体用于:Optionally, the
基于所述中心点强度值与所述边缘点强度值确定所述光斑的第一强度比例;基于所述第一强度比例和强度比例阈值,从至少一个所述光斑中确定第二干扰光斑;和/或,determining a first intensity ratio of the light spot based on the center point intensity value and the edge point intensity value; determining a second interfering light spot from at least one of the light spots based on the first intensity ratio and an intensity ratio threshold; and /or,
基于所述中心点强度值与所述边缘点强度值确定所述光斑的第一强度比例;分别获取所述光斑对应的第一光斑,确定所述第一光斑的第二强度比例;基于所述光斑的所述第一强度比例以及所述第二强度比例,从至少一个所述光斑中确定第二干扰光斑。Determine the first intensity ratio of the light spot based on the intensity value of the center point and the edge point intensity value; obtain the first light spot corresponding to the light spot respectively, and determine the second intensity ratio of the first light spot; based on the The first intensity ratio and the second intensity ratio of the light spots determine a second interfering light spot from at least one of the light spots.
可选的,所述干扰检测单元132,具体用于:Optionally, the
基于所述第一强度比例以及所述第二强度比例,确定目标差值;基于所述目标差值以及差值阈值从至少一个所述光斑中确定第二干扰光斑;或,determining a target difference based on the first intensity ratio and the second intensity ratio; determining a second interfering light spot from at least one of the light spots based on the target difference and a difference threshold; or,
以所述第一强度比例为参考,基于至少一个所述第二强度比例确定针对所述第一光斑的强度比例波动范围;基于所述强度比例波动范围和参考波动范围,从至少一个所述光斑中确定第二干扰光斑。Using the first intensity ratio as a reference, determine an intensity ratio fluctuation range for the first light spot based on at least one of the second intensity ratios; based on the intensity ratio fluctuation range and the reference fluctuation range, from at least one of the light spots Determine the second interference spot.
可选的,所述干扰检测单元132,具体用于:Optionally, the
获取与所述光斑相邻的邻近光斑,将所述邻近光斑作为所述光斑对应的第一光斑;或,Acquire the adjacent light spot adjacent to the light spot, and use the adjacent light spot as the first light spot corresponding to the light spot; or,
获取所述光斑与至少一个第二光斑的目标距离,基于所述目标距离与距离阈值从所述至少一个第二光斑中确定所述光斑对应的第一光斑。A target distance between the light spot and at least one second light spot is acquired, and a first light spot corresponding to the light spot is determined from the at least one second light spot based on the target distance and a distance threshold.
可选的,所述干扰检测单元132,具体用于:Optionally, the
确定至少一个所述光斑对应的目标像素区域,所述光斑位于所述目标像素区域内;determining at least one target pixel area corresponding to the light spot, and the light spot is located in the target pixel area;
基于所述像素强度参数确定针对至少一个所述光斑的光斑像素点均值,确定至少一个所述目标像素区域对应的区域像素点均值;Determine, based on the pixel intensity parameter, a pixel mean value of a light spot for at least one of the light spots, and determine a regional pixel mean value corresponding to at least one of the target pixel regions;
基于所述光斑的所述光斑像素点均值以及所述区域像素点均值对至少一个光斑进行像素点均值检测处理,从至少一个所述光斑中确定第三干扰光斑。Perform pixel point average detection processing on at least one light spot based on the light spot pixel average value and the regional pixel average value of the light spot, and determine a third interference light spot from at least one of the light spots.
可选的,所述干扰检测单元132,具体用于:Optionally, the
获取至少一个所述光斑的全部光斑像素点对应的第一总强度以及光斑像素点总数量,将所述第一总强度与光斑像素点总数量的商作为所述光斑的光斑像素点均值;Obtain the first total intensity and the total number of light spot pixels corresponding to all the light spot pixels of at least one of the light spots, and use the quotient of the first total intensity and the total number of light spot pixels as the light spot pixel mean of the light spot;
获取至少一个所述目标像素区域的全部区域像素点对应的第二总强度以及区域像素点总数量,将所述第二总强度与区域像素点总数量的商作为所述目标像素区域对应的区域像素点均值。Obtain the second total intensity and the total number of regional pixels corresponding to all area pixels of at least one of the target pixel areas, and take the quotient of the second total intensity and the total number of regional pixels as the area corresponding to the target pixel area pixel mean.
可选的,所述干扰检测单元132,具体用于:Optionally, the
确定所述光斑像素点均值与所述区域像素点均值对应的参考比值;determining the reference ratio corresponding to the pixel mean value of the light spot and the pixel mean value of the area;
基于所述参考比值与比值阈值对至少一个光斑进行像素点均值检测处理,从至少一个所述光斑中确定第三干扰光斑。Perform pixel point mean detection processing on at least one light spot based on the reference ratio and the ratio threshold, and determine a third interference light spot from at least one of the light spots.
可选的,所述干扰检测单元132,具体用于:Optionally, the
基于所述像素强度参数,确定参考区域内第三光斑的光斑强度以及所有第四光斑对应的光斑强度均值;Based on the pixel intensity parameter, determine the spot intensity of the third spot in the reference area and the mean value of the spot intensity corresponding to all the fourth spots;
基于所述第三光斑的光斑强度以及所述光斑强度均值对所述第三光斑进行能量总强度检测处理,确定第四干扰光斑。The total energy intensity detection process is performed on the third light spot based on the light spot intensity of the third light spot and the average value of the light spot intensity, and a fourth interference light spot is determined.
可选的,所述参考区域包括的所有光斑为第四光斑以及所述第三光斑为所有所述第四光斑中的其一;或,所述参考区域包括所述第三光斑和所有第四光斑。Optionally, all light spots included in the reference area are fourth light spots and the third light spot is one of all the fourth light spots; or, the reference area includes the third light spot and all fourth light spots spot.
可选的,所述干扰检测单元132,具体用于:Optionally, the
获取参考区域对应的光斑总数量;若所述光斑总数量大于光斑数量阈值,则执行所述基于所述像素强度参数,确定参考区域内第三光斑的光斑强度以及所有第四光斑对应的光斑强度均值的步骤;或,Acquire the total number of light spots corresponding to the reference area; if the total number of light spots is greater than the threshold of the number of light spots, execute the step of determining the light spot intensity of the third light spot in the reference area and the light spot intensities corresponding to all the fourth light spots based on the pixel intensity parameter mean steps; or,
获取参考区域中两两光斑之间的光斑间隔距离,若所述光斑间隔距离小于间隔距离阈值,则执行所述基于所述像素强度参数,确定参考区域内第三光斑的光斑强度以及所有第四光斑对应的光斑强度均值的步骤。Obtain the spot interval distance between two spots in the reference area, and if the spot interval distance is less than the interval distance threshold, execute the determining the spot intensity of the third spot in the reference area and all fourth spots based on the pixel intensity parameter. Steps for the mean value of the spot intensity corresponding to the spot.
可选的,所述干扰检测单元132,具体用于:Optionally, the
确定所述第三光斑的光斑强度与所述光斑强度均值的强度比例;determining the intensity ratio of the light spot intensity of the third light spot to the mean value of the light spot intensity;
若所述强度比例小于或等于第一比例阈值,则将所述第三光斑作为第四干扰光斑。If the intensity ratio is less than or equal to the first ratio threshold, the third light spot is used as the fourth interference light spot.
可选的,所述干扰检测单元132,具体用于:Optionally, the
基于像素位置参数确定针对所述至少一个光斑的光斑位置;获取至少一个所述光斑对应的参考位置范围;Determine a spot position for the at least one spot based on the pixel position parameter; obtain a reference position range corresponding to at least one of the spots;
若所述光斑的光斑位置与所述参考位置范围不匹配,则将所述光斑确定为第五干扰光斑。If the light spot position of the light spot does not match the reference position range, the light spot is determined as the fifth interference light spot.
可选的,如图10所示,所述装置1,还包括:Optionally, as shown in FIG. 10 , the
图像获取模块14,用于获取彩色图像和深度图像,所述反射强度图、所述深度图像和所述彩色图像均为针对同一目标对象的不同类图像;an
干扰验证模块15,用于基于所述彩色图像和所述深度图像,对所述干扰光斑进行干扰验证。The
可选的,如图11所示,所述干扰验证模块15,包括:Optionally, as shown in FIG. 11 , the
彩色验证单元151,用于确定所述干扰光斑在所述彩色图像中的第三位置,以及确定所述干扰光斑对应的至少一个邻近光斑在所述彩色图像中的第四位置;基于所述第三位置以及所述第四位置,得到针对所述干扰光斑的彩色像素验证结果;The
深度验证单元152,用于确定所述干扰光斑在所述深度图像中的第一位置,以及确定所述干扰光斑对应的至少一个邻近光斑在所述深度图像中的第二位置;基于所述第一位置以及所述第二位置,得到针对所述干扰光斑的深度像素验证结果;The
结果生成单元153,用于基于所述彩色像素验证结果和所述深度像素验证结果,得到针对所述干扰光斑的干扰验证结果。The
可选的,如图10所示,所述装置1,还包括:Optionally, as shown in FIG. 10 , the
曝光调整模块15,用于获取所述光斑对应的光斑数量,若所述光斑数量大于数量阈值,则对相机曝光时间进行调整。The
需要说明的是,上述实施例提供的图像处理装置在执行图像处理方法时,仅以上述至少一个功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的图像处理装置与图像处理方法实施例属于同一构思,其体现实现过程详见方法实施例,这里不再赘述。It should be noted that, when the image processing apparatus provided in the above embodiments executes the image processing method, only the division of the above at least one functional module is used as an example for illustration. In practical applications, the above functions may be allocated to different functional modules as required. To complete, that is, to divide the internal structure of the device into different functional modules to complete all or part of the functions described above. In addition, the image processing apparatus and the image processing method embodiments provided by the above embodiments belong to the same concept, and the embodiment and implementation process thereof are detailed in the method embodiments, which will not be repeated here.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
在本申请实施例中,通过获取反射强度图,确定反射强度图中的至少一个光斑,然后获取所述光斑中光斑像素点对应的像素特征参数,基于像素特征参数在干扰光斑与有效光斑上像素特征参数的差异,可以从至少一个光斑中准确确定干扰光斑,可以辅助消除由于多个光斑的边缘信号叠加造成的光斑干扰;整个图像干扰处理过程减轻了对设备硬件、复杂算法的依赖,实现了准确识别光斑干扰,能够辅助输出高精度的深度测量结果,提升了深度测量场景下的鲁棒性;以及,可以结合不同的光斑干扰检测方式或基于实际应用场景确定的不同时序的光斑干扰检测方式,优化了干扰光斑的检测流程。In the embodiment of the present application, by acquiring the reflection intensity map, at least one light spot in the reflection intensity map is determined, and then the pixel feature parameters corresponding to the pixel points of the light spot in the light spot are obtained, and the pixels on the interference light spot and the effective light spot are based on the pixel feature parameters. The difference in characteristic parameters can accurately determine the interference light spot from at least one light spot, and can assist in eliminating the light spot interference caused by the superposition of the edge signals of multiple light spots; Accurately identify light spot interference, which can assist in outputting high-precision depth measurement results and improve the robustness in depth measurement scenarios; and, it can combine different light spot interference detection methods or different time sequence light spot interference detection methods determined based on actual application scenarios. , which optimizes the detection process of interference light spots.
本申请实施例还提供了一种计算机存储介质,所述计算机存储介质可以存储有多条指令,所述指令适于由处理器加载并执行如上述图1~图7所示实施例的所述图像处理方法,具体执行过程可以参见图1~图7所示实施例的具体说明,在此不进行赘述。Embodiments of the present application further provide a computer storage medium, where the computer storage medium can store multiple instructions, and the instructions are suitable for being loaded by a processor and executing the above-described embodiments shown in FIG. 1 to FIG. 7 . For the specific execution process of the image processing method, reference may be made to the specific descriptions of the embodiments shown in FIG. 1 to FIG. 7 , which will not be repeated here.
本申请还提供了一种计算机程序产品,该计算机程序产品存储有至少一条指令,所述至少一条指令由所述处理器加载并执行如上述图1~图7所示实施例的所述图像处理方法,具体执行过程可以参见图1~图7所示实施例的具体说明,在此不进行赘述。The present application also provides a computer program product, where the computer program product stores at least one instruction, and the at least one instruction is loaded by the processor and executes the image processing in the embodiments shown in FIG. 1 to FIG. 7 . For the specific execution process, reference may be made to the specific descriptions of the embodiments shown in FIG. 1 to FIG. 7 , which will not be repeated here.
请参考图12,其示出了本申请一个示例性实施例提供的电子设备的结构方框图。本申请中的电子设备可以包括一个或多个如下部件:处理器110、存储器120、输入装置130、输出装置140和总线150。处理器110、存储器120、输入装置130和输出装置140之间可以通过总线150连接。Please refer to FIG. 12 , which shows a structural block diagram of an electronic device provided by an exemplary embodiment of the present application. An electronic device in this application may include one or more of the following components: a
处理器110可以包括一个或者多个处理核心。处理器110利用至少一个种接口和线路连接整个电子设备内的至少一个个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行电子设备100的至少一个种功能和处理数据。可选地,处理器110可以采用数字信号处理(digital signalprocessing,DSP)、现场可编程门阵列(field-programmable gate array,FPGA)、可编程逻辑阵列(programmable logic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(central processing unit,CPU)、图像处理器(graphics processingunit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。The
存储器120可以包括随机存储器(random Access Memory,RAM),也可以包括只读存储器(read-only memory,ROM)。可选地,该存储器120包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述至少一个个方法实施例的指令等,该操作系统可以是安卓(Android)系统,包括基于Android系统深度开发的系统、苹果公司开发的IOS系统,包括基于IOS系统深度开发的系统或其它系统。存储数据区还可以存储电子设备在使用中所创建的数据比如电话本、音视频数据、聊天记录数据,等。The
参见图13所示,存储器120可分为操作系统空间和用户空间,操作系统即运行于操作系统空间,原生及第三方应用程序即运行于用户空间。为了保证不同第三方应用程序均能够达到较好的运行效果,操作系统针对不同第三方应用程序为其分配相应的系统资源。然而,同一第三方应用程序中不同应用场景对系统资源的需求也存在差异,比如,在本地资源加载场景下,第三方应用程序对磁盘读取速度的要求较高;在动画渲染场景下,第三方应用程序则对GPU性能的要求较高。而操作系统与第三方应用程序之间相互独立,操作系统往往不能及时感知第三方应用程序当前的应用场景,导致操作系统无法根据第三方应用程序的具体应用场景进行针对性的系统资源适配。Referring to FIG. 13 , the
为了使操作系统能够区分第三方应用程序的具体应用场景,需要打通第三方应用程序与操作系统之间的数据通信,使得操作系统能够随时获取第三方应用程序当前的场景信息,进而基于当前场景进行针对性的系统资源适配。In order to enable the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up the data communication between the third-party application and the operating system, so that the operating system can obtain the current scene information of the third-party application at any time, and then perform the operation based on the current scene. Targeted system resource adaptation.
以操作系统为Android系统为例,存储器120中存储的程序和数据如图14所示,存储器120中可存储有Linux内核层320、系统运行时库层340、应用框架层360和应用层380,其中,Linux内核层320、系统运行库层340和应用框架层360属于操作系统空间,应用层380属于用户空间。Linux内核层320为电子设备的至少一个种硬件提供了底层的驱动,如显示驱动、音频驱动、摄像头驱动、蓝牙驱动、Wi-Fi驱动、电源管理等。系统运行库层340通过一些C/C++库来为Android系统提供了主要的特性支持。如SQLite库提供了数据库的支持,OpenGL/ES库提供了3D绘图的支持,Webkit库提供了浏览器内核的支持等。在系统运行时库层340中还提供有安卓运行时库(Android runtime),它主要提供了一些核心库,能够允许开发者使用Java语言来编写Android应用。应用框架层360提供了构建应用程序时可能用到的至少一个种API,开发者也可以通过使用这些API来构建自己的应用程序,比如活动管理、窗口管理、视图管理、通知管理、内容提供者、包管理、通话管理、资源管理、定位管理。应用层380中运行有至少一个应用程序,这些应用程序可以是操作系统自带的原生应用程序,比如联系人程序、短信程序、时钟程序、相机应用等;也可以是第三方开发者所开发的第三方应用程序,比如游戏类应用程序、即时通信程序、相片美化程序等。Taking the Android system as the operating system as an example, the programs and data stored in the
以操作系统为IOS系统为例,存储器120中存储的程序和数据如图15所示,IOS系统包括:核心操作系统层420(Core OS layer)、核心服务层440(Core Services layer)、媒体层460(Media layer)、可触摸层480(Cocoa Touch Layer)。核心操作系统层420包括了操作系统内核、驱动程序以及底层程序框架,这些底层程序框架提供更接近硬件的功能,以供位于核心服务层440的程序框架所使用。核心服务层440提供给应用程序所需要的系统服务和/或程序框架,比如基础(Foundation)框架、账户框架、广告框架、数据存储框架、网络连接框架、地理位置框架、运动框架等等。媒体层460为应用程序提供有关视听方面的接口,如图形图像相关的接口、音频技术相关的接口、视频技术相关的接口、音视频传输技术的无线播放(AirPlay)接口等。可触摸层480为应用程序开发提供了至少一个种常用的界面相关的框架,可触摸层480负责用户在电子设备上的触摸交互操作。比如本地通知服务、远程推送服务、广告框架、游戏工具框架、消息用户界面接口(User Interface,UI)框架、用户界面UIKit框架、地图框架等等。Taking the operating system as the IOS system as an example, the programs and data stored in the
在图15所示出的框架中,与大部分应用程序有关的框架包括但不限于:核心服务层440中的基础框架和可触摸层480中的UIKit框架。基础框架提供许多基本的对象类和数据类型,为所有应用程序提供最基本的系统服务,和UI无关。而UIKit框架提供的类是基础的UI类库,用于创建基于触摸的用户界面,iOS应用程序可以基于UIKit框架来提供UI,所以它提供了应用程序的基础架构,用于构建用户界面,绘图、处理和用户交互事件,响应手势等等。Among the frameworks shown in FIG. 15 , frameworks related to most applications include but are not limited to: the basic framework in the core service layer 440 and the UIKit framework in the touchable layer 480 . The basic framework provides many basic object classes and data types, and provides the most basic system services for all applications, regardless of UI. The classes provided by the UIKit framework are the basic UI class libraries for creating touch-based user interfaces. iOS applications can provide UI based on the UIKit framework, so it provides the application's infrastructure for building user interfaces, drawing , handling and user interaction events, responding to gestures, and more.
其中,在IOS系统中实现第三方应用程序与操作系统数据通信的方式以及原理可参考Android系统,本申请在此不再赘述。The method and principle of implementing data communication between a third-party application and an operating system in the IOS system may refer to the Android system, which will not be repeated in this application.
其中,输入装置130用于接收输入的指令或数据,输入装置130包括但不限于键盘、鼠标、摄像头、麦克风或触控设备。输出装置140用于输出指令或数据,输出装置140包括但不限于显示设备和扬声器等。在一个示例中,输入装置130和输出装置140可以合设,输入装置130和输出装置140为触摸显示屏,该触摸显示屏用于接收用户使用手指、触摸笔等任何适合的物体在其上或附近的触摸操作,以及显示至少一个个应用程序的用户界面。触摸显示屏通常设置在电子设备的前面板。触摸显示屏可被设计成为全面屏、曲面屏或异型屏。触摸显示屏还可被设计成为全面屏与曲面屏的结合,异型屏与曲面屏的结合,本申请实施例对此不加以限定。The
除此之外,本领域技术人员可以理解,上述附图所示出的电子设备的结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。比如,电子设备中还包括射频电路、输入单元、传感器、音频电路、无线保真(wireless fidelity,WiFi)模块、电源、蓝牙模块等部件,在此不再赘述。In addition, those skilled in the art can understand that the structure of the electronic device shown in the above drawings does not constitute a limitation to the electronic device, and the electronic device may include more or less components than those shown in the drawings, or a combination of certain components may be included. some components, or a different arrangement of components. For example, the electronic device further includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, and a Bluetooth module, which will not be repeated here.
在本申请实施例中,至少一个步骤的执行主体可以是上文介绍的电子设备。可选地,至少一个步骤的执行主体为电子设备的操作系统。操作系统可以是安卓系统,也可以是IOS系统,或者其它操作系统,本申请实施例对此不作限定。In this embodiment of the present application, the execution body of at least one step may be the electronic device described above. Optionally, the execution body of at least one step is an operating system of the electronic device. The operating system may be an Android system, an IOS system, or other operating systems, which are not limited in this embodiment of the present application.
本申请实施例的电子设备,其上还可以安装有显示设备,显示设备可以是至少一个种能实现显示功能的设备,例如:阴极射线管显示器(cathode ray tubedisplay,简称CR)、发光二极管显示器(light-emitting diode display,简称LED)、电子墨水屏、液晶显示屏(liquid crystal display,简称LCD)、等离子显示面板(plasma display panel,简称PDP)等。用户可以利用电子设备101上的显示设备,来查看显示的文字、图像、视频等信息。所述电子设备可以是智能手机、平板电脑、游戏设备、AR(Augmented Reality,增强现实)设备、汽车、数据存储装置、音频播放装置、视频播放装置、笔记本、桌面计算设备、The electronic device according to the embodiment of the present application may also be mounted with a display device, and the display device may be at least one device capable of realizing a display function, such as a cathode ray tube display (CR for short), a light emitting diode display ( light-emitting diode display, referred to as LED), electronic ink screen, liquid crystal display (liquid crystal display, referred to as LCD), plasma display panel (plasma display panel, referred to as PDP) and so on. The user can use the display device on the electronic device 101 to view the displayed text, image, video and other information. The electronic device may be a smart phone, a tablet computer, a game device, an AR (Augmented Reality, augmented reality) device, a car, a data storage device, an audio playback device, a video playback device, a notebook, a desktop computing device,
在图12所示的电子设备中,其中电子设备可以是一种终端,处理器110可以用于调用存储器120中存储的网络优化应用程序,并具体执行以下操作:In the electronic device shown in FIG. 12, the electronic device may be a terminal, and the
获取反射强度图,确定所述反射强度图中的至少一个光斑;acquiring a reflection intensity map, and determining at least one light spot in the reflection intensity map;
获取所述光斑中光斑像素点对应的像素特征参数;obtaining the pixel characteristic parameters corresponding to the pixel points of the light spot in the light spot;
基于所述像素特征参数,从所述至少一个光斑中确定干扰光斑。Interfering light spots are determined from the at least one light spot based on the pixel characteristic parameters.
在一个实施例中,所述处理器110在执行所述基于所述像素特征参数,从所述至少一个光斑中确定干扰光斑时,具体执行以下操作:In one embodiment, the
确定针对反射强度图的至少一种光斑干扰检测方式,基于所述像素特征参数采用所述光斑干扰检测方式对至少一个所述光斑进行光斑干扰检测处理,得到干扰光斑。At least one light spot interference detection method for the reflection intensity map is determined, and based on the pixel characteristic parameter, the light spot interference detection method is used to perform a light spot interference detection process on at least one of the light spots to obtain an interference light spot.
在一个实施例中,所述处理器110在执行所述基于所述像素特征参数采用所述光斑干扰检测方式对至少一个所述光斑进行光斑干扰检测处理得到干扰光斑时,具体执行以下操作:In one embodiment, the
若所述光斑干扰检测方式为像素点强度检测方式,则基于像素强度参数对至少一个光斑进行像素点强度检测处理,得到第一干扰光斑;If the light spot interference detection method is a pixel intensity detection method, performing pixel intensity detection processing on at least one light spot based on a pixel intensity parameter to obtain a first interference light spot;
若所述光斑干扰检测方式为能量比例检测方式,则基于所述像素强度参数对至少一个光斑进行能量比例检测处理,得到第二干扰光斑;If the light spot interference detection method is an energy proportional detection method, performing energy proportional detection processing on at least one light spot based on the pixel intensity parameter to obtain a second interference light spot;
若所述光斑干扰检测方式为像素点均值检测方式,则基于所述像素强度参数对至少一个光斑进行像素点均值检测处理,得到第三干扰光斑;If the light spot interference detection method is a pixel point average detection method, performing pixel point average detection processing on at least one light spot based on the pixel intensity parameter to obtain a third interference light spot;
若所述光斑干扰检测方式为能量总强度检测方式,则基于所述像素强度参数对至少一个光斑进行能量总强度检测处理,得到第四干扰光斑;If the light spot interference detection method is a total energy intensity detection method, performing total energy intensity detection processing on at least one light spot based on the pixel intensity parameter to obtain a fourth interference light spot;
若所述光斑干扰检测方式为光斑位置检测方式,则基于像素位置参数对至少一个光斑进行光斑位置检测处理,得到第五干扰光斑。If the light spot interference detection method is a light spot position detection method, the light spot position detection process is performed on at least one light spot based on the pixel position parameter to obtain a fifth interference light spot.
在一个实施例中,所述处理器110在执行所述基于像素强度参数对至少一个光斑进行像素点强度检测处理,得到第一干扰光斑时,具体执行以下步骤:In one embodiment, when the
基于所述像素强度参数确定所述光斑像素点对应的第一强度优先级,以及获取针对所述反射强度图的目标光斑点占比;Determine the first intensity priority corresponding to the light spot pixel point based on the pixel intensity parameter, and obtain the target light spot ratio for the reflection intensity map;
基于所述目标光斑点占比、所述光斑像素点的第一强度优先级以及所述光斑像素点的像素强度参数,确定强度阈值。An intensity threshold is determined based on the target light spot ratio, the first intensity priority of the light spot pixels, and the pixel intensity parameters of the light spot pixels.
基于所述强度阈值,从至少一个所述光斑中确定第一干扰光斑。Based on the intensity threshold, a first interfering light spot is determined from at least one of the light spots.
在一个实施例中,所述处理器110在执行所述基于所述目标光斑点占比、所述光斑像素点的第一强度优先级以及所述光斑像素点的像素强度参数,确定强度阈值,基于所述强度阈值,从至少一个所述光斑中确定第一干扰光斑时,具体执行以下步骤:In one embodiment, the
基于所述目标光斑点占比以及所述光斑像素点的第一强度优先级确定第一光斑点以及获取第一光斑点对应的第一强度阈值,基于所述第一强度阈值从至少一个所述光斑中确定第一干扰光斑;或,Determine a first light spot based on the proportion of the target light spot and the first intensity priority of the light spot pixel point and obtain a first intensity threshold corresponding to the first light spot, based on the first intensity threshold from at least one of the Identify the first interfering spot in the spot; or,
获取所述光斑对应的参考像素点数量,确定所述目标光斑点占比与所述参考像素点数量对应的目标比值,基于所述目标比值以及所述光斑像素点的第一强度优先级确定第二光斑点以及获取第二光斑点对应的第二强度阈值,基于所述第二强度阈值从至少一个所述光斑中确定第一干扰光斑;或,Obtain the number of reference pixels corresponding to the light spot, determine the target ratio corresponding to the proportion of the target light spots and the number of reference pixels, and determine the first intensity priority based on the target ratio and the first intensity priority of the light spot pixels. two light spots and acquiring a second intensity threshold corresponding to the second light spot, and determining a first interference light spot from at least one of the light spots based on the second intensity threshold; or,
基于所述目标光斑点占比以及所述光斑像素点的第一强度优先级确定第一光斑点以及获取第一光斑点对应的第一强度阈值,获取所述光斑对应的参考像素点数量,确定所述目标光斑点占比与所述参考像素点数量对应的目标比值,基于所述目标比值以及所述光斑像素点的第一强度优先级确定第二光斑点以及获取第二光斑点对应的第二强度阈值,基于所述第一强度阈值以及所述第二强度阈值从至少一个所述光斑中确定第一干扰光斑。Determine the first light spot based on the proportion of the target light spot and the first intensity priority of the light spot pixel points, obtain the first intensity threshold corresponding to the first light spot, obtain the number of reference pixels corresponding to the light spot, and determine The target ratio corresponding to the proportion of the target light spots and the number of reference pixels, the second light spot is determined based on the target ratio and the first intensity priority of the light spot pixels, and the first light spot corresponding to the second light spot is obtained. Two intensity thresholds, a first interfering light spot is determined from at least one of the light spots based on the first intensity threshold and the second intensity threshold.
在一个实施例中,所述处理器110在执行所述基于所述第一强度阈值以及所述第二强度阈值从至少一个所述光斑中确定第一干扰光斑时,具体执行以下步骤:In one embodiment, when the
基于所述第一强度阈值以及所述第二强度阈值确定阈值参考范围;determining a threshold reference range based on the first intensity threshold and the second intensity threshold;
从所述阈值参考范围中获取目标强度阈值,基于所述目标强度阈值从至少一个所述光斑中确定第一干扰光斑。A target intensity threshold is obtained from the threshold reference range, and a first interfering light spot is determined from at least one of the light spots based on the target intensity threshold.
在一个实施例中,所述处理器110在执行所述基于所述像素强度参数对至少一个光斑进行能量比例检测处理,得到第二干扰光斑时,具体执行以下步骤:In one embodiment, when the
获取至少一个所述光斑对应的中心点强度值以及所述边缘点强度值;acquiring at least one intensity value of the center point corresponding to the light spot and the intensity value of the edge point;
基于所述中心点强度值以及所述边缘点强度值对至少一个光斑进行能量比例检测处理,从至少一个所述光斑中确定第二干扰光斑。An energy ratio detection process is performed on at least one light spot based on the central point intensity value and the edge point intensity value, and a second interference light spot is determined from at least one of the light spots.
在一个实施例中,所述处理器110在执行所述基于所述中心点强度值以及所述边缘点强度值对至少一个光斑进行能量比例检测处理,从至少一个所述光斑中确定第二干扰光斑时,具体执行以下步骤:In one embodiment, the
基于所述中心点强度值与所述边缘点强度值确定所述光斑的第一强度比例;基于所述第一强度比例和强度比例阈值,从至少一个所述光斑中确定第二干扰光斑;和/或,determining a first intensity ratio of the light spot based on the center point intensity value and the edge point intensity value; determining a second interfering light spot from at least one of the light spots based on the first intensity ratio and an intensity ratio threshold; and /or,
基于所述中心点强度值与所述边缘点强度值确定所述光斑的第一强度比例;分别获取所述光斑对应的第一光斑,确定所述第一光斑的第二强度比例;基于所述光斑的所述第一强度比例以及所述第二强度比例,从至少一个所述光斑中确定第二干扰光斑。Determine the first intensity ratio of the light spot based on the intensity value of the center point and the edge point intensity value; obtain the first light spot corresponding to the light spot respectively, and determine the second intensity ratio of the first light spot; based on the The first intensity ratio and the second intensity ratio of the light spots determine a second interfering light spot from at least one of the light spots.
在一个实施例中,所述处理器110在执行所述基于所述光斑的所述第一强度比例以及所述第二强度比例,从至少一个所述光斑中确定第二干扰光斑时,具体执行以下步骤:In one embodiment, when the
基于所述第一强度比例以及所述第二强度比例,确定目标差值;基于所述目标差值以及差值阈值从至少一个所述光斑中确定第二干扰光斑;或,determining a target difference based on the first intensity ratio and the second intensity ratio; determining a second interfering light spot from at least one of the light spots based on the target difference and a difference threshold; or,
以所述第一强度比例为参考,基于至少一个所述第二强度比例确定针对所述第一光斑的强度比例波动范围;基于所述强度比例波动范围和参考波动范围,从至少一个所述光斑中确定第二干扰光斑。Using the first intensity ratio as a reference, determine an intensity ratio fluctuation range for the first light spot based on at least one of the second intensity ratios; based on the intensity ratio fluctuation range and the reference fluctuation range, from at least one of the light spots Determine the second interference spot.
在一个实施例中,所述处理器110在执行所述获取所述光斑对应的第一光斑时,具体执行以下步骤:获取与所述光斑相邻的邻近光斑,将所述邻近光斑作为所述光斑对应的第一光斑;或,In one embodiment, when the
获取所述光斑与至少一个第二光斑的目标距离,基于所述目标距离与距离阈值从所述至少一个第二光斑中确定所述光斑对应的第一光斑。A target distance between the light spot and at least one second light spot is acquired, and a first light spot corresponding to the light spot is determined from the at least one second light spot based on the target distance and a distance threshold.
在一个实施例中,所述处理器110在执行所述基于所述像素强度参数对至少一个光斑进行像素点均值检测处理,得到第三干扰光斑时,具体执行以下步骤:确定至少一个所述光斑对应的目标像素区域,所述光斑位于所述目标像素区域内;In one embodiment, the
基于所述像素强度参数确定针对至少一个所述光斑的光斑像素点均值,确定至少一个所述目标像素区域对应的区域像素点均值;Determine, based on the pixel intensity parameter, a pixel mean value of a light spot for at least one of the light spots, and determine a regional pixel mean value corresponding to at least one of the target pixel regions;
基于所述光斑像素点均值以及所述区域像素点均值对至少一个光斑进行像素点均值检测处理,从至少一个所述光斑中确定第三干扰光斑。Perform pixel point average detection processing on at least one light spot based on the light spot pixel average value and the regional pixel average value, and determine a third interference light spot from at least one of the light spots.
在一个实施例中,所述处理器110在执行所述基于所述像素强度参数确定针对至少一个所述光斑的光斑像素点均值,确定至少一个所述目标像素区域对应的区域像素点均值时,具体执行以下步骤:In one embodiment, when the
获取至少一个所述光斑的全部光斑像素点对应的第一总强度以及光斑像素点总数量,将所述第一总强度与光斑像素点总数量的商作为所述光斑的光斑像素点均值;Obtain the first total intensity and the total number of light spot pixels corresponding to all the light spot pixels of at least one of the light spots, and use the quotient of the first total intensity and the total number of light spot pixels as the light spot pixel mean of the light spot;
获取至少一个所述目标像素区域的全部区域像素点对应的第二总强度以及区域像素点总数量,将所述第二总强度与区域像素点总数量的商作为所述目标像素区域对应的区域像素点均值。Obtain the second total intensity and the total number of regional pixels corresponding to all area pixels of at least one of the target pixel areas, and take the quotient of the second total intensity and the total number of regional pixels as the area corresponding to the target pixel area pixel mean.
在一个实施例中,所述处理器110在执行所述基于所述光斑像素点均值以及所述区域像素点均值对至少一个光斑进行像素点均值检测处理,从至少一个所述光斑中确定第三干扰光斑时,具体执行以下步骤:确定所述光斑像素点均值与所述区域像素点均值对应的参考比值;In one embodiment, the
基于所述参考比值与比值阈值对至少一个光斑进行像素点均值检测处理,从至少一个所述光斑中确定第三干扰光斑。Perform pixel point mean detection processing on at least one light spot based on the reference ratio and the ratio threshold, and determine a third interference light spot from at least one of the light spots.
在一个实施例中,所述处理器110在执行所述基于所述像素强度参数对至少一个光斑进行能量总强度检测处理,得到第四干扰光斑时,具体执行以下步骤:基于所述像素强度参数,确定参考区域内第三光斑的光斑强度以及所有第四光斑对应的光斑强度均值;所述第四光斑为所述参考区域中除所述第三光斑之外的光斑;In one embodiment, the
基于所述第三光斑的光斑强度以及所述光斑强度均值对所述第三光斑进行能量总强度检测处理,确定第四干扰光斑。The total energy intensity detection process is performed on the third light spot based on the light spot intensity of the third light spot and the average value of the light spot intensity, and a fourth interference light spot is determined.
在一个实施例中,所述参考区域包括的所有光斑为第四光斑以及所述第三光斑为所有所述第四光斑中的其一;或,所述参考区域包括所述第三光斑和所有第四光斑。In one embodiment, all the light spots included in the reference area are fourth light spots and the third light spot is one of all the fourth light spots; or, the reference area includes the third light spot and all the fourth light spots Fourth spot.
在一个实施例中,所述处理器110在执行基于所述像素强度参数,确定参考区域内第三光斑的光斑强度以及所有第四光斑对应的光斑强度均值之前,还执行以下步骤:获取参考区域对应的光斑总数量;若所述光斑总数量大于光斑数量阈值,则执行所述基于所述像素强度参数,确定参考区域内第三光斑的光斑强度以及所有第四光斑对应的光斑强度均值的步骤;或,In one embodiment, before the
获取参考区域中两两光斑之间的光斑间隔距离,若所述光斑间隔距离小于间隔距离阈值,则执行所述基于所述像素强度参数,确定参考区域内第三光斑的光斑强度以及所有第四光斑对应的光斑强度均值的步骤。Obtain the spot interval distance between two spots in the reference area, and if the spot interval distance is less than the interval distance threshold, execute the determining the spot intensity of the third spot in the reference area and all fourth spots based on the pixel intensity parameter. Steps for the mean value of the spot intensity corresponding to the spot.
在一个实施例中,所述处理器110在执行所述基于所述第三光斑的光斑强度以及所述光斑强度均值对所述第三光斑进行能量总强度检测处理,确定第四干扰光斑时,具体执行以下步骤:In one embodiment, when the
确定所述第三光斑的光斑强度与所述光斑强度均值的强度比例;determining the intensity ratio of the light spot intensity of the third light spot to the mean value of the light spot intensity;
若所述强度比例小于或等于第一比例阈值,则将所述第三光斑作为第四干扰光斑。If the intensity ratio is less than or equal to the first ratio threshold, the third light spot is used as the fourth interference light spot.
在一个实施例中,所述处理器110在执行所述基于像素位置参数对至少一个光斑进行光斑位置检测处理,得到第五干扰光斑时,具体执行以下步骤:In one embodiment, when the
基于像素位置参数确定针对所述至少一个光斑的光斑位置;获取至少一个所述光斑对应的参考位置范围;Determine a spot position for the at least one spot based on the pixel position parameter; obtain a reference position range corresponding to at least one of the spots;
若所述光斑的光斑位置与所述参考位置范围不匹配,则将所述光斑确定为第五干扰光斑。If the light spot position of the light spot does not match the reference position range, the light spot is determined as the fifth interference light spot.
在一个实施例中,所述处理器110在执行所述从所述至少一个光斑中确定干扰光斑之后,还执行以下步骤:In one embodiment, after the
获取彩色图像和深度图像,所述反射强度图、所述深度图像和所述彩色图像均为针对同一目标对象的不同类图像;acquiring a color image and a depth image, wherein the reflection intensity map, the depth image and the color image are images of different types for the same target object;
基于所述彩色图像和所述深度图像,对所述干扰光斑进行干扰验证。Based on the color image and the depth image, interference verification is performed on the interference light spot.
在一个实施例中,所述处理器110在执行所述基于所述彩色图像和所述深度图像,对所述干扰光斑进行干扰验证时,具体执行以下步骤:In one embodiment, when the
确定所述干扰光斑在所述深度图像中的第一位置,以及确定所述干扰光斑对应的至少一个邻近光斑在所述深度图像中的第二位置;基于所述第一位置以及所述第二位置,得到针对所述干扰光斑的深度像素验证结果;determining a first position of the interference light spot in the depth image, and determining a second position of at least one adjacent light spot corresponding to the interference light spot in the depth image; based on the first position and the second position position, obtain the depth pixel verification result for the interference light spot;
确定所述干扰光斑在所述彩色图像中的第三位置,以及确定所述干扰光斑对应的至少一个邻近光斑在所述彩色图像中的第四位置;基于所述第三位置以及所述第四位置,得到针对所述干扰光斑的彩色像素验证结果;determining a third position of the interference light spot in the color image, and determining a fourth position of at least one adjacent light spot corresponding to the interference light spot in the color image; based on the third position and the fourth position position, obtain the color pixel verification result for the interference light spot;
基于所述彩色像素验证结果和所述深度像素验证结果,得到针对所述干扰光斑的干扰验证结果。Based on the color pixel verification result and the depth pixel verification result, an interference verification result for the interference light spot is obtained.
在一个实施例中,所述处理器110在执行所述获取反射强度图,确定所述反射强度图中的至少一个光斑之后,还执行以下步骤:In one embodiment, after the
获取所述光斑对应的光斑数量;Obtain the number of light spots corresponding to the light spots;
若所述光斑数量大于数量阈值,则对相机曝光时间进行调整If the number of light spots is greater than the number threshold, adjust the camera exposure time
在本申请实施例中,通过获取反射强度图,确定反射强度图中的至少一个光斑,然后获取所述光斑中光斑像素点对应的像素特征参数,基于像素特征参数在干扰光斑与有效光斑上像素特征参数的差异,可以从至少一个光斑中准确确定干扰光斑,可以辅助消除由于多个光斑的边缘信号叠加造成的光斑干扰;整个图像干扰处理过程减轻了对设备硬件、复杂算法的依赖,实现了准确识别光斑干扰,能够辅助输出高精度的深度测量结果,提升了深度测量场景下的鲁棒性;以及,可以结合不同的光斑干扰检测方式或基于实际应用场景确定的不同时序的光斑干扰检测方式,优化了干扰光斑的检测流程。In the embodiment of the present application, by acquiring the reflection intensity map, at least one light spot in the reflection intensity map is determined, and then the pixel feature parameters corresponding to the pixel points of the light spot in the light spot are obtained, and the pixels on the interference light spot and the effective light spot are based on the pixel feature parameters. The difference in characteristic parameters can accurately determine the interference spot from at least one spot, and can assist in eliminating the spot interference caused by the superposition of the edge signals of multiple spots; Accurately identify light spot interference, which can assist in outputting high-precision depth measurement results, and improve the robustness in depth measurement scenarios; and, it can combine different light spot interference detection methods or different time sequence light spot interference detection methods determined based on actual application scenarios. , which optimizes the detection process of interference light spots.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述至少一个方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体或随机存储记忆体等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When executed, the flow of at least one method embodiment described above may be included. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only storage memory or a random storage memory, and the like.
以上所揭露的仅为本申请较佳实施例而已,当然不能以此来限定本申请之权利范围,因此依本申请权利要求所作的等同变化,仍属本申请所涵盖的范围。The above disclosures are only the preferred embodiments of the present application, and of course, the scope of the rights of the present application cannot be limited by this. Therefore, equivalent changes made according to the claims of the present application are still within the scope of the present application.
Claims (24)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210375698.XA CN114708232B (en) | 2022-04-11 | 2022-04-11 | Image processing method, device, storage medium and electronic device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210375698.XA CN114708232B (en) | 2022-04-11 | 2022-04-11 | Image processing method, device, storage medium and electronic device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114708232A true CN114708232A (en) | 2022-07-05 |
| CN114708232B CN114708232B (en) | 2025-05-13 |
Family
ID=82172038
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210375698.XA Active CN114708232B (en) | 2022-04-11 | 2022-04-11 | Image processing method, device, storage medium and electronic device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114708232B (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115372933A (en) * | 2022-08-31 | 2022-11-22 | 深圳市欢创科技有限公司 | Stray light filtering method and device and laser radar |
| CN115393327A (en) * | 2022-08-29 | 2022-11-25 | 浙江大华技术股份有限公司 | Hot spot detection method and device, electronic equipment and storage medium |
| CN115409737A (en) * | 2022-09-23 | 2022-11-29 | Oppo广东移动通信有限公司 | Image processing method and device, electronic equipment and computer readable storage medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101922918A (en) * | 2010-07-08 | 2010-12-22 | 上海雷尼威尔测量技术有限公司 | Ambient light adaptive displacement measuring device and measuring method thereof |
| CN106651801A (en) * | 2016-12-23 | 2017-05-10 | Tcl集团股份有限公司 | Method and system for removing noises during light spot locating |
| WO2020064896A1 (en) * | 2018-09-28 | 2020-04-02 | Carl Zeiss Meditec Ag | Method for the biometric measurement of the eye |
| CN112950694A (en) * | 2021-02-08 | 2021-06-11 | Oppo广东移动通信有限公司 | Image fusion method, single camera module, shooting device and storage medium |
| CN112987022A (en) * | 2021-03-11 | 2021-06-18 | Oppo广东移动通信有限公司 | Distance measurement method and device, computer readable medium and electronic equipment |
-
2022
- 2022-04-11 CN CN202210375698.XA patent/CN114708232B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101922918A (en) * | 2010-07-08 | 2010-12-22 | 上海雷尼威尔测量技术有限公司 | Ambient light adaptive displacement measuring device and measuring method thereof |
| CN106651801A (en) * | 2016-12-23 | 2017-05-10 | Tcl集团股份有限公司 | Method and system for removing noises during light spot locating |
| WO2020064896A1 (en) * | 2018-09-28 | 2020-04-02 | Carl Zeiss Meditec Ag | Method for the biometric measurement of the eye |
| CN112950694A (en) * | 2021-02-08 | 2021-06-11 | Oppo广东移动通信有限公司 | Image fusion method, single camera module, shooting device and storage medium |
| CN112987022A (en) * | 2021-03-11 | 2021-06-18 | Oppo广东移动通信有限公司 | Distance measurement method and device, computer readable medium and electronic equipment |
Non-Patent Citations (2)
| Title |
|---|
| MING GAO等: "Multiple Facula Targets Recognition Based on Particular Distribution", 2008 INTERNATIONAL CONFERENCE ON AUDIO, LANGUAGE AND IMAGE PROCESSING, 8 August 2008 (2008-08-08), pages 753 - 758 * |
| 戴淖敏等: "激光照射光斑检测方法", 长春理工大学学报 (自然科学版), vol. 38, no. 1, 28 February 2015 (2015-02-28), pages 119 - 123 * |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115393327A (en) * | 2022-08-29 | 2022-11-25 | 浙江大华技术股份有限公司 | Hot spot detection method and device, electronic equipment and storage medium |
| CN115372933A (en) * | 2022-08-31 | 2022-11-22 | 深圳市欢创科技有限公司 | Stray light filtering method and device and laser radar |
| CN115372933B (en) * | 2022-08-31 | 2024-12-10 | 深圳市欢创科技股份有限公司 | A stray light filtering method, device and laser radar |
| CN115409737A (en) * | 2022-09-23 | 2022-11-29 | Oppo广东移动通信有限公司 | Image processing method and device, electronic equipment and computer readable storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114708232B (en) | 2025-05-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN114708232B (en) | Image processing method, device, storage medium and electronic device | |
| JP2022539910A (en) | Electronic device screen area defect inspection method and apparatus | |
| US20170178305A1 (en) | Morphological and geometric edge filters for edge enhancement in depth images | |
| CN113487478A (en) | Image processing method, image processing device, storage medium and electronic equipment | |
| JP2011191298A (en) | Device, method and system for identifying laser spot | |
| US9940701B2 (en) | Device and method for depth image dequantization | |
| CN105913481B (en) | Shadow rendering device and control method thereof | |
| CN116413730B (en) | Ranging method, ranging device, storage medium and laser radar | |
| CN110865812A (en) | User interface identification method and device | |
| JP2016099742A (en) | Information processing apparatus, video projection apparatus, information processing method, and program | |
| CN108881875A (en) | Image white balance processing method and device, storage medium and terminal | |
| CN113066134B (en) | A visual sensor calibration method and device, electronic device and storage medium | |
| JP5850970B2 (en) | Information processing apparatus, video projection apparatus, information processing method, and program | |
| CN109242782B (en) | Noise processing method and device | |
| CN107688426B (en) | Method and device for selecting target object | |
| CN107704397A (en) | Applied program testing method, device and electronic equipment | |
| CN112859050B (en) | Correction method and device for optical distance sensor, storage medium and terminal | |
| CN115499577B (en) | Image processing method and terminal device | |
| US11438708B1 (en) | Method for providing occluded sound effect and electronic device | |
| CN117032500A (en) | Touch recognition method and device for infrared touch equipment, storage medium and equipment | |
| CN116597086A (en) | Image processing method and device | |
| CN112104815A (en) | Image brightness calculation method and device, storage medium and electronic equipment | |
| US20250045882A1 (en) | Enhancing depth representations based on amplitudes of time-of-flight signals | |
| US20250218014A1 (en) | Storing depth information | |
| CN118113176B (en) | Touch processing method, device, medium and electronic device for infrared touch screen |
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 |