[go: up one dir, main page]

CN105227948A - A kind of method and device searching distorted region in image - Google Patents

A kind of method and device searching distorted region in image Download PDF

Info

Publication number
CN105227948A
CN105227948A CN201510598683.XA CN201510598683A CN105227948A CN 105227948 A CN105227948 A CN 105227948A CN 201510598683 A CN201510598683 A CN 201510598683A CN 105227948 A CN105227948 A CN 105227948A
Authority
CN
China
Prior art keywords
area
foreground
depth information
distortion
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510598683.XA
Other languages
Chinese (zh)
Other versions
CN105227948B (en
Inventor
吴磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201510598683.XA priority Critical patent/CN105227948B/en
Publication of CN105227948A publication Critical patent/CN105227948A/en
Application granted granted Critical
Publication of CN105227948B publication Critical patent/CN105227948B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)

Abstract

本发明实施例公开了一种查找图像中畸变区域的方法,包括:获取摄像头采集的目标图像,获取所述目标图像中的前景目标区域;获取所述前景目标区域对应的前景目标的深度信息;根据预设的线性函数以所述前景目标的深度信息为自变量,计算与所述前景目标区域对应的畸变半径;查找前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,将所述查找到的像素点构成的区域判定为畸变区域。本发明还相应的提出了一种查找图像中畸变区域的装置。采用本发明,减少了拍照过程中的处理镜头畸变现象的过程中的计算量,提高了处理效率,提升了用户体验。

The embodiment of the present invention discloses a method for searching a distorted area in an image, comprising: acquiring a target image collected by a camera, acquiring a foreground target area in the target image; acquiring depth information of a foreground target corresponding to the foreground target area; Calculate the distortion radius corresponding to the foreground target area according to a preset linear function with the depth information of the foreground target as an argument; find the pixels in the foreground target area whose distance from the center point of the target image is greater than the distortion radius points, and determine the area formed by the searched pixels as the distorted area. The invention also correspondingly proposes a device for searching the distorted area in the image. By adopting the present invention, the calculation amount in the process of processing the lens distortion phenomenon in the photographing process is reduced, the processing efficiency is improved, and the user experience is improved.

Description

一种查找图像中畸变区域的方法及装置A method and device for finding a distorted region in an image

技术领域technical field

本发明涉及计算机技术领域,尤其涉及一种查找图像中畸变区域的方法及装置。The invention relates to the field of computer technology, in particular to a method and a device for searching a distorted area in an image.

背景技术Background technique

在现有技术中,一般的光学镜头在成像时都会存在一定程度的镜头畸变,难以达到理想透镜成像的效果,并且该镜头畸变是光学透镜固有的固有特性(凸透镜汇聚光线、凹透镜发散光线)而引起的,所以,虽然这种失真对于照片的成像质量是非常不利的,但是也无法完全消除。In the prior art, general optical lenses will have a certain degree of lens distortion when imaging, and it is difficult to achieve the effect of ideal lens imaging, and the lens distortion is an inherent characteristic of optical lenses (convex lens converges light, concave lens diverges light). Therefore, although this distortion is very detrimental to the imaging quality of the photo, it cannot be completely eliminated.

一般来说,用户在使用便携设备如智能手机等进行拍照时,其目的大多是为了再现拍照当时的场景,尤其是为了再现物品、人物或者建筑物等目标的成像区域即目标图像区域是否是真实的,或者是否存在失真情况,而可以忽视非目标图像区域存在的一定程度的图像失真。针对图像出现的畸变、失真等问题,现有技术中存在对图像的畸变进行校正的方法,即事先求取镜头的畸变系数,在成像之后对成像点的坐标进行修正,从而提高图像点坐标的精确度,从而在一定程度上校正图像中出现的畸变现象。但是上述畸变校正的方法需要在成像之后进行一系列的计算,会增加在成像之后的图像处理过程中的计算量。Generally speaking, when users use portable devices such as smart phones to take pictures, their purpose is mostly to reproduce the scene at the time of taking pictures, especially to reproduce the imaging area of objects, people or buildings, that is, whether the target image area is real or not. , or whether there is distortion, but a certain degree of image distortion in the non-target image area can be ignored. Aiming at problems such as image distortion and distortion, there is a method of correcting image distortion in the prior art, that is, obtaining the distortion coefficient of the lens in advance, and correcting the coordinates of the imaging point after imaging, thereby improving the accuracy of the image point coordinates. Accuracy, thereby correcting distortions that appear in the image to a certain extent. However, the above distortion correction method requires a series of calculations after imaging, which will increase the amount of calculations in the image processing process after imaging.

因此,现有技术中对于拍照过程中出现的镜头畸变的处理方式存在计算量大的问题。Therefore, in the prior art, there is a problem of large amount of calculation in the way of processing the lens distortion that occurs during the photographing process.

发明内容Contents of the invention

基于此,为解决上述提到的传统技术中对于拍照过程中出现的镜头畸变的处理方式存在的计算量过大的技术问题,特提供了一种查找图像中畸变区域的方法。Based on this, in order to solve the technical problem of excessive calculation in the above-mentioned traditional technology for processing the lens distortion that occurs during the photographing process, a method for finding the distorted area in the image is specially provided.

一种查找图像中畸变区域的方法,包括:A method of finding distorted regions in an image, comprising:

获取摄像头采集的目标图像,获取所述目标图像中的前景目标区域;Obtain the target image collected by the camera, and obtain the foreground target area in the target image;

获取所述前景目标区域对应的前景目标的深度信息;Obtaining depth information of a foreground object corresponding to the foreground object area;

根据预设的线性函数以所述前景目标的深度信息为自变量,计算与所述前景目标区域对应的畸变半径;calculating a distortion radius corresponding to the foreground object area according to a preset linear function using the depth information of the foreground object as an independent variable;

查找前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,将所述查找到的像素点构成的区域判定为畸变区域。Find the pixel points in the foreground target area whose distance from the center point of the target image is greater than the distortion radius, and determine the area formed by the found pixel points as the distortion area.

可选的,所述获取所述前景目标区域对应的前景目标的深度信息的步骤还包括:通过双摄像头获取所述前景目标区域对应的前景目标的深度信息。Optionally, the step of acquiring the depth information of the foreground object corresponding to the foreground object area further includes: acquiring the depth information of the foreground object corresponding to the foreground object area through dual cameras.

可选的,所述获取所述前景目标区域对应的前景目标的深度信息的步骤还包括:选取所述前景目标区域中预设数量的参考像素点,获取与所述参考像素点对应的深度信息,并计算所有参考像素点的深度信息的平均值,以所述所有参考像素点的深度信息的平均值为所述前景目标区域对应的前景目标的深度信息。Optionally, the step of obtaining the depth information of the foreground object corresponding to the foreground object area further includes: selecting a preset number of reference pixels in the foreground object area, and obtaining the depth information corresponding to the reference pixels , and calculate the average value of the depth information of all reference pixel points, and use the average value of the depth information of all reference pixel points as the depth information of the foreground object corresponding to the foreground object area.

可选的,所述获取所述目标图像中的前景目标区域的步骤还包括:获取所述目标图像中的至少两个前景目标区域;Optionally, the step of acquiring the foreground target area in the target image further includes: acquiring at least two foreground target areas in the target image;

所述获取所述前景目标区域对应的前景目标的深度信息的步骤还包括:分别获取所述至少两个前景目标区域对应的至少两个前景目标的深度信息;The step of obtaining the depth information of the foreground object corresponding to the foreground object area further includes: respectively obtaining the depth information of at least two foreground objects corresponding to the at least two foreground object areas;

所述根据预设的线性函数以所述前景目标的深度信息为自变量,计算与所述前景目标区域对应的畸变半径的步骤还包括:根据预设的线性函数以所述前景目标的深度信息为自变量,分别计算与所述至少两个前景目标区域对应的畸变半径;The step of calculating the distortion radius corresponding to the foreground object area according to the preset linear function using the depth information of the foreground object as an argument further includes: using the depth information of the foreground object according to the preset linear function is an independent variable, respectively calculating the distortion radius corresponding to the at least two foreground target areas;

所述查找前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,将所述查找到的像素点构成的区域判定为畸变区域的步骤还包括:分别查找所述至少两个前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,分别将所述查找到的像素点构成的区域判定为与所述至少两个前景目标区域对应的畸变区域。The step of searching for pixels in the foreground target area whose distance from the center point of the target image is greater than the distortion radius, and determining the area formed by the found pixels as a distortion area further includes: separately searching for the at least two For pixels in the foreground target areas whose distance from the center point of the target image is greater than the distortion radius, the areas formed by the found pixels are respectively determined as the distortion areas corresponding to the at least two foreground target areas.

可选的,所述将所述查找到的像素点构成的区域判定为畸变区域的步骤之后还包括:突出展示所述目标图像中的所述畸变区域,所述突出展示的方式包括高亮、加边框中的至少一种。Optionally, after the step of determining the area formed by the found pixels as a distorted area, it further includes: highlighting the distorted area in the target image, the way of highlighting includes highlighting, Add at least one of the borders.

此外,为解决上述提到的传统技术中对于拍照过程中出现的镜头畸变的处理方式存在的计算量过大的技术问题,本发明还提供了一种查找图像中的畸变区域的装置。In addition, in order to solve the above-mentioned technical problem of excessive calculation in the processing method of the lens distortion occurring in the photographing process in the above-mentioned traditional technology, the present invention also provides a device for searching the distorted area in the image.

一种查找图像中的畸变区域的装置,包括:前景目标区域获取模块,用于获取摄像头采集的目标图像,获取所述目标图像中的前景目标区域;A device for finding a distorted area in an image, comprising: a foreground target area acquisition module, configured to acquire a target image collected by a camera, and acquire a foreground target area in the target image;

深度信息获取模块,用于获取所述前景目标区域对应的前景目标的深度信息;a depth information acquisition module, configured to acquire the depth information of the foreground object corresponding to the foreground object area;

畸变半径计算模块,用于根据预设的线性函数以所述前景目标的深度信息为自变量,计算与所述前景目标区域对应的畸变半径;A distortion radius calculation module, configured to calculate a distortion radius corresponding to the foreground target area according to a preset linear function with the depth information of the foreground target as an independent variable;

畸变区域确定模块,用于查找前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,将所述查找到的像素点构成的区域判定为畸变区域。The distortion area determination module is configured to search for pixels in the foreground target area whose distance from the center point of the target image is greater than the distortion radius, and determine the area formed by the found pixels as the distortion area.

可选的,所述深度信息获取模块还用于:通过双摄像头获取所述前景目标区域对应的前景目标的深度信息。Optionally, the depth information acquisition module is further configured to: acquire the depth information of the foreground object corresponding to the foreground object area through dual cameras.

可选的,所述深度信息获取模块还用于:选取所述前景目标区域中预设数量的参考像素点,获取与所述参考像素点对应的深度信息,并计算所有参考像素点的深度信息的平均值,以所述所有参考像素点的深度信息的平均值为所述前景目标区域对应的前景目标的深度信息。Optionally, the depth information acquisition module is further configured to: select a preset number of reference pixels in the foreground target area, acquire depth information corresponding to the reference pixels, and calculate depth information of all reference pixels The average value of the depth information of all reference pixels is the depth information of the foreground object corresponding to the foreground object area.

可选的,所述前景目标区域获取模块还用于:获取所述目标图像中的至少两个前景目标区域;所述深度信息获取模块还用于:分别获取所述至少两个前景目标区域对应的至少两个前景目标的深度信息;Optionally, the foreground target area acquisition module is further configured to: acquire at least two foreground target areas in the target image; the depth information acquisition module is also configured to: respectively acquire the at least two foreground target areas corresponding Depth information of at least two foreground targets in ;

所述畸变半径计算模块还用于:根据预设的线性函数以所述前景目标的深度信息为自变量,分别计算与所述至少两个前景目标区域对应的畸变半径;The distortion radius calculation module is further configured to: respectively calculate the distortion radii corresponding to the at least two foreground object areas according to a preset linear function with the depth information of the foreground object as an independent variable;

所述畸变区域确定模块还用于:分别查找所述至少两个前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,分别将所述查找到的像素点构成的区域判定为与所述至少两个前景目标区域对应的畸变区域。The distortion area determination module is further configured to: respectively search for pixels in the at least two foreground target areas whose distance from the center point of the target image is greater than the distortion radius, and respectively divide the areas formed by the found pixels into It is determined as a distorted area corresponding to the at least two foreground target areas.

可选的,所述装置还包括突出展示模块,用于突出展示所述目标图像中的所述畸变区域,所述突出展示的方式包括高亮、加边框中的至少一种。Optionally, the device further includes a highlight display module, configured to highlight the distorted region in the target image, and the highlight display manner includes at least one of highlighting and bordering.

实施本发明实施例,将具有如下有益效果:Implementing the embodiment of the present invention will have the following beneficial effects:

采用了上述查找图像中的畸变区域的方法和装置之后,在拍照的过程中,针对镜头的光学固有特性导致的镜头畸变现象,计算用户关心的前景目标或者拍摄主体所在的位置距离镜头的距离,从而确定在该距离位置下会出现畸变现象的区域,若前景目标所在的区域与会出现畸变现象的区域重合,则将该区域标识为畸变区域,也就是说,用户所关心的前景目标或者拍摄主体出现了畸变,需要进行调整。和传统技术相比,上述查找图像中的畸变区域的方法和装置在处理镜头畸变的过程中,避免了在成像之后进行一系列的畸变校正计算,减少了成像过程中的计算量,提高了成像的处理效率。After adopting the above-mentioned method and device for finding the distorted region in the image, in the process of taking pictures, aiming at the lens distortion phenomenon caused by the inherent optical characteristics of the lens, the distance between the foreground target or the position of the subject that the user cares about and the distance from the lens is calculated, In order to determine the area where distortion will occur at this distance position, if the area where the foreground object is located coincides with the area where distortion will occur, the area will be identified as the distortion area, that is, the foreground object or subject that the user cares about Distortion occurs and needs to be adjusted. Compared with the traditional technology, the above-mentioned method and device for finding the distortion region in the image avoids a series of distortion correction calculations after imaging in the process of processing lens distortion, reduces the amount of calculation in the imaging process, and improves imaging. processing efficiency.

同时,用户还可以获知在拍照过程中可能出现的畸变现象,并且进行进一步的调整,从而可以主动去避免畸变现象出现在用户关心的拍摄物体上,提升了用户体验。At the same time, the user can also know the distortion that may occur during the photographing process, and make further adjustments, so that the distortion can be actively avoided on the object that the user cares about, and the user experience is improved.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

其中:in:

图1为一个实施例中的一种查找图像中的畸变区域的方法流程示意图;Fig. 1 is a schematic flow chart of a method for finding a distorted region in an image in an embodiment;

图2为一个实施例中目标图像的前景目标区域的示意图;Fig. 2 is a schematic diagram of a foreground target area of a target image in an embodiment;

图3为一个实施例中目标图像的前景目标区域的示意图;Fig. 3 is a schematic diagram of a foreground target area of a target image in an embodiment;

图4为一个实施例中目标图像中的区域划分的示意图;Fig. 4 is a schematic diagram of region division in a target image in an embodiment;

图5为一个实施例中与镜头对应的宽容度单位所在的区域的空间示意图;Fig. 5 is a spatial schematic diagram of the area where the latitude unit corresponding to the lens is located in an embodiment;

图6为另一个实施例中一个实施例中与镜头对应的宽容度单位所在的区域的空间示意图;Fig. 6 is a spatial schematic diagram of the area where the latitude unit corresponding to the lens is located in an embodiment in another embodiment;

图7为一个实施例中一个实施例中目标图像中的区域划分的示意图;Fig. 7 is a schematic diagram of region division in a target image in an embodiment in an embodiment;

图8为一个实施例中一种查找图像中的畸变区域的装置的结构示意图。Fig. 8 is a schematic structural diagram of an apparatus for finding a distorted region in an image in an embodiment.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

为解决上述提到的传统技术中对于拍照过程中出现的镜头畸变的处理方式存在的计算量过大的技术问题,特提供了一种查找图像中畸变区域的方法,该方法可依赖于计算机实现程序,该计算机程序可以是智能手机中的相机应用程序,也可以是运行于相机终端中的图像处理程序。该计算机程序可运行于基于冯诺依曼体系的计算机系统上。该计算机系统可以是安装有相机应用或图像处理应用的智能手机、平板电脑、掌上电脑、或相机等终端设备。In order to solve the technical problem of excessive calculation in the traditional technology mentioned above in the processing of the lens distortion that occurs during the photographing process, a method for finding the distorted area in the image is provided, which can be implemented by a computer program, the computer program may be a camera application program in a smart phone, or an image processing program running on a camera terminal. The computer program can run on a computer system based on the Von Neumann architecture. The computer system may be a terminal device such as a smart phone, a tablet computer, a handheld computer, or a camera installed with a camera application or an image processing application.

具体的,该查找图像中畸变区域的方法如图1所示,该方法包括如下步骤:Specifically, the method for finding a distorted region in an image is shown in Figure 1, and the method includes the following steps:

步骤S102:获取摄像头采集的目标图像,获取所述目标图像中的前景目标区域。Step S102: Obtain a target image captured by a camera, and acquire a foreground target area in the target image.

目标图像即为通过设置在终端上的摄像头获取的图像,并且该目标图像可以通过设置在终端上的显示屏进行展示,以供用户对同过该摄像头拍摄的场景进行预览或确定,并且可以根据该目标图像进行进一步的操作,例如,手动对焦,即用户手动选择需要进行对焦的目标。需要说明的是,上述目标图像的获取过程中的对焦过程中焦距的确定,或者需要进行对焦的拍摄主体的选择,可以是终端自行完成的,即自动对焦,也可以是用户根据自己的需要进行手动选择从而完成该对焦过程的。The target image is the image obtained through the camera set on the terminal, and the target image can be displayed on the display screen set on the terminal for the user to preview or confirm the scene captured by the camera, and can be based on Further operations are performed on the target image, for example, manual focus, that is, the user manually selects a target to be focused on. It should be noted that the determination of the focal length in the focusing process in the acquisition process of the above target image, or the selection of the subject to be focused can be done by the terminal itself, that is, automatic focusing, or it can be done by the user according to his own needs. Manually select to complete the focusing process.

目标图像包括了背景和前景目标,在获取了目标图像之后,可以根据前景目标的分割算法提取目标图像中的前景目标对应的前景目标区域。需要说明的是,在本实施例中,前景目标区域的获取过程,既可以是终端根据获取到的目标图像,自动提取在目标图像中的前景目标所在的区域;还可以是根据用户选择的拍摄主体确定用户关心的前景目标,从而确定在该方法中需要获取的前景目标区域。The target image includes background and foreground targets. After the target image is acquired, the foreground target region corresponding to the foreground target in the target image can be extracted according to the segmentation algorithm of the foreground target. It should be noted that, in this embodiment, the acquisition process of the foreground target area can be that the terminal automatically extracts the area where the foreground target in the target image is located according to the acquired target image; The main body determines the foreground target that the user cares about, so as to determine the foreground target area that needs to be acquired in this method.

前景目标区域的形状可以是多变的,例如,可以是以前景目标的中心在目标图像中的对应点为圆心、预设的长度为半径的圆,也可以是以前景目标的中心在目标图像中的对应点为中心的任意的预设形状,还可以是根据实际情况提取到的前景目标对应的像素点构成的区域,该区域即为前景目标区域。The shape of the foreground target area can be changeable, for example, it can be a circle centered on the corresponding point of the center of the foreground target in the target image and the preset length is the radius, or it can be the center of the foreground target in the target image Any preset shape centered on the corresponding point in , can also be an area composed of pixels corresponding to the foreground object extracted according to the actual situation, and this area is the foreground object area.

如图2所示,图2展示了一个人物的拍摄的应用场景下的拍摄图像,该图像即为通过摄像头获取的目标图像,其中标记为1、2、3、4的区域即为目标图像中的前景目标区域。As shown in Figure 2, Figure 2 shows a shot image of a person in the application scene, the image is the target image acquired by the camera, and the areas marked 1, 2, 3, 4 are the target images foreground target area.

如图3所示,图3展示了一个相机应用场景下的拍摄示意图,该示意图所示的区域C即为通过摄像头获取的目标图像所在的区域,其中标记为A的点即为用户自主选择的拍摄主体的参考点,以该参考点为圆心、预设的半径长度R为半径的圆形区域B即为目标图像中的前景目标区域。As shown in Figure 3, Figure 3 shows a schematic diagram of shooting in a camera application scenario. The area C shown in the schematic diagram is the area where the target image obtained by the camera is located, and the point marked A is the user's own selection. The reference point of the shooting subject, the circular area B with the reference point as the center and the preset radius length R as the radius is the foreground target area in the target image.

步骤S104:获取所述前景目标区域对应的前景目标的深度信息。Step S104: Obtain the depth information of the foreground object corresponding to the foreground object area.

前景目标的深度信息即为前景目标与镜头之间的距离信息。在本实施例中,前景目标与镜头之间的距离的获取方式可以有多种。The depth information of the foreground object is the distance information between the foreground object and the lens. In this embodiment, there may be multiple ways of acquiring the distance between the foreground object and the lens.

例如,在一个实施例中,前景目标与镜头之间的距离信息是通过距离传感器获取的,具体的,距离传感器通过向被测物体发射激光或红外光等电磁信号并检测回波,从而确定被测物体与镜头之间的距离。For example, in one embodiment, the distance information between the foreground object and the lens is obtained by a distance sensor. Specifically, the distance sensor emits electromagnetic signals such as laser light or infrared light to the object under test and detects echoes to determine the Measure the distance between the object and the lens.

再例如,在另一个实施例中,前景目标与镜头之间的距离信息是通过双摄像头获取的。具体的,使用两个摄像头分别成像,因为两个摄像头之前存在的一定的距离,所以同一物体所成的像会在像素点坐标等信息上存在一定的差别,也就是说,两个摄像头的分别成像,会有一定的视差存在。上述双摄像头成像的视差,可以用来估计和计算物体距离镜头的实体距离,即深度信息,并且可以进一步地获取每一个像素点的深度信息,形成深度图像。For another example, in another embodiment, the distance information between the foreground object and the lens is acquired through dual cameras. Specifically, two cameras are used to image images separately. Because there is a certain distance between the two cameras, the images formed by the same object will have certain differences in pixel coordinates and other information. That is to say, the difference between the two cameras Imaging, there will be a certain amount of parallax. The parallax of the above-mentioned dual-camera imaging can be used to estimate and calculate the physical distance between the object and the lens, that is, the depth information, and can further obtain the depth information of each pixel to form a depth image.

需要说明的是,在上述前景目标的深度信息的获取中,获取的深度信息用以代表整个前景目标区域被所有像素点的深度信息,在本实施例中,用哪一个点或者哪个区域的深度信息用来代表与前景目标区域对应的前景目标的深度信息,是可以进行选择的,如,可以为用户实现设定的,也可以是系统预设的,或者,也可以是系统随机选定的一种方式。It should be noted that, in the acquisition of the depth information of the above-mentioned foreground object, the obtained depth information is used to represent the depth information of all pixels in the entire foreground object area. In this embodiment, which point or which area's depth is used The information is used to represent the depth information of the foreground target corresponding to the foreground target area, which can be selected, for example, it can be set for the user, it can also be preset by the system, or it can be randomly selected by the system a method.

具体的,可以取前景目标区域内的任意一点的深度信息,用该点的深度信息代表整个前景目标区域的深度信息。还可以是取前景目标区域中满足预设条件的某一个特定点的对应的深度信息,用以代替整个前景目标区域的深度信息,例如取深度信息对应的值最大的像素点的深度信息,例如取前景目标区域的中心点对应的深度信息。在另一个实施例中,前景目标区域的深度信息的获取还可以是通过获取前景目标区域中的每一个像素点对应的距离,并计算所有点对应的距离的平均值,以该平均值来代表前景目标的深度信息。Specifically, the depth information of any point in the foreground target area can be taken, and the depth information of this point can be used to represent the depth information of the entire foreground target area. It is also possible to take the corresponding depth information of a specific point in the foreground target area that meets the preset conditions to replace the depth information of the entire foreground target area, for example, take the depth information of the pixel point with the largest value corresponding to the depth information, for example Get the depth information corresponding to the center point of the foreground target area. In another embodiment, the depth information of the foreground target area can also be obtained by obtaining the distance corresponding to each pixel in the foreground target area, and calculating the average value of the distances corresponding to all points, and using the average value to represent Depth information of foreground objects.

在另一个是实施例中,前景目标的深度信息的获取还可以为如下计算方式:随机选取前景目标区域内一定数量的像素点,以这些像素点为参考像素点,获取上述参考像素点对应的距离信息或者深度信息,然后计算所有参考像素点的深度信息或者距离信息的平均值,以该平均值为前景目标区域对应的前景目标的深度信息。In another embodiment, the acquisition of the depth information of the foreground object can also be the following calculation method: randomly select a certain number of pixels in the foreground object area, use these pixels as reference pixels, and obtain the depth information corresponding to the above reference pixels. distance information or depth information, and then calculate the average value of the depth information or distance information of all reference pixel points, and use the average value as the depth information of the foreground object corresponding to the foreground object area.

步骤S106:根据预设的线性函数以所述前景目标的深度信息为自变量,计算与所述前景目标区域对应的畸变半径。Step S106: Calculate a distortion radius corresponding to the foreground object area according to a preset linear function with depth information of the foreground object as an argument.

镜头出现畸变、失真等情况是由于镜头本身的特性所导致的,并且,镜头离被摄体越远,被摄体在成像图像中的所占的像素点构成的区域越小,其在外观上的大小变化越小。由于畸变都是出现在成像图像周边区域,也就是说,在成像图片的中心点附近一般不会出现畸变或者失真现象。在本实施例中,将可能出现畸变的区域称为畸变范围所在的区域,不会出现畸变现象的区域称为宽容度范围所在的区域。一般来讲,离镜头越近,畸变越大,畸变范围越大,可接受的宽容度范围也就越小;相应的,离镜头越远,畸变越小,畸变范围越小,可接受的宽容度范围也就越大。因此,若宽容度范围是已确定的情况下,就可以直接求得成像图像中的畸变范围。Distortion and distortion of the lens are caused by the characteristics of the lens itself, and the farther the lens is from the subject, the smaller the area formed by the pixels occupied by the subject in the imaging image. The smaller the size change. Since the distortion occurs in the peripheral area of the imaging image, that is to say, generally no distortion or distortion occurs near the center point of the imaging image. In this embodiment, the area where distortion may occur is called the area where the distortion range is located, and the area where distortion does not occur is called the area where the tolerance range is located. Generally speaking, the closer you are to the lens, the greater the distortion, the larger the distortion range, and the smaller the acceptable tolerance range; correspondingly, the farther you are from the lens, the smaller the distortion, the smaller the distortion range, and the acceptable tolerance range. The range is larger. Therefore, if the latitude range is determined, the distortion range in the imaging image can be obtained directly.

如图4所示,图中所示的场景即为目标图像中畸变范围和宽容度范围所在的区域划分示意图。图中S2表示可接受的宽容度范围所在的区域,S1表示目标图像中的会出现畸变或失真现象的畸变范围所在的区域。As shown in FIG. 4 , the scene shown in the figure is a schematic diagram of area division where the distortion range and tolerance range in the target image are located. In the figure, S2 indicates the area where the acceptable latitude range is located, and S1 indicates the area where the distortion range where distortion or distortion phenomenon occurs in the target image is located.

在本实施例中,在镜头外的某一位置物体的宽容度范围,在将镜头看作为一点的时候,即忽略镜头的大小所带来的影响,可以将宽容度范围看作是以镜头的圆心逐步向外发散的一个圆锥体,该圆锥体以镜头的圆心作为顶点,以该物体与镜头之间的距离为高(即以步骤S104中获取的前景目标的深度信息为圆锥体的高)、底面半径为预设值。In this embodiment, the latitude range of the object at a certain position outside the lens, when the lens is regarded as a point, that is, the influence of the size of the lens is ignored, and the latitude range can be regarded as the range of the lens. A cone whose center gradually diverges outwards, the cone takes the center of the lens as the apex, and the distance between the object and the lens is high (that is, the depth information of the foreground target obtained in step S104 is the height of the cone) , the bottom radius is the default value.

如图5所示,图中所示D即为该物体与镜头之间的距离,即在步骤S104中所获取的深度信息,图中圆锥体所示的范围即为宽容度范围,即没有出现畸变的范围。根据镜头的不同,圆锥体的母线与高之间的夹角θ也会不一样,也就是说,该角度θ的设置是由镜头的硬件设置或者硬件结构所确定的,在相机成型之后,该角度就可以确定下来。As shown in Figure 5, D shown in the figure is the distance between the object and the lens, that is, the depth information obtained in step S104, and the range shown by the cone in the figure is the latitude range, that is, there is no The extent of the distortion. Depending on the lens, the angle θ between the generatrix and the height of the cone will also be different, that is to say, the setting of the angle θ is determined by the hardware setting or hardware structure of the lens. After the camera is formed, the angle θ angle can be determined.

为计算被拍摄物体所在的截面的圆形区域的半径,可以根据圆锥体的几何结构由如下公式:In order to calculate the radius of the circular area of the section where the object to be photographed is located, the following formula can be obtained according to the geometric structure of the cone:

r=tanθ·D。r = tan θ·D.

根据上述公式可以确定宽容度范围所在的圆形区域的半径,从而可以确定畸变区域的范围,所述畸变范围即为目标图像中除去宽容度范围所在的区域之外的所有区域。According to the above formula, the radius of the circular area where the latitude range is located can be determined, so that the range of the distortion area can be determined, and the distortion area is all areas in the target image except the area where the latitude range is located.

在另一个实施例中,考虑镜头的大小带来的影响,所述镜头外某一位置的物体的宽容度范围,可以看作是以镜片所在的平面为上底所在的平面、以镜头中心点为上底圆心、且以该物体与镜头之间的距离为高(即以步骤S104中获取的前景目标的深度信息为圆锥体的高)、下底面半径为预设值圆台。In another embodiment, considering the influence of the size of the lens, the latitude range of the object at a certain position outside the lens can be regarded as the plane where the lens is located as the plane where the upper base is located, and the center point of the lens as is the center of the upper base, the height is the distance between the object and the lens (that is, the depth information of the foreground object acquired in step S104 is the height of the cone), and the radius of the lower base is the preset value of the frustum of a cone.

如图6所示,θ为母线与高之间的夹角,r为镜头的半径,R下底面的半径,即所述畸变半径,D为该物体与镜头之间的距离,根据如下公式可以计算下底面的半径,即畸变半径:As shown in Figure 6, θ is the angle between the busbar and the height, r is the radius of the lens, the radius of the bottom surface under R is the distortion radius, and D is the distance between the object and the lens, according to the following formula Compute the radius of the lower base, the distortion radius:

R=r+tanθ·D。R=r+tanθ·D.

步骤S108:查找前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,将所述查找到的像素点构成的区域判定为即畸变区域。Step S108: Search for pixels in the foreground target area whose distance from the center point of the target image is greater than the distortion radius, and determine the area formed by the found pixels as the distortion area.

在步骤S106中,考虑宽容度范围的过程中,将宽容度范围视为一个以目标图像的中心点、以畸变半径为半径的圆形区域,所以,宽容度范围内的每一点到目标图像的中心点的距离,一定会小于或等于上述畸变半径。反过来讲,若某一点到中心点的距离大于畸变半径,则该点已经不在上述宽容度范围之内。In step S106, in the process of considering the latitude range, the latitude range is regarded as a circular area with the center point of the target image and the distortion radius as the radius, so every point in the latitude range to the distance of the target image The distance between the center points must be less than or equal to the above-mentioned distortion radius. Conversely speaking, if the distance from a certain point to the center point is greater than the distortion radius, the point is no longer within the above-mentioned tolerance range.

具体的,遍历前景目标区域中包含的所有像素点,并根据该像素点的坐标位置,计算其与目标图像的中心点所对应的像素点之间的距离。Specifically, traverse all the pixel points included in the foreground target area, and calculate the distance between the pixel point and the pixel point corresponding to the center point of the target image according to the coordinate position of the pixel point.

例如,若目标图像为1400*900的图像(即横向有1440个像素列,纵向有900个像素行),则目标图像的中心点的坐标为(x0,y0)=(700,450);进一步地,每个像素点在空间上所占的大小为a×a(即横向宽度为a个单位,纵向宽度为a个单位)。则坐标为(x1,y1)的像素点与中心点对应的像素点之间的距离为:For example, if the target image is an image of 1400*900 (that is, there are 1440 pixel columns in the horizontal direction and 900 pixel rows in the vertical direction), the coordinates of the center point of the target image are (x 0 , y 0 )=(700,450); further Generally, the space occupied by each pixel is a×a (that is, the horizontal width is a unit, and the vertical width is a unit). Then the distance between the pixel point with coordinates (x 1 , y 1 ) and the pixel point corresponding to the center point is:

dd == aa ·· (( xx 11 -- xx 00 )) 22 ++ (( ythe y 11 -- ythe y 00 )) 22 ,,

然后判断d与畸变半径R之间的大小关系。Then judge the size relationship between d and the distortion radius R.

若d>R,则说明该坐标为(x1,y1)的像素点不在宽容度范围所在的区域中包含的像素点的集合中,即在畸变范围所在的区域中包含的像素点的集合中;若d>R,则说明该坐标为(x1,y1)的像素点在宽容度范围所在的区域中包含的像素点的集合中。If d>R, it means that the pixel with the coordinates (x 1 , y 1 ) is not in the set of pixels included in the area where the tolerance range is located, that is, the set of pixels included in the area where the distortion range is located middle; if d>R, it means that the pixel with the coordinates (x 1 , y 1 ) is included in the set of pixels contained in the region where the tolerance range is located.

遍历前景目标区域中包含的所有像素点,在该像素点与目标图像的中心点的距离大于所述畸变半径时,将该像素点添加到畸变区域的像素点集合中,并将该集合中的所有像素点构成的区域判定为畸变区域,也就是说,将该区域标记为畸变区域。Traversing all the pixels contained in the foreground target area, when the distance between the pixel and the center point of the target image is greater than the distortion radius, add the pixel to the pixel set in the distortion area, and add the pixels in the set The area formed by all pixels is determined as a distorted area, that is, the area is marked as a distorted area.

若上述畸变区域的像素点集合不为空集,则说明该目标图像中的前景目标区域中出现了畸变现象,也就是说,用户所关心的前景目标或者拍摄主体在目标图像中出现了畸变或失真的现象,则需要将相关的提示信息展示给用户,在该提示信息中应包含具体哪些区域会出现畸变现象,从而根据提示信息进行相应的操作,从而避免拍摄主体或前景目标在目标图像中出现畸变。If the set of pixel points in the above-mentioned distorted area is not an empty set, it means that distortion occurs in the foreground target area in the target image. If there is a phenomenon of distortion, it is necessary to display the relevant prompt information to the user. The prompt information should include the specific areas where distortion will occur, so as to perform corresponding operations according to the prompt information, so as to avoid the subject or foreground target in the target image. Distortion occurs.

如图7所示,图7展示了一个目标图像的区域划分示意图,编号为S1的区域为宽容度范围所在的区域,编号为S2的区域为畸变现象所在的区域,编号为S3的区域为前景目标区域,编号为S4的区域为S2和S3的交集,即步骤S108中查找到的前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点所在的区域,即所述畸变区域。As shown in Figure 7, Figure 7 shows a schematic diagram of the area division of a target image, the area numbered S1 is the area where the tolerance range is located, the area numbered S2 is the area where the distortion phenomenon is located, and the area numbered S3 is the foreground The target area, the area numbered S4 is the intersection of S2 and S3, that is, the area where the pixel point in the foreground target area found in step S108 is located with a distance greater than the distortion radius from the center point of the target image, that is, the distortion area.

进一步的,在本实施例中,在步骤S108:查找前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,将所述查找到的像素点构成的区域判定为即畸变区域之后,本方法还包括步骤:突出展示所述目标图像中的所述畸变区域,所述突出展示的方式包括高亮、加边框中的至少一种。Further, in this embodiment, in step S108: search for pixels in the foreground target area whose distance from the center point of the target image is greater than the distortion radius, and determine the area formed by the found pixels to be distorted After the region, the method further includes the step of: highlighting and displaying the distorted region in the target image, the way of highlighting and displaying includes at least one of highlighting and adding a frame.

具体的,在终端的显示屏上展示预览的图像,即时地进行目标图像的预览,在该图像中,将畸变区域突出展示在终端的显示屏上。Specifically, the previewed image is displayed on the display screen of the terminal, and the target image is previewed in real time. In the image, the distorted area is prominently displayed on the display screen of the terminal.

例如,如图7所示,图7展示的即为在终端的显示屏上展示的图像,在S4不为空的情况下,如图所示的给畸变区域S4所在的区域加边框在终端的显示屏的展示页面中进行展示。For example, as shown in Figure 7, what Figure 7 shows is the image displayed on the display screen of the terminal. When S4 is not empty, add a border to the area where the distortion area S4 is located on the displayed on the display page of the display.

可选的,在终端的显示屏上展示给用户的预览图像中,还可以将相应的宽容度范围所在的区域、畸变范围所在的区域、前景目标区域等区域的划分展示在显示屏上,以供用户参考。Optionally, in the preview image shown to the user on the display screen of the terminal, the area where the corresponding latitude range is located, the area where the distortion range is located, and the foreground target area can also be displayed on the display screen, so as to For user reference.

需要说明的是,在其他实施例中,目标图像中包含的前景目标区域的数量可以不止一个,即在步骤S102中,获取摄像头采集的目标图像的步骤之后,获取所述目标图像中的至少一个前景目标区域。It should be noted that, in other embodiments, the number of foreground target areas contained in the target image may be more than one, that is, in step S102, after the step of acquiring the target image collected by the camera, at least one of the target images is acquired Foreground target area.

例如,在图2所示的应用场景中,所述目标图像包括了标号为1、2、3、4的四个前景目标区域。For example, in the application scenario shown in FIG. 2 , the target image includes four foreground target areas labeled 1, 2, 3, and 4.

相应的,在步骤S104:获取所述前景目标区域对应的前景目标的深度信息中,获取所述至少一个前景目标区域对应的前景目标的深度信息,也就是说,获取在步骤S102中获取的每一个前景目标区域所对应的前景目标的深度信息。在步骤S106:根据预设的线性函数以所述前景目标的深度信息为自变量计算与所述前景目标区域对应的畸变半径中,计算的畸变半径的个数也是与上述前景目标区域所对应的。Correspondingly, in step S104: acquiring the depth information of the foreground object corresponding to the foreground object area, the depth information of the foreground object corresponding to the at least one foreground object area is acquired, that is, each of the foreground objects acquired in step S102 is acquired. Depth information of a foreground object corresponding to a foreground object area. In step S106: in calculating the distortion radius corresponding to the foreground object area according to the preset linear function and using the depth information of the foreground object as an argument, the number of calculated distortion radii is also corresponding to the above-mentioned foreground object area .

也就是说,在前景目标区域存在多个的情况下,需要分别针对每一个前景目标区域,获取其对应的前景目标的深度信息,然后再分别计算每一个深度信息对应的畸变半径。That is to say, when there are multiple foreground object areas, it is necessary to obtain the depth information of the corresponding foreground object for each foreground object area, and then calculate the distortion radius corresponding to each depth information.

相应的,在步骤S108中,也分别查找每一个前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,针对每一个前景目标区域分别判断其对应的畸变区域是否存在,并且在后续展示给用户的过程中,在展示界面上,针对多个畸变区域均进行展示。Correspondingly, in step S108, the pixel points in each foreground target area whose distance from the center point of the target image is greater than the distortion radius are also searched for, and for each foreground target area, it is judged whether its corresponding distortion area exists, And in the subsequent process of displaying to the user, multiple distorted regions are displayed on the display interface.

为解决上述提到的传统技术中对于拍照过程中出现的镜头畸变的处理方式存在的计算量过大的技术问题,本发明还提供了一种查找图像中畸变区域的装置,该装置包括前景目标区域获取模块102、深度信息获取模块104、畸变半径计算模块106以及畸变区域确定模块108,其中:In order to solve the above-mentioned technical problem of excessive calculation of lens distortion in the process of taking pictures in the above-mentioned traditional technology, the present invention also provides a device for searching the distorted area in the image, the device includes the foreground object The area acquisition module 102, the depth information acquisition module 104, the distortion radius calculation module 106 and the distortion area determination module 108, wherein:

前景目标区域获取模块102用于获取摄像头采集的目标图像,获取所述目标图像中的前景目标区域;The foreground target area acquisition module 102 is used to acquire the target image collected by the camera, and acquire the foreground target area in the target image;

深度信息获取模块104用于获取所述前景目标区域对应的前景目标的深度信息;The depth information obtaining module 104 is used for obtaining the depth information of the foreground object corresponding to the foreground object area;

畸变半径计算模块106用于根据预设的线性函数以所述前景目标的深度信息为自变量,计算与所述前景目标区域对应的畸变半径;The distortion radius calculation module 106 is used to calculate the distortion radius corresponding to the foreground object area according to a preset linear function with the depth information of the foreground object as an independent variable;

畸变区域确定模块108用于查找前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,将所述查找到的像素点构成的区域判定为畸变区域。The distorted area determination module 108 is used to search for pixels in the foreground target area whose distance from the center point of the target image is greater than the distortion radius, and determine the area formed by the found pixels as the distorted area.

可选的,深度信息获取模块104还用于通过双摄像头获取所述前景目标区域对应的前景目标的深度信息。Optionally, the depth information acquiring module 104 is further configured to acquire the depth information of the foreground object corresponding to the foreground object area through dual cameras.

可选的,深度信息获取模块104还用于:选取所述前景目标区域中预设数量的参考像素点,获取与所述参考像素点对应的深度信息,并计算所有参考像素点的深度信息的平均值,以所述所有参考像素点的深度信息的平均值为所述前景目标区域对应的前景目标的深度信息。Optionally, the depth information acquisition module 104 is further configured to: select a preset number of reference pixels in the foreground target area, acquire depth information corresponding to the reference pixels, and calculate the sum of the depth information of all reference pixels. An average value, using the average value of the depth information of all reference pixel points as the depth information of the foreground object corresponding to the foreground object area.

可选的,前景目标区域获取模块102还用于:获取所述目标图像中的至少两个前景目标区域;Optionally, the foreground target area acquiring module 102 is further configured to: acquire at least two foreground target areas in the target image;

深度信息获取模块104还用于:分别获取所述至少两个前景目标区域对应的至少两个前景目标的深度信息;The depth information obtaining module 104 is further configured to: respectively obtain the depth information of at least two foreground objects corresponding to the at least two foreground object areas;

畸变半径计算模块106还用于:根据预设的线性函数以所述前景目标的深度信息为自变量,分别计算与所述至少两个前景目标区域对应的畸变半径;The distortion radius calculation module 106 is further configured to: respectively calculate the distortion radii corresponding to the at least two foreground object areas according to a preset linear function with the depth information of the foreground object as an independent variable;

畸变区域确定模块108还用于:分别查找所述至少两个前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,分别将所述查找到的像素点构成的区域判定为与所述至少两个前景目标区域对应的畸变区域。The distortion area determination module 108 is further configured to: respectively search for pixels in the at least two foreground target areas whose distance from the center point of the target image is greater than the distortion radius, and determine the area formed by the found pixels is the distorted area corresponding to the at least two foreground object areas.

可选的,如图8该查找图像中畸变区域的装置还包括突出展示模块110,用于突出展示所述目标图像中的所述畸变区域,所述突出展示的方式包括高亮、加边框中的至少一种。Optionally, as shown in Figure 8, the device for finding a distorted region in an image further includes a highlight display module 110, configured to highlight and display the distorted region in the target image, the way of highlighting and displaying includes highlighting, adding a frame at least one of .

实施本发明实施例,将具有如下有益效果:Implementing the embodiment of the present invention will have the following beneficial effects:

采用了上述查找图像中的畸变区域的方法和装置之后,在拍照的过程中,针对镜头的光学固有特性导致的镜头畸变现象,计算用户关心的前景目标或者拍摄主体所在的位置距离镜头的距离,从而确定在该距离位置下会出现畸变现象的区域,若前景目标所在的区域与会出现畸变现象的区域重合,则将该区域标识为畸变区域,也就是说,用户所关心的前景目标或者拍摄主体出现了畸变,需要进行调整。和传统技术相比,上述查找图像中的畸变区域的方法和装置在处理镜头畸变的过程中,避免了在成像之后进行一系列的畸变校正计算,减少了成像过程中的计算量,提高了成像的处理效率。After adopting the above-mentioned method and device for finding the distorted region in the image, in the process of taking pictures, aiming at the lens distortion phenomenon caused by the inherent optical characteristics of the lens, the distance between the foreground target or the position of the subject that the user cares about and the distance from the lens is calculated, In order to determine the area where distortion will occur at this distance position, if the area where the foreground object is located coincides with the area where distortion will occur, the area will be identified as the distortion area, that is, the foreground object or subject that the user cares about Distortion occurs and needs to be adjusted. Compared with the traditional technology, the above-mentioned method and device for finding the distortion region in the image avoids a series of distortion correction calculations after imaging in the process of processing lens distortion, reduces the amount of calculation in the imaging process, and improves imaging. processing efficiency.

同时,用户还可以获知在拍照过程中可能出现的畸变现象,并且进行进一步的调整,从而可以主动去避免畸变现象出现在用户关心的拍摄物体上,提升了用户体验。At the same time, the user can also know the distortion that may occur during the photographing process, and make further adjustments, so that the distortion can be actively avoided on the object that the user cares about, and the user experience is improved.

以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。The above disclosures are only preferred embodiments of the present invention, and certainly cannot limit the scope of rights of the present invention. Therefore, equivalent changes made according to the claims of the present invention still fall within the scope of the present invention.

Claims (10)

1.一种查找图像中畸变区域的方法,其特征在于,包括:1. A method for finding a distorted region in an image, comprising: 获取摄像头采集的目标图像,获取所述目标图像中的前景目标区域;Obtain the target image collected by the camera, and obtain the foreground target area in the target image; 获取所述前景目标区域对应的前景目标的深度信息;Obtaining depth information of a foreground object corresponding to the foreground object area; 根据预设的线性函数以所述前景目标的深度信息为自变量,计算与所述前景目标区域对应的畸变半径;calculating a distortion radius corresponding to the foreground object area according to a preset linear function using the depth information of the foreground object as an independent variable; 查找前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,将所述查找到的像素点构成的区域判定为畸变区域。Find the pixel points in the foreground target area whose distance from the center point of the target image is greater than the distortion radius, and determine the area formed by the found pixel points as the distortion area. 2.根据权利要求1所述的查找图像中畸变区域的方法,其特征在于,所述获取所述前景目标区域对应的前景目标的深度信息的步骤还包括:2. The method for searching for a distorted area in an image according to claim 1, wherein the step of obtaining the depth information of the foreground object corresponding to the foreground object area further comprises: 通过双摄像头获取所述前景目标区域对应的前景目标的深度信息。The depth information of the foreground object corresponding to the foreground object area is acquired through dual cameras. 3.根据权利要求1所述的查找图像中畸变区域的方法,其特征在于,所述获取所述前景目标区域对应的前景目标的深度信息的步骤还包括:3. The method for searching for a distorted region in an image according to claim 1, wherein the step of obtaining the depth information of the foreground object corresponding to the foreground object region further comprises: 选取所述前景目标区域中预设数量的参考像素点,获取与所述参考像素点对应的深度信息,并计算所有参考像素点的深度信息的平均值,以所述所有参考像素点的深度信息的平均值为所述前景目标区域对应的前景目标的深度信息。Select a preset number of reference pixels in the foreground target area, obtain depth information corresponding to the reference pixels, and calculate the average value of the depth information of all reference pixels, and use the depth information of all reference pixels The average value of is the depth information of the foreground object corresponding to the foreground object area. 4.根据权利要求1所述的查找图像中畸变区域的方法,其特征在于,所述获取所述目标图像中的前景目标区域的步骤还包括:4. the method for the distorted region in the search image according to claim 1, is characterized in that, the step of described obtaining the foreground target region in the target image also comprises: 获取所述目标图像中的至少两个前景目标区域;acquiring at least two foreground object regions in the object image; 所述获取所述前景目标区域对应的前景目标的深度信息的步骤还包括:分别获取所述至少两个前景目标区域对应的至少两个前景目标的深度信息;The step of obtaining the depth information of the foreground object corresponding to the foreground object area further includes: respectively obtaining the depth information of at least two foreground objects corresponding to the at least two foreground object areas; 所述根据预设的线性函数以所述前景目标的深度信息为自变量,计算与所述前景目标区域对应的畸变半径的步骤还包括:根据预设的线性函数以所述前景目标的深度信息为自变量,分别计算与所述至少两个前景目标区域对应的畸变半径;The step of calculating the distortion radius corresponding to the foreground object area according to the preset linear function using the depth information of the foreground object as an argument further includes: using the depth information of the foreground object according to the preset linear function is an independent variable, respectively calculating the distortion radius corresponding to the at least two foreground target areas; 所述查找前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,将所述查找到的像素点构成的区域判定为畸变区域的步骤还包括:The step of searching for pixels in the foreground target area whose distance from the center point of the target image is greater than the distortion radius, and determining the area formed by the found pixels as a distortion area further includes: 分别查找所述至少两个前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,分别将所述查找到的像素点构成的区域判定为与所述至少两个前景目标区域对应的畸变区域。Respectively search for pixels in the at least two foreground target areas whose distance from the central point of the target image is greater than the distortion radius, and determine the area formed by the found pixel points as being the same as the at least two foreground targets The region corresponds to the distortion region. 5.根据权利要求1所述的查找图像中畸变区域的方法,其特征在于,所述将所述查找到的像素点构成的区域判定为畸变区域的步骤之后还包括:5. The method for searching for a distorted region in an image according to claim 1, wherein the step of determining the region formed by the found pixels as a distorted region further includes: 突出展示所述目标图像中的所述畸变区域,所述突出展示的方式包括高亮、加边框中的至少一种。and highlighting the distorted region in the target image, the way of highlighting includes at least one of highlighting and adding a frame. 6.一种查找图像中畸变区域的装置,其特征在于,包括:6. A device for finding a distorted region in an image, comprising: 前景目标区域获取模块,用于获取摄像头采集的目标图像,获取所述目标图像中的前景目标区域;The foreground target area acquisition module is used to acquire the target image collected by the camera, and acquire the foreground target area in the target image; 深度信息获取模块,用于获取所述前景目标区域对应的前景目标的深度信息;A depth information acquisition module, configured to acquire the depth information of the foreground object corresponding to the foreground object area; 畸变半径计算模块,用于根据预设的线性函数以所述前景目标的深度信息为自变量,计算与所述前景目标区域对应的畸变半径;A distortion radius calculation module, configured to calculate a distortion radius corresponding to the foreground target area according to a preset linear function with the depth information of the foreground target as an independent variable; 畸变区域确定模块,用于查找前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,将所述查找到的像素点构成的区域判定为畸变区域。The distortion area determination module is configured to search for pixels in the foreground target area whose distance from the center point of the target image is greater than the distortion radius, and determine the area formed by the found pixels as the distortion area. 7.根据权利要求6所述的查找图像中畸变区域的装置,其特征在于,所述深度信息获取模块还用于:通过双摄像头获取所述前景目标区域对应的前景目标的深度信息。7 . The device for searching for a distorted area in an image according to claim 6 , wherein the depth information acquisition module is further configured to: acquire depth information of a foreground object corresponding to the foreground object area through dual cameras. 8.根据权利要求6所述的查找图像中畸变区域的装置,其特征在于,所述深度信息获取模块还用于:8. The device for searching for a distorted region in an image according to claim 6, wherein the depth information acquisition module is also used for: 选取所述前景目标区域中预设数量的参考像素点,获取与所述参考像素点对应的深度信息,并计算所有参考像素点的深度信息的平均值,以所述所有参考像素点的深度信息的平均值为所述前景目标区域对应的前景目标的深度信息。Select a preset number of reference pixels in the foreground target area, obtain depth information corresponding to the reference pixels, and calculate the average value of the depth information of all reference pixels, and use the depth information of all reference pixels The average value of is the depth information of the foreground object corresponding to the foreground object area. 9.根据权利要求6所述的查找图像中畸变区域的装置,其特征在于,所述前景目标区域获取模块还用于:获取所述目标图像中的至少两个前景目标区域;9. The device for searching for a distorted region in an image according to claim 6, wherein the foreground target region acquisition module is further used to: acquire at least two foreground target regions in the target image; 所述深度信息获取模块还用于:分别获取所述至少两个前景目标区域对应的至少两个前景目标的深度信息;The depth information acquisition module is further configured to: respectively acquire the depth information of at least two foreground objects corresponding to the at least two foreground object areas; 所述畸变半径计算模块还用于:根据预设的线性函数以所述前景目标的深度信息为自变量,分别计算与所述至少两个前景目标区域对应的畸变半径;The distortion radius calculation module is further configured to: respectively calculate the distortion radii corresponding to the at least two foreground object areas according to a preset linear function with the depth information of the foreground object as an independent variable; 所述畸变区域确定模块还用于:分别查找所述至少两个前景目标区域中与目标图像的中心点的距离大于所述畸变半径的像素点,分别将所述查找到的像素点构成的区域判定为与所述至少两个前景目标区域对应的畸变区域。The distortion area determination module is further configured to: respectively search for pixels in the at least two foreground target areas whose distance from the center point of the target image is greater than the distortion radius, and respectively divide the areas formed by the found pixels into It is determined as a distorted area corresponding to the at least two foreground target areas. 10.根据权利要求6所述的查找图像中畸变区域的装置,其特征在于,所述装置还包括突出展示模块,用于突出展示所述目标图像中的所述畸变区域,所述突出展示的方式包括高亮、加边框中的至少一种。10. The device for finding a distorted region in an image according to claim 6, wherein the device further comprises a highlight display module for highlighting the distorted region in the target image, and the highlighted display The manner includes at least one of highlighting and bordering.
CN201510598683.XA 2015-09-18 2015-09-18 The method and device of distorted region in a kind of lookup image Expired - Fee Related CN105227948B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510598683.XA CN105227948B (en) 2015-09-18 2015-09-18 The method and device of distorted region in a kind of lookup image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510598683.XA CN105227948B (en) 2015-09-18 2015-09-18 The method and device of distorted region in a kind of lookup image

Publications (2)

Publication Number Publication Date
CN105227948A true CN105227948A (en) 2016-01-06
CN105227948B CN105227948B (en) 2017-10-27

Family

ID=54996591

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510598683.XA Expired - Fee Related CN105227948B (en) 2015-09-18 2015-09-18 The method and device of distorted region in a kind of lookup image

Country Status (1)

Country Link
CN (1) CN105227948B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107025638A (en) * 2017-03-28 2017-08-08 北京小米移动软件有限公司 The method and device of image procossing
CN110135382A (en) * 2019-05-22 2019-08-16 北京华捷艾米科技有限公司 A human detection method and device
CN110971827A (en) * 2019-12-09 2020-04-07 Oppo广东移动通信有限公司 Portrait mode shooting method and device, terminal equipment and storage medium
CN113222862A (en) * 2021-06-04 2021-08-06 黑芝麻智能科技(上海)有限公司 Image distortion correction method, device, electronic equipment and storage medium
CN113808053A (en) * 2021-09-29 2021-12-17 华北电力大学(保定) A kind of infrared imager and its signal correction method

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1507407A2 (en) * 2003-08-13 2005-02-16 Topcon Corporation Electronic image pickup apparatus with image correction function and method thereof
CN1582459A (en) * 2001-06-12 2005-02-16 奥普提克斯晶硅有限公司 System and method for correcting keystone distortion
CN101661162A (en) * 2009-09-09 2010-03-03 谭洪舟 Distortion compensation method based on wide-angle lens
CN101673043A (en) * 2008-09-10 2010-03-17 鸿富锦精密工业(深圳)有限公司 Wide-angle distortion testing system and method
CN101930111A (en) * 2009-06-20 2010-12-29 凤凰光学(广东)有限公司 Wide-angle lens
CN103124334A (en) * 2012-12-19 2013-05-29 四川九洲电器集团有限责任公司 Lens distortion correction method
CN103824303A (en) * 2014-03-14 2014-05-28 格科微电子(上海)有限公司 Image perspective distortion adjusting method and device based on position and direction of photographed object
CN104200468A (en) * 2014-08-28 2014-12-10 中国矿业大学 Method for obtaining correction parameter of spherical perspective projection model
CN104657940A (en) * 2013-11-22 2015-05-27 中兴通讯股份有限公司 Method and device for correction remediation and analysis alarm of distorted image

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1582459A (en) * 2001-06-12 2005-02-16 奥普提克斯晶硅有限公司 System and method for correcting keystone distortion
EP1507407A2 (en) * 2003-08-13 2005-02-16 Topcon Corporation Electronic image pickup apparatus with image correction function and method thereof
EP1507407A3 (en) * 2003-08-13 2011-05-11 Topcon Corporation Electronic image pickup apparatus with image correction function and method thereof
CN101673043A (en) * 2008-09-10 2010-03-17 鸿富锦精密工业(深圳)有限公司 Wide-angle distortion testing system and method
CN101930111A (en) * 2009-06-20 2010-12-29 凤凰光学(广东)有限公司 Wide-angle lens
CN101661162A (en) * 2009-09-09 2010-03-03 谭洪舟 Distortion compensation method based on wide-angle lens
CN103124334A (en) * 2012-12-19 2013-05-29 四川九洲电器集团有限责任公司 Lens distortion correction method
CN104657940A (en) * 2013-11-22 2015-05-27 中兴通讯股份有限公司 Method and device for correction remediation and analysis alarm of distorted image
CN103824303A (en) * 2014-03-14 2014-05-28 格科微电子(上海)有限公司 Image perspective distortion adjusting method and device based on position and direction of photographed object
CN104200468A (en) * 2014-08-28 2014-12-10 中国矿业大学 Method for obtaining correction parameter of spherical perspective projection model

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王会峰等: "移动特征靶标的摄像机径向畸变标定", 《光学学报》 *
艾莉莉等: "照相物镜径向畸变模型的再商讨", 《光学学报 》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107025638A (en) * 2017-03-28 2017-08-08 北京小米移动软件有限公司 The method and device of image procossing
CN107025638B (en) * 2017-03-28 2020-02-07 北京小米移动软件有限公司 Image processing method and device
CN110135382A (en) * 2019-05-22 2019-08-16 北京华捷艾米科技有限公司 A human detection method and device
CN110971827A (en) * 2019-12-09 2020-04-07 Oppo广东移动通信有限公司 Portrait mode shooting method and device, terminal equipment and storage medium
CN113222862A (en) * 2021-06-04 2021-08-06 黑芝麻智能科技(上海)有限公司 Image distortion correction method, device, electronic equipment and storage medium
CN113808053A (en) * 2021-09-29 2021-12-17 华北电力大学(保定) A kind of infrared imager and its signal correction method

Also Published As

Publication number Publication date
CN105227948B (en) 2017-10-27

Similar Documents

Publication Publication Date Title
KR101612727B1 (en) Method and electronic device for implementing refocusing
US8315443B2 (en) Viewpoint detector based on skin color area and face area
US8660309B2 (en) Image processing apparatus, image processing method, image processing program and recording medium
CN105227948B (en) The method and device of distorted region in a kind of lookup image
CN108076278B (en) A kind of automatic focusing method, device and electronic equipment
CN104867113B (en) The method and system of perspective image distortion correction
CN104363377B (en) Display methods, device and the terminal of focus frame
CN104333748A (en) Method, device and terminal for acquiring image subject object
WO2015180659A1 (en) Image processing method and image processing device
CN109883391B (en) Monocular distance measurement method based on digital imaging of microlens array
CN106101522A (en) Use the method and apparatus that non-optical field imaging equipment obtains light field data
WO2014023231A1 (en) Wide-view-field ultrahigh-resolution optical imaging system and method
KR20170005009A (en) Generation and use of a 3d radon image
CN104867125B (en) Obtain the method and device of image
KR102282456B1 (en) Device and Method for displaying heatmap on the floor plan
CN108053363A (en) Background blurring processing method, device and equipment
US20120019709A1 (en) Assisting focusing method using multiple face blocks
KR101703013B1 (en) 3d scanner and 3d scanning method
WO2022126430A1 (en) Auxiliary focusing method, apparatus and system
US9769379B2 (en) Method and apparatus for selecting target image
EP3026631A1 (en) Method and apparatus for estimating depth of focused plenoptic data
CN107454377A (en) A kind of algorithm and system that three-dimensional imaging is carried out using camera
JP5900017B2 (en) Depth estimation apparatus, reconstructed image generation apparatus, depth estimation method, reconstructed image generation method, and program
CN106919246A (en) The display methods and device of a kind of application interface
US20130083169A1 (en) Image capturing apparatus, image processing apparatus, image processing method and program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20171027