[go: up one dir, main page]

CN104867113B - The method and system of perspective image distortion correction - Google Patents

The method and system of perspective image distortion correction Download PDF

Info

Publication number
CN104867113B
CN104867113B CN201510149800.4A CN201510149800A CN104867113B CN 104867113 B CN104867113 B CN 104867113B CN 201510149800 A CN201510149800 A CN 201510149800A CN 104867113 B CN104867113 B CN 104867113B
Authority
CN
China
Prior art keywords
image
vector information
perspective distortion
distortion correction
dimensional vector
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.)
Active
Application number
CN201510149800.4A
Other languages
Chinese (zh)
Other versions
CN104867113A (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.)
MoUniverse (Suzhou) Technology Co.,Ltd.
Original Assignee
Coolpad Software Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Coolpad Software Technology Shenzhen Co Ltd filed Critical Coolpad Software Technology Shenzhen Co Ltd
Priority to CN201510149800.4A priority Critical patent/CN104867113B/en
Priority to PCT/CN2015/080314 priority patent/WO2016155110A1/en
Publication of CN104867113A publication Critical patent/CN104867113A/en
Application granted granted Critical
Publication of CN104867113B publication Critical patent/CN104867113B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

本发明适用于图像技术领域,提供了一种图像透视畸变校正的方法及系统,应用于包括两个摄像头的拍摄终端,所述方法包括有:通过第一摄像头和第二摄像头同时对被摄物体进行拍摄,获取对应的第一图像和第二图像;分别生成所述第一图像对应的第一三维矢量信息和所述第二图像对应的第二三维矢量信息;根据得到的所述第一三维矢量信息和所述第二三维矢量信息,通过预定的透视畸变校正算法,对所述第一图像和所述第二图像进行透视畸变校正。借此,本发明能够实现对三维图像进行透视畸变校正,并且可大大提高透视畸变校正的速度。

The present invention is applicable to the field of image technology, and provides a method and system for correcting image perspective distortion, which is applied to a shooting terminal including two cameras. Taking pictures, acquiring corresponding first images and second images; respectively generating first three-dimensional vector information corresponding to the first image and second three-dimensional vector information corresponding to the second image; according to the obtained first three-dimensional vector information The vector information and the second three-dimensional vector information perform perspective distortion correction on the first image and the second image through a predetermined perspective distortion correction algorithm. Thereby, the present invention can implement perspective distortion correction on a three-dimensional image, and can greatly increase the speed of perspective distortion correction.

Description

图像透视畸变校正的方法及系统Method and system for image perspective distortion correction

技术领域technical field

本发明涉及图像拍摄技术领域,尤其涉及一种图像透视畸变校正的方法及系统。The present invention relates to the field of image capture technology, in particular to a method and system for correcting image perspective distortion.

背景技术Background technique

由于相机、手机等拍摄终端光学系统并不是精确地按理想化的小孔成像的原理工作,存在有透视畸变,物体在拍摄终端的成像面上的实际成像与理想成像之间存在有光学畸变误差。现有技术中已存在基于物理距离与方向进行镜头透视畸变校正的技术,其通过镜头调焦拍摄几张图像,然后分析图像判断焦点计算距离,再利用距离参数对图像进行透视畸变校正。现有技术由于不可能拍摄无数张照片来计算距离,所以校正精度很低导致校正效果不好;而且拍摄多张照片每次都需单次调焦、曝光等所需时间很长从而速度慢。另外,现有技术只能校正二维(Two Dimension,2D)图像的透视畸变,对三维(ThreeDimension,3D)图像的透视畸变则束手无策。Because the optical system of shooting terminals such as cameras and mobile phones does not work precisely according to the principle of idealized pinhole imaging, there is perspective distortion, and there is an optical distortion error between the actual imaging of the object on the imaging surface of the shooting terminal and the ideal imaging. . In the prior art, there is a technology for correcting lens perspective distortion based on physical distance and direction. It takes several images by focusing the lens, then analyzes the images to determine the focal point to calculate the distance, and then uses the distance parameters to correct the perspective distortion of the image. In the existing technology, it is impossible to take countless photos to calculate the distance, so the correction accuracy is very low and the correction effect is not good; and it takes a long time to take a single focus and exposure each time to take multiple photos, so the speed is slow. In addition, the existing technology can only correct the perspective distortion of a two-dimensional (Two Dimension, 2D) image, but is helpless for the perspective distortion of a three-dimensional (Three Dimension, 3D) image.

综上可知,现有技术在实际使用上显然存在不便与缺陷,所以有必要加以改进。In summary, there are obviously inconveniences and defects in the actual use of the prior art, so it is necessary to improve it.

发明内容Contents of the invention

针对上述的缺陷,本发明的目的在于提供一种图像透视畸变校正的方法及系统,其能够实现对三维图像进行透视畸变校正,并且可大大提高透视畸变校正的速度。In view of the above-mentioned defects, the purpose of the present invention is to provide a method and system for correcting perspective distortion of an image, which can realize perspective distortion correction for three-dimensional images, and can greatly increase the speed of perspective distortion correction.

为了实现上述目的,本发明提供一种图像透视畸变校正的方法,应用于包括两个摄像头的拍摄终端,所述方法包括有:In order to achieve the above object, the present invention provides a method for correcting image perspective distortion, which is applied to a shooting terminal including two cameras, and the method includes:

通过第一摄像头和第二摄像头同时对被摄物体进行拍摄,获取对应的第一图像和第二图像;Simultaneously photographing the subject through the first camera and the second camera, and acquiring corresponding first images and second images;

分别生成所述第一图像对应的第一三维矢量信息和所述第二图像对应的第二三维矢量信息;respectively generating first three-dimensional vector information corresponding to the first image and second three-dimensional vector information corresponding to the second image;

根据得到所述第一三维矢量信息和所述第二三维矢量信息,通过预定的透视畸变校正算法,对所述第一图像和所述第二图像进行透视畸变校正。Perform perspective distortion correction on the first image and the second image through a predetermined perspective distortion correction algorithm according to the obtained first three-dimensional vector information and the second three-dimensional vector information.

根据本发明所述的方法,所述分别生成第一图像对应的第一三维矢量信息和所述第二图像对应的第二三维矢量信息的步骤包括:According to the method of the present invention, the step of respectively generating the first 3D vector information corresponding to the first image and the second 3D vector information corresponding to the second image includes:

生成所述第一图像中各像素点的所述第一三维矢量信息;generating the first three-dimensional vector information of each pixel in the first image;

生成所述第二图像中各像素点的所述第二三维矢量信息。Generate the second three-dimensional vector information of each pixel in the second image.

根据本发明所述的方法,所述分别生成第一图像对应的第一三维矢量信息和所述第二图像对应的第二三维矢量信息的步骤包括:According to the method of the present invention, the step of respectively generating the first 3D vector information corresponding to the first image and the second 3D vector information corresponding to the second image includes:

分析出所述第一图像和所述第二图像的重合区域;Analyzing the overlapping area of the first image and the second image;

计算所述第一图像在所述重合区域中每个所述像素点对应的原像点距所述第一摄像头的距离,得到第一距离,并根据每个所述像素点的第一二维坐标和所述第一距离,生成所述第一图像的所述第一三维矢量信息;Calculate the distance between the original image point corresponding to each pixel point of the first image in the overlapping area and the first camera to obtain the first distance, and according to the first two-dimensional of each pixel point Coordinates and the first distance, generating the first three-dimensional vector information of the first image;

计算所述第二图像在所述重合区域中每个所述像素点对应的原像点距所述第二摄像头的距离,得到第二距离,并根据每个所述像素点的第二二维坐标和所述第二距离,生成所述第二图像的所述第二三维矢量信息。Calculate the distance between the original image point corresponding to each pixel point of the second image in the overlapping area and the second camera to obtain a second distance, and according to the second two-dimensional value of each pixel point Coordinates and the second distance to generate the second three-dimensional vector information of the second image.

根据本发明所述的方法,所述根据得到的所述第一三维矢量信息和所述第二三维矢量信息,通过预定的透视畸变校正算法,对所述第一图像和所述第二图像进行透视畸变校正的步骤包括:According to the method of the present invention, the first image and the second image are performed on the first image and the second image through a predetermined perspective distortion correction algorithm according to the obtained first three-dimensional vector information and the second three-dimensional vector information. The steps of perspective distortion correction include:

根据所述第一三维矢量信息调用预定的第一透视畸变校正参数,并通过所述透视畸变校正算法对所述第一图像的所述重合区域进行透视畸变校正;calling a predetermined first perspective distortion correction parameter according to the first three-dimensional vector information, and performing perspective distortion correction on the overlapped region of the first image through the perspective distortion correction algorithm;

根据所述第二三维矢量信息调用预定的第二透视畸变校正参数,并通过所述透视畸变校正算法对所述第二图像的所述重合区域进行透视畸变校正。Calling a predetermined second perspective distortion correction parameter according to the second three-dimensional vector information, and performing perspective distortion correction on the overlapped region of the second image through the perspective distortion correction algorithm.

根据本发明所述的方法,所述根据得到的所述第一三维矢量信息和所述第二三维矢量信息,通过预定的透视畸变校正算法,对所述第一图像和所述第二图像进行透视畸变校正的步骤之后包括:According to the method of the present invention, the first image and the second image are performed on the first image and the second image through a predetermined perspective distortion correction algorithm according to the obtained first three-dimensional vector information and the second three-dimensional vector information. The steps after perspective distortion correction include:

若接收到图像展示指令,判断所述图像展示指令的类型;If an image display instruction is received, determine the type of the image display instruction;

若所述图像展示指令为二维图像展示指令,则截取出校正后的所述第一图像或所述第二图像中的所述重合区域进行展示;If the image display instruction is a two-dimensional image display instruction, intercepting the corrected first image or the overlapping area in the second image for display;

若所述图像展示指令为三维图像展示指令,则对校正后的所述第一图像和所述第二图像进行三维调制和展示。If the image display instruction is a three-dimensional image display instruction, perform three-dimensional modulation and display on the corrected first image and the second image.

本发明还提供一种图像透视畸变校正的系统,应用于包括两个摄像头的拍摄终端,所述系统包括有:The present invention also provides a system for correcting image perspective distortion, which is applied to a shooting terminal including two cameras, and the system includes:

图像获取模块,用于通过第一摄像头和第二摄像头同时对被摄物体进行拍摄,获取对应的第一图像和第二图像;An image acquisition module, configured to simultaneously photograph the subject through the first camera and the second camera, and acquire corresponding first images and second images;

信息生成模块,用于分别生成所述第一图像对应的第一三维矢量信息和所述第二图像对应的第二三维矢量信息;an information generating module, configured to generate first three-dimensional vector information corresponding to the first image and second three-dimensional vector information corresponding to the second image;

图像校正模块,用于根据得到的所述第一三维矢量信息和所述第二三维矢量信息,通过预定的透视畸变校正算法,对所述第一图像和所述第二图像进行透视畸变校正。An image correction module, configured to perform perspective distortion correction on the first image and the second image through a predetermined perspective distortion correction algorithm according to the obtained first three-dimensional vector information and the second three-dimensional vector information.

根据本发明所述的系统,所述信息生成模块包括:According to the system of the present invention, the information generation module includes:

第一生成子模块,用于生成所述第一图像中各像素点的所述第一三维矢量信息;A first generating submodule, configured to generate the first three-dimensional vector information of each pixel in the first image;

第二生成子模块,用于生成所述第二图像中各像素点的所述第二三维矢量信息。The second generating submodule is configured to generate the second three-dimensional vector information of each pixel in the second image.

根据本发明所述的系统,所述信息生成模块包括:According to the system of the present invention, the information generation module includes:

区域分析子模块,用于分析出所述第一图像和所述第二图像的重合区域;an area analysis submodule, configured to analyze the overlapping area of the first image and the second image;

所述第一生成子模块,用于计算所述第一图像在所述重合区域中每个所述像素点对应的原像点距所述第一摄像头的距离,得到第一距离,并根据每个所述像素点的第一二维坐标和所述第一距离,生成所述第一图像的所述第一三维矢量信息;The first generation sub-module is used to calculate the distance between the original image point corresponding to each pixel point of the first image in the overlapping area and the first camera to obtain the first distance, and according to each The first two-dimensional coordinates and the first distance of each of the pixel points are used to generate the first three-dimensional vector information of the first image;

所述第二生成子模块,用于计算所述第二图像在所述重合区域中每个所述像素点对应的原像点距所述第二摄像头的距离,得到第二距离,并根据每个所述像素点的第二二维坐标和所述第二距离,生成所述第二图像的所述第二三维矢量信息。The second generation sub-module is used to calculate the distance between the original image point corresponding to each pixel point of the second image in the overlapping area and the second camera to obtain the second distance, and according to each The second two-dimensional coordinates of the pixel points and the second distance are used to generate the second three-dimensional vector information of the second image.

根据本发明所述的系统,所述图像校正模块包括:According to the system of the present invention, the image correction module includes:

第一校正子模块,用于根据所述第一三维矢量信息调用预定的第一透视畸变校正参数,并通过所述透视畸变校正算法对所述第一图像的所述重合区域进行透视畸变校正;The first correction submodule is configured to call a predetermined first perspective distortion correction parameter according to the first three-dimensional vector information, and perform perspective distortion correction on the overlapped region of the first image through the perspective distortion correction algorithm;

第二校正子模块,用于根据所述第二三维矢量信息调用预定的第二透视畸变校正参数,并通过所述透视畸变校正算法对所述第二图像的所述重合区域进行透视畸变校正。The second correcting submodule is configured to call a predetermined second perspective distortion correction parameter according to the second three-dimensional vector information, and perform perspective distortion correction on the overlapped region of the second image through the perspective distortion correction algorithm.

根据本发明所述的系统,还包括:According to the system of the present invention, it also includes:

指令接收模块,用于对所述第一图像和所述第二图像进行透视畸变校正之后,若接收到图像展示指令,判断所述图像展示指令的类型;An instruction receiving module, configured to determine the type of the image display instruction if an image display instruction is received after performing perspective distortion correction on the first image and the second image;

第一展示模块,用于若所述图像展示指令为二维图像展示指令时,截取出校正后的所述第一图像或所述第二图像中的所述重合区域进行展示;The first display module is configured to intercept the corrected first image or the overlapping area in the second image for display if the image display instruction is a two-dimensional image display instruction;

第二展示模块,用于若所述图像展示指令为三维图像展示指令时,对校正后的所述第一图像和所述第二图像进行三维调制和展示。The second display module is configured to perform three-dimensional modulation and display on the corrected first image and the second image if the image display instruction is a three-dimensional image display instruction.

本发明拍摄终端在拍摄时,通过两个摄像头一次性获取被摄物体的两个图像,并分别生成两个图像的三维矢量信息,可大大缩短现有技术需不同距离分别多次对焦拍摄多个图像获取深度信息的时间;然后调用透视畸变校正算法对三维图像进行透视畸变校正。借此,本发明能够实现对三维图像进行透视畸变校正,并且可大大提高透视畸变校正的速度。优选的是,本发明可通过两个摄像头捕获被摄图像中各像素点的三维矢量信息,并根据各像素点的三维矢量信息进行三维图像的透视畸变校正,相比于现有技术通过几张照片获取的几个深度值进行局部大范围校正的精度,本发明大大提高了透视畸变校正的精度。When shooting, the shooting terminal of the present invention acquires two images of the object at one time through two cameras, and generates the three-dimensional vector information of the two images respectively, which can greatly shorten the need for multiple focusing shots at different distances in the prior art. The time when the image acquires depth information; then the perspective distortion correction algorithm is called to correct the perspective distortion of the 3D image. Thereby, the present invention can implement perspective distortion correction on a three-dimensional image, and can greatly increase the speed of perspective distortion correction. Preferably, the present invention can capture the three-dimensional vector information of each pixel point in the captured image through two cameras, and perform perspective distortion correction of the three-dimensional image according to the three-dimensional vector information of each pixel point. The accuracy of local large-scale correction for several depth values obtained from photos is greatly improved by the present invention.

附图说明Description of drawings

图1是本发明图像透视畸变校正的系统的结构示意图;Fig. 1 is a schematic structural diagram of a system for correcting image perspective distortion in the present invention;

图2是本发明优选图像透视畸变校正的系统的结构示意图;Fig. 2 is a schematic structural diagram of a system for correcting preferred image perspective distortion in the present invention;

图3是本发明图像透视畸变校正的方法流程图;Fig. 3 is a flow chart of a method for correcting image perspective distortion in the present invention;

图4是本发明第一实施例中图像透视畸变校正的方法流程图;Fig. 4 is a flowchart of a method for correcting image perspective distortion in the first embodiment of the present invention;

图5是本发明第二实施例中图像透视畸变校正方法的实现原理图。Fig. 5 is a schematic diagram of the realization of the image perspective distortion correction method in the second embodiment of the present invention.

具体实施方式detailed description

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

图1是本发明图像透视畸变校正的系统的结构示意图,应用于包括两个摄像头的拍摄终端,所述系统100包括有图像获取模块10、信息生成模块20以及图像校正模块30,其中:1 is a schematic structural diagram of a system for correcting image perspective distortion according to the present invention, which is applied to a shooting terminal including two cameras. The system 100 includes an image acquisition module 10, an information generation module 20, and an image correction module 30, wherein:

图像获取模块10,用于通过第一摄像头和第二摄像头同时对被摄物体进行拍摄,获取对应的第一图像和第二图像。所述被摄物体可以是人物、动物、植物、建筑物、山、水、天空等任意一种或多种。所述第一摄像头和第二摄像头为拍摄终端在同一面的两个摄像头,可以是左右摄像头或上下摄像头,所述两个摄像头可同时拍摄且拍摄的内容基本一致,即第一图像和第二图像的图像内容基本一致,存在较多的重合区域。目前两个摄像头已在相机、手机、平板电脑等拍摄终端上广泛应用。The image acquisition module 10 is configured to simultaneously photograph the subject through the first camera and the second camera, and acquire corresponding first images and second images. The subject may be any one or more of people, animals, plants, buildings, mountains, water, sky and the like. The first camera and the second camera are two cameras on the same side of the shooting terminal, which can be left and right cameras or up and down cameras. The two cameras can shoot at the same time and the content of the shots is basically the same, that is, the first image and the second The image content of the images is basically the same, and there are many overlapping areas. At present, the two cameras have been widely used in shooting terminals such as cameras, mobile phones, and tablet computers.

信息生成模块20,用于分别生成第一图像对应的第一三维矢量信息和第二图像对应的第二三维矢量信息。这里,根据第一图像可以生成第一三维矢量信息,该第一三维矢量信息可以构成第一三维图像;根据第二图像可以生成第二三维矢量信息,该第二三维矢量信息可以构成第二三维图像。优选的是,本发明中的三维矢量信息是指图像的平面二维坐标以及图像中各像素点对应的原像点与摄像头之间距离的矢量信息。所述距离优选为图像的平面二维坐标以及图像中各应像素点对应的原像点与摄像头平面之间距离,当然所述距离也可以是图像的平面二维坐标以及图像中各应像素点对应的原像点与摄像头的中心点之间距离。所述原像点是图像中像素点对应的实际物体的点。The information generation module 20 is configured to respectively generate first 3D vector information corresponding to the first image and second 3D vector information corresponding to the second image. Here, the first three-dimensional vector information can be generated according to the first image, and the first three-dimensional vector information can constitute the first three-dimensional image; the second three-dimensional vector information can be generated according to the second image, and the second three-dimensional vector information can constitute the second three-dimensional vector information. image. Preferably, the three-dimensional vector information in the present invention refers to the plane two-dimensional coordinates of the image and the vector information of the distance between the original image corresponding to each pixel in the image and the camera. The distance is preferably the plane two-dimensional coordinates of the image and the distance between the original image point corresponding to each corresponding pixel in the image and the camera plane. Of course, the distance can also be the plane two-dimensional coordinates of the image and each corresponding pixel in the image. The distance between the corresponding original image point and the center point of the camera. The original image point is the point of the actual object corresponding to the pixel point in the image.

图像校正模块30,用于根据得到的第一三维矢量信息和第二三维矢量信息,通过预定的透视畸变校正算法,对第一图像和第二图像进行透视畸变校正。拍摄终端中可预存有至少一种透视畸变校正算法,例如基于物体距离与方向进行镜头透视畸变校正算法,由于所述透视畸变校正算法为现有技术,因此在此不再赘述。具体而言,根据透视畸变校正算法和第一三维矢量信息,对第一图像进行透视畸变校正;以及根据透视畸变校正算法和第二三维矢量信息,对第二图像进行透视畸变校正。The image correction module 30 is configured to perform perspective distortion correction on the first image and the second image through a predetermined perspective distortion correction algorithm according to the obtained first 3D vector information and second 3D vector information. At least one perspective distortion correction algorithm may be pre-stored in the shooting terminal, such as a lens perspective distortion correction algorithm based on object distance and direction. Since the perspective distortion correction algorithm is a prior art, it will not be repeated here. Specifically, perform perspective distortion correction on the first image according to the perspective distortion correction algorithm and the first 3D vector information; and perform perspective distortion correction on the second image according to the perspective distortion correction algorithm and the second 3D vector information.

本发明拍摄终端在拍摄时,通过两个摄像头一次性获取被摄物体的两个图像,并分别生成两个图像的三维矢量信息,可大大缩短现有技术需不同距离分别多次对焦拍摄多个图像获取深度信息的时间;然后调用透视畸变校正算法对三维图像进行透视畸变校正,从而实现对三维图像进行透视畸变校正。When shooting, the shooting terminal of the present invention acquires two images of the object at one time through two cameras, and generates the three-dimensional vector information of the two images respectively, which can greatly shorten the need for multiple focusing shots at different distances in the prior art. The time when the image acquires depth information; then the perspective distortion correction algorithm is called to correct the perspective distortion of the 3D image, so as to realize the perspective distortion correction of the 3D image.

图2是本发明优选图像透视畸变校正的系统的结构示意图,应用于包括两个摄像头的拍摄终端,所述拍摄终端可以是相机、手机、平板电脑等,所述系统100至少包括有图像获取模块10、信息生成模块20以及图像校正模块30,其中:Fig. 2 is a schematic structural diagram of a preferred image perspective distortion correction system of the present invention, which is applied to a shooting terminal including two cameras, and the shooting terminal can be a camera, a mobile phone, a tablet computer, etc., and the system 100 includes at least an image acquisition module 10. Information generation module 20 and image correction module 30, wherein:

所述图像获取模块10,用于通过第一摄像头和第二摄像头同时对被摄物体进行拍摄,获取对应的第一图像和第二图像。The image acquisition module 10 is configured to simultaneously photograph the subject through the first camera and the second camera, and acquire corresponding first images and second images.

所述信息生成模块20,用于分别生成第一图像对应的第一三维矢量信息和第二图像对应的第二三维矢量信息。优选的是,所述信息生成模块20包括:The information generation module 20 is configured to respectively generate first 3D vector information corresponding to the first image and second 3D vector information corresponding to the second image. Preferably, the information generating module 20 includes:

第一生成子模块21,用于生成第一图像中各像素点的第一三维矢量信息。The first generating sub-module 21 is configured to generate first three-dimensional vector information of each pixel in the first image.

第二生成子模块22,用于生成第二图像中各像素点的第二三维矢量信息。The second generating sub-module 22 is configured to generate second three-dimensional vector information of each pixel in the second image.

通过两个摄像头一次拍摄获取三维矢量信息,大大缩短现有技术需不同距离分别多次对焦拍摄多张照片获取深度信息的时间。基于像素点的三维矢量信息校正的精度是现有技术通过几张照片获取的几个深度值进行局部大范围校正的精度的千万倍,可大大提高透视畸变校正的速度与精度。Obtaining three-dimensional vector information through one shot with two cameras greatly shortens the time required to obtain depth information by focusing and shooting multiple photos at different distances in the prior art. The accuracy of pixel-based 3D vector information correction is tens of millions of times higher than that of local large-scale correction based on several depth values obtained from several photos in the existing technology, which can greatly improve the speed and accuracy of perspective distortion correction.

更好的是,所述信息生成模块30还可包括:Better yet, the information generating module 30 may also include:

区域分析子模块23,用于分析出第一图像和第二图像的重合区域。所述重合区域的分析涉及到图像识别技术,基于RGB(Red,Green,Blue,红绿蓝)值,亮度,灰度等像素点特征找到相似点与不相似点分界线,即可分析出第一图像和第二图像的重合区域。The area analysis sub-module 23 is configured to analyze the overlapping area of the first image and the second image. The analysis of the overlapping area involves image recognition technology. Based on RGB (Red, Green, Blue, red, green and blue) values, brightness, grayscale and other pixel features to find the boundary line between similar points and dissimilar points, the second point can be analyzed. The overlapping area of the first image and the second image.

第一生成子模块21,用于计算第一图像在重合区域中每个像素点对应的原像点距第一摄像头的距离,得到第一距离,并根据每个像素点的第一二维坐标和第一距离,生成第一图像的第一三维矢量信息,第一三维矢量信息可以用(x,y,z)来表示。即本发明中的第一三维矢量信息是指第一图像的平面二维坐标以及第一图像中各像素点对应的原像点与第一摄像头之间距离的矢量信息。The first generation sub-module 21 is used to calculate the distance between the original image point corresponding to each pixel point of the first image in the overlapping area and the first camera to obtain the first distance, and according to the first two-dimensional coordinates of each pixel point and the first distance to generate first three-dimensional vector information of the first image, where the first three-dimensional vector information can be represented by (x, y, z). That is, the first 3D vector information in the present invention refers to the plane 2D coordinates of the first image and the vector information of the distance between the original image corresponding to each pixel in the first image and the first camera.

第二生成子模块22,用于计算第二图像在重合区域中每个像素点对应的原像点距第二摄像头的距离,得到第二距离,并根据每个像素点的第二二维坐标和第二距离,生成第二图像的第二三维矢量信息,第二三维矢量信息可以用(x,y,z)来表示。即本发明中的第二三维矢量信息是指第二图像的平面二维坐标以及第二图像中中各像素点对应的原像点与第二摄像头之间距离的矢量信息。The second generation sub-module 22 is used to calculate the distance from the original image point corresponding to each pixel point of the second image in the overlapping area to the second camera to obtain the second distance, and according to the second two-dimensional coordinates of each pixel point and the second distance to generate second three-dimensional vector information of the second image, where the second three-dimensional vector information can be represented by (x, y, z). That is, the second 3D vector information in the present invention refers to the plane 2D coordinates of the second image and the vector information of the distance between the original image corresponding to each pixel in the second image and the second camera.

所述图像校正模块30,用于根据得到的第一三维矢量信息和第二三维矢量信息,通过预定的透视畸变校正算法,对第一图像和第二图像进行透视畸变校正。The image correction module 30 is configured to perform perspective distortion correction on the first image and the second image through a predetermined perspective distortion correction algorithm according to the obtained first 3D vector information and second 3D vector information.

优选的是,所述图像校正模块30包括:Preferably, the image correction module 30 includes:

第一校正子模块31,用于根据第一三维矢量信息调用预定的第一透视畸变校正参数,并通过透视畸变校正算法对第一图像的重合区域进行透视畸变校正。The first correction sub-module 31 is configured to call a predetermined first perspective distortion correction parameter according to the first three-dimensional vector information, and perform perspective distortion correction on the overlapped area of the first image through a perspective distortion correction algorithm.

第二校正子模块32,用于根据第二三维矢量信息调用预定的第二透视畸变校正参数,并通过透视畸变校正算法对第二图像的重合区域进行透视畸变校正。第二透视畸变校正参数与第一透视畸变校正参数可以相同或不同。The second correction sub-module 32 is configured to call a predetermined second perspective distortion correction parameter according to the second three-dimensional vector information, and perform perspective distortion correction on the overlapped area of the second image through a perspective distortion correction algorithm. The second perspective distortion correction parameter may be the same as or different from the first perspective distortion correction parameter.

更好的是,所述图像透视畸变校正的系统100还可包括:Even better, the system 100 for correcting image perspective distortion may also include:

指令接收模块40,用于对第一图像和第二图像进行透视畸变校正之后,若接收到图像展示指令,判断所述图像展示指令的类型。所述图像展示指令的类型可以是二维图像展示指令或者三维图像展示指令。The instruction receiving module 40 is configured to determine the type of the image display instruction if an image display instruction is received after performing perspective distortion correction on the first image and the second image. The type of the image display instruction may be a two-dimensional image display instruction or a three-dimensional image display instruction.

第一展示模块50,用于若图像展示指令为二维图像展示指令时,截取出校正后的第一图像或第二图像中的重合区域进行展示。The first display module 50 is configured to, if the image display instruction is a two-dimensional image display instruction, intercept and display the overlapped area in the corrected first image or the second image.

第二展示模块60,用于若图像展示指令为三维图像展示指令时,对校正后的第一图像和第二图像进行三维调制和展示。这里,校正后的第一图像和第二图像同时展示可构成三维图像。The second display module 60 is configured to perform three-dimensional modulation and display on the corrected first image and second image if the image display instruction is a three-dimensional image display instruction. Here, the simultaneous display of the corrected first image and the second image can constitute a three-dimensional image.

本发明描述了通过两个摄像头捕获被摄图像中各像素点的三维矢量信息,并调用相应镜头透视畸变参数进行三维图像畸变校正的技术,大大提高透视畸变校正的速度与精度,并且弥补了现有技术不能对三维图像进行透视畸变校正的缺陷。还可以用校正后的两幅图像进行三维显示,用户体验更佳。The invention describes the technique of capturing the three-dimensional vector information of each pixel point in the photographed image through two cameras, and calling the perspective distortion parameters of the corresponding lens to correct the three-dimensional image distortion, which greatly improves the speed and accuracy of perspective distortion correction, and makes up for the existing There are drawbacks to the technology's inability to perform perspective distortion correction on 3D images. It is also possible to use the corrected two images for three-dimensional display, and the user experience is better.

图3是本发明图像透视畸变校正的方法流程图,应用于包括两个摄像头的拍摄终端,所述方法可通过如图1或图2所示的像透视畸变校正的系统100实现,所述方法包括有:FIG. 3 is a flow chart of a method for correcting image perspective distortion of the present invention, which is applied to a shooting terminal including two cameras. The method can be implemented by the system 100 for correcting image perspective distortion as shown in FIG. 1 or FIG. 2 , and the method Including:

步骤S301,通过第一摄像头和第二摄像头同时对被摄物体进行拍摄,获取对应的第一图像和第二图像。In step S301, the subject is photographed simultaneously by the first camera and the second camera, and corresponding first images and second images are acquired.

所述被摄物体可以是人物、动物、植物、建筑物、山、水、天空等任意一种或多种。所述第一摄像头和第二摄像头为拍摄终端在同一面的两个摄像头,可以是左右摄像头或上下摄像头,所述两个摄像头可同时拍摄且拍摄的内容基本一致,即第一图像和第二图像的图像内容基本一致,存在较多的重合区域。The subject may be any one or more of people, animals, plants, buildings, mountains, water, sky and the like. The first camera and the second camera are two cameras on the same side of the shooting terminal, which can be left and right cameras or up and down cameras. The two cameras can shoot at the same time and the content of the shots is basically the same, that is, the first image and the second The image content of the images is basically the same, and there are many overlapping areas.

步骤S302,分别生成第一图像对应的第一三维矢量信息和第二图像对应的第二三维矢量信息。Step S302, respectively generating first 3D vector information corresponding to the first image and second 3D vector information corresponding to the second image.

这里,根据第一图像可以生成第一三维矢量信息,该第一三维矢量信息可以构成第一三维图像;根据第二图像可以生成第二三维矢量信息,该第二三维矢量信息可以构成第二三维图像。本步骤优选的是,生成第一图像中各像素点的第一三维矢量信息,以及生成第二图像中各像素点的第二三维矢量信息。基于像素点的三维矢量信息校正的精度是现有技术通过几张照片获取的几个深度值进行局部大范围校正的精度的千万倍,可大大提高透视畸变校正的速度与精度。即本发明中的三维矢量信息是指图像的平面二维坐标以及图像中各像素点对应的原像点与摄像头之间距离的矢量信息。所述距离优选为图像的平面二维坐标以及图像中各应像素点对应的原像点与摄像头平面之间距离,当然所述距离也可以是图像的平面二维坐标以及图像中各应像素点对应的原像点与摄像头的中心点之间距离。所述原像点是图像中像素点对应的实际物体的点。Here, the first three-dimensional vector information can be generated according to the first image, and the first three-dimensional vector information can constitute the first three-dimensional image; the second three-dimensional vector information can be generated according to the second image, and the second three-dimensional vector information can constitute the second three-dimensional vector information. image. In this step, preferably, the first three-dimensional vector information of each pixel in the first image is generated, and the second three-dimensional vector information of each pixel in the second image is generated. The accuracy of pixel-based 3D vector information correction is tens of millions of times higher than that of local large-scale correction based on several depth values obtained from several photos in the existing technology, which can greatly improve the speed and accuracy of perspective distortion correction. That is, the three-dimensional vector information in the present invention refers to the plane two-dimensional coordinates of the image and the vector information of the distance between the original image corresponding to each pixel in the image and the camera. The distance is preferably the plane two-dimensional coordinates of the image and the distance between the original image point corresponding to each corresponding pixel in the image and the camera plane. Of course, the distance can also be the plane two-dimensional coordinates of the image and each corresponding pixel in the image. The distance between the corresponding original image point and the center point of the camera. The original image point is the point of the actual object corresponding to the pixel point in the image.

步骤S303,根据得到的第一三维矢量信息和第二三维矢量信息,通过预定的透视畸变校正算法,对第一图像和第二图像进行透视畸变校正。Step S303 , performing perspective distortion correction on the first image and the second image through a predetermined perspective distortion correction algorithm according to the obtained first 3D vector information and second 3D vector information.

拍摄终端中可预存有至少一种透视畸变校正算法,例如基于物体距离与方向进行镜头透视畸变校正算法,由于所述透视畸变校正算法为现有技术,因此在此不再赘述。具体而言,根据透视畸变校正算法和第一三维矢量信息,对第一图像进行透视畸变校正;以及根据透视畸变校正算法和第二三维矢量信息,对第二图像进行透视畸变校正。At least one perspective distortion correction algorithm may be pre-stored in the shooting terminal, such as a lens perspective distortion correction algorithm based on object distance and direction. Since the perspective distortion correction algorithm is a prior art, it will not be repeated here. Specifically, perform perspective distortion correction on the first image according to the perspective distortion correction algorithm and the first 3D vector information; and perform perspective distortion correction on the second image according to the perspective distortion correction algorithm and the second 3D vector information.

图4是本发明第一实施例中图像透视畸变校正的方法流程图,应用于包括两个摄像头的拍摄终端,所述方法可通过如图2所示的像透视畸变校正的系统100实现,所述方法包括有:FIG. 4 is a flowchart of a method for correcting image perspective distortion in the first embodiment of the present invention, which is applied to a shooting terminal including two cameras. The method can be implemented by the system 100 for correcting image perspective distortion as shown in FIG. 2 , so The methods described include:

步骤S401,通过第一摄像头和第二摄像头同时对被摄物体进行拍摄,获取对应的第一图像和第二图像。In step S401, the subject is photographed simultaneously by the first camera and the second camera, and corresponding first images and second images are acquired.

步骤S402,分析出第一图像和第二图像的重合区域。所述重合区域的分析涉及到图像识别技术,基于RGB值,亮度,灰度等像素点特征找到相似点与不相似点分界线,即可分析出第一图像和第二图像的重合区域。Step S402, analyzing the overlapping area of the first image and the second image. The analysis of the overlapping area involves image recognition technology. Based on pixel features such as RGB value, brightness, and gray scale, the boundary line between similar points and dissimilar points can be found, and the overlapping area of the first image and the second image can be analyzed.

步骤S403,计算第一图像在重合区域中每个像素点对应的原像点距第一摄像头的距离,得到第一距离,并根据每个像素点的第一二维坐标和第一距离,生成第一图像的第一三维矢量信息。Step S403, calculate the distance between the original image point corresponding to each pixel point of the first image in the overlapping area and the first camera, obtain the first distance, and generate The first three-dimensional vector information of the first image.

即本发明中的第一三维矢量信息是指第一图像的平面二维坐标以及第一图像中对应像素点与第一摄像头之间距离的矢量信息,第一三维矢量信息可以用(x,y,z)来表示。That is, the first three-dimensional vector information in the present invention refers to the plane two-dimensional coordinates of the first image and the vector information of the distance between the corresponding pixel point and the first camera in the first image, and the first three-dimensional vector information can be used (x, y , z) to represent.

步骤S404,根据第一三维矢量信息调用预定的第一透视畸变校正参数,并通过透视畸变校正算法对第一图像的重合区域进行透视畸变校正。Step S404, call a predetermined first perspective distortion correction parameter according to the first 3D vector information, and perform perspective distortion correction on the overlapping area of the first image through a perspective distortion correction algorithm.

步骤S405,计算第二图像在重合区域中每个像素点对应的原像点距第二摄像头的距离,得到第二距离,并根据每个像素点的第二二维坐标和第二距离,生成第二图像的第二三维矢量信息。Step S405, calculate the distance between the original image point corresponding to each pixel point of the second image in the overlapping area and the second camera, obtain the second distance, and generate Second 3D vector information of the second image.

即本发明中的第二三维矢量信息是指第二图像的平面二维坐标以及第二图像中各像素点对应的原像点与第二摄像头之间距离的矢量信息,第二三维矢量信息可以用(x,y,z)来表示。That is, the second three-dimensional vector information in the present invention refers to the plane two-dimensional coordinates of the second image and the vector information of the distance between the original image point corresponding to each pixel in the second image and the second camera, and the second three-dimensional vector information can be Use (x, y, z) to represent.

步骤S406,根据第二三维矢量信息调用预定的第二透视畸变校正参数,并通过透视畸变校正算法对第二图像的重合区域进行透视畸变校正。In step S406, a predetermined second perspective distortion correction parameter is invoked according to the second three-dimensional vector information, and perspective distortion correction is performed on the overlapping area of the second image through a perspective distortion correction algorithm.

第二透视畸变校正参数与第一透视畸变校正参数可以相同或不同。The second perspective distortion correction parameter may be the same as or different from the first perspective distortion correction parameter.

步骤S407,接收到图像展示指令。Step S407, receiving an image display instruction.

所述图像展示指令的类型可以是二维图像展示指令或者三维图像展示指令。The type of the image display instruction may be a two-dimensional image display instruction or a three-dimensional image display instruction.

步骤S408,判断图像展示指令的类型,若图像展示指令为二维图像展示指令则执行步骤S409,若图像展示指令为三维图像展示指令则执行步骤S410。Step S408, determine the type of the image display instruction, if the image display instruction is a two-dimensional image display instruction, execute step S409, and if the image display instruction is a three-dimensional image display instruction, execute step S410.

步骤S409,若图像展示指令为二维图像展示指令,则截取出校正后的第一图像或第二图像中的重合区域进行展示。Step S409, if the image display instruction is a two-dimensional image display instruction, intercepting the corrected first image or the overlapping area in the second image for display.

步骤S410,若图像展示指令为三维图像展示指令,则对校正后的第一图像和第二图像进行三维调制和展示。Step S410, if the image display instruction is a 3D image display instruction, perform 3D modulation and display on the corrected first image and second image.

这里,校正后的第一图像和第二图像同时展示可构成三维图像。Here, the simultaneous display of the corrected first image and the second image can constitute a three-dimensional image.

图5是本发明第二实施例中图像透视畸变校正方法的实现原理图,应用于包括左右摄像头的拍摄终端,主要包括:Fig. 5 is a schematic diagram of the realization of the image perspective distortion correction method in the second embodiment of the present invention, which is applied to a shooting terminal including left and right cameras, mainly including:

一、通过第一摄像头和第二摄像头同时对被摄物体进行拍摄,获取对应的第一图像和第二图像。两个1. Simultaneously photograph the subject through the first camera and the second camera, and obtain corresponding first images and second images. two

1、开启两个摄拍照模式,通过显示屏对被摄体进行拍摄构图;1. Turn on the two camera modes, and compose the subject through the display screen;

2、具体而言,左右摄像头同时对拍摄体进行拍照,获得左右两幅图像并保存,即图像L(即第一图像)、图像R(即第二图像);2. Specifically, the left and right cameras take pictures of the subject at the same time, and obtain and save two left and right images, that is, image L (ie, the first image) and image R (ie, the second image);

二、分别生成第一图像对应的第一三维矢量信息和第二图像对应的第二三维矢量信息。2. Generating first three-dimensional vector information corresponding to the first image and second three-dimensional vector information corresponding to the second image respectively.

分析出图像L和图像R的重合区域,对于两图像L、R的重合区域(图5中的雪花点区域),基于每个像素点调用拍摄终端中预存算法进行几何数学计算,得到图像中每个像素点对应的原像点距摄像头距离z,生成图像的三维矢量信息文档如下:Analyze the overlapping area of image L and image R. For the overlapping area of the two images L and R (the snowflake point area in Figure 5), call the pre-stored algorithm in the shooting terminal based on each pixel to perform geometric and mathematical calculations, and obtain each pixel in the image. The original image point corresponding to each pixel is at a distance z from the camera, and the 3D vector information document of the generated image is as follows:

(x1,y1,z1);(x2,y1,z2)………………………(xn,y1,zn)(x1,y1,z1);(x2,y1,z2)………………(xn,y1,zn)

(x1,y2,zn+1);(x2,y2,zn+2)…………………(xn,y2,z2n)(x1, y2, zn+1); (x2, y2, zn+2)……………(xn, y2, z2n)

. . . . . .

. . . . . .

(x1,ym,z(m-1)n+1);(x2,ym,z(m-1)n+2)………(xn,ym,zmn)(x1,ym,z(m-1)n+1);(x2,ym,z(m-1)n+2)……(xn,ym,zmn)

暂存此文档。这里存在有三个坐标系:图像L的第一坐标,图像R的第二坐标,两个图像重合部分构成的重合图像的第三坐标。其中图像L的第一坐标、图像R的第二坐标是二维坐标系,重合图像的第三坐标是三维坐标系。第三坐标(x,y,z)中的X轴原点为图像L的第一坐标中第一列重合像素点的横坐标x1,而第三坐标(x,y,z)中的Y轴原点为重合图像中最下一行的像素点的纵坐标ym。在每个坐标系中,坐标原点是指每个图像(图像L、图像R或重合图像)的左下角最后一个像素点。记住左右两幅图像L和R的重合部份与不重合部分的临界点如图的横轴坐标x1、x2数据。因为图像R、L的坐标不统一,需要x1或x2来转换,如果以图像L的坐标为基准将用到x1,如果以图像R的坐标为基准将用到x2,本实施例是以图像L的坐标为基准为例说明的。第三坐标的坐标原点是基于第一坐标或第二坐标的坐标原点进行变换而来,转换用到x1或者x2。Stage this document. There are three coordinate systems here: the first coordinate of the image L, the second coordinate of the image R, and the third coordinate of the overlapping image formed by the overlapping parts of the two images. Wherein the first coordinate of the image L and the second coordinate of the image R are a two-dimensional coordinate system, and the third coordinate of the overlapped image is a three-dimensional coordinate system. The origin of the X-axis in the third coordinate (x, y, z) is the abscissa x1 of the first column of coincident pixels in the first coordinate of the image L, and the origin of the Y-axis in the third coordinate (x, y, z) It is the vertical coordinate ym of the pixel point in the bottom line in the overlapping image. In each coordinate system, the coordinate origin refers to the last pixel point in the lower left corner of each image (image L, image R or coincident image). Remember the critical points of the overlapping and non-overlapping parts of the left and right images L and R as shown in the x1 and x2 data on the abscissa. Because the coordinates of images R and L are not uniform, x1 or x2 is needed for conversion. If the coordinates of image L are used as a reference, x1 will be used, and if the coordinates of image R are used as a reference, x2 will be used. This embodiment is based on image L The coordinates of are used as an example to illustrate. The coordinate origin of the third coordinate is transformed based on the coordinate origin of the first coordinate or the second coordinate, and the conversion uses x1 or x2.

三、根据得到的第一三维矢量信息和第二三维矢量信息,通过预定的透视畸变校正算法,对第一图像和第二图像进行透视畸变校正。3. Perform perspective distortion correction on the first image and the second image through a predetermined perspective distortion correction algorithm according to the obtained first 3D vector information and second 3D vector information.

根据生成的三维矢量信息调用镜头原厂家提供的透视畸变修正系数表通过校准算法分别对两幅图像中重合区域(图中斜线部分)进行透视畸变校正(非重合区域校正值默认为0)。校正过程中三维矢量信息(x,y,z)相关的畸变系数M对应左摄像头拍摄图像L的像素点,M对应右摄像头拍摄图像R的像素点;最后只保存校正后的左右两幅图像LJ、RJ,删除其他临时数据或文件。According to the generated 3D vector information, the perspective distortion correction coefficient table provided by the original lens manufacturer is called and the perspective distortion correction is performed on the overlapped area (the oblique line in the figure) in the two images through the calibration algorithm (the non-overlapping area correction value is 0 by default). During the correction process, the distortion coefficient M related to the three-dimensional vector information (x, y, z) corresponds to the pixels of the image L captured by the left camera, and M corresponds to the pixels of the image R captured by the right camera; finally, only the corrected left and right images L are saved J , R J , delete other temporary data or files.

后期若只需二维显示图像,剪切两幅图像中任一幅中的重合区域(图中斜线部分)显示即可;若需进行三维显示,分别用现有三维显示技术对左右图像LJ、RJ进行三维调制与同时播放即可。If you only need to display the image in two dimensions in the later stage, you can cut out the overlapping area (the oblique line in the figure) in any of the two images and display it; J , R J can perform three-dimensional modulation and play simultaneously.

综上所述,本发明拍摄终端在拍摄时,通过两个摄像头一次性获取被摄物体的两个图像,并分别生成两个图像的三维矢量信息,可大大缩短现有技术需不同距离分别多次对焦拍摄多个图像获取深度信息的时间;然后调用透视畸变校正算法对三维图像进行透视畸变校正。借此,本发明能够实现对三维图像进行透视畸变校正,并且可大大提高透视畸变校正的速度。优选的是,本发明可通过两个摄像头捕获被摄图像中各像素点的三维矢量信息,并根据各像素点的三维矢量信息进行三维图像的透视畸变校正,相比于现有技术通过几张照片获取的几个深度值进行局部大范围校正的精度,本发明大大提高了透视畸变校正的精度。In summary, when the shooting terminal of the present invention is shooting, it acquires two images of the subject at one time through two cameras, and generates the three-dimensional vector information of the two images respectively, which can greatly shorten the distance required by the prior art. The time to obtain depth information by focusing on multiple images at a time; then call the perspective distortion correction algorithm to correct the perspective distortion of the 3D image. Thereby, the present invention can implement perspective distortion correction on a three-dimensional image, and can greatly increase the speed of perspective distortion correction. Preferably, the present invention can capture the three-dimensional vector information of each pixel point in the captured image through two cameras, and perform perspective distortion correction of the three-dimensional image according to the three-dimensional vector information of each pixel point. The accuracy of local large-scale correction for several depth values obtained from photos is greatly improved by the present invention.

当然,本发明还可有其它多种实施例,在不背离本发明精神及其实质的情况下,熟悉本领域的技术人员当可根据本发明作出各种相应的改变和变形,但这些相应的改变和变形都应属于本发明所附的权利要求的保护范围。Certainly, the present invention also can have other multiple embodiments, without departing from the spirit and essence of the present invention, those skilled in the art can make various corresponding changes and deformations according to the present invention, but these corresponding Changes and deformations should belong to the scope of protection of the appended claims of the present invention.

Claims (6)

1.一种图像透视畸变校正的方法,其特征在于,应用于包括两个摄像头的拍摄终端,所述方法包括有:1. A method for image perspective distortion correction, characterized in that it is applied to a shooting terminal comprising two cameras, and the method comprises: 通过第一摄像头和第二摄像头同时对被摄物体进行拍摄,获取对应的第一图像和第二图像;Simultaneously photographing the subject through the first camera and the second camera, and acquiring corresponding first images and second images; 分别生成所述第一图像对应的第一三维矢量信息和所述第二图像对应的第二三维矢量信息;respectively generating first three-dimensional vector information corresponding to the first image and second three-dimensional vector information corresponding to the second image; 根据得到的所述第一三维矢量信息和所述第二三维矢量信息通过预定的透视畸变校正算法,对所述第一图像和所述第二图像进行透视畸变校正;Perform perspective distortion correction on the first image and the second image through a predetermined perspective distortion correction algorithm according to the obtained first three-dimensional vector information and the second three-dimensional vector information; 所述分别生成第一图像对应的第一三维矢量信息和所述第二图像对应的第二三维矢量信息的步骤包括:The step of respectively generating the first three-dimensional vector information corresponding to the first image and the second three-dimensional vector information corresponding to the second image includes: 生成所述第一图像中各像素点的所述第一三维矢量信息;generating the first three-dimensional vector information of each pixel in the first image; 生成所述第二图像中各像素点的所述第二三维矢量信息;generating the second three-dimensional vector information of each pixel in the second image; 所述分别生成所述第一图像对应的第一三维矢量信息和所述第二图像对应的第二三维矢量信息的步骤包括:The step of respectively generating the first 3D vector information corresponding to the first image and the second 3D vector information corresponding to the second image includes: 分析出所述第一图像和所述第二图像的重合区域;Analyzing the overlapping area of the first image and the second image; 计算所述第一图像在所述重合区域中每个所述像素点对应的原像点距所述第一摄像头的距离,得到第一距离,并根据每个所述像素点的第一二维坐标和所述第一距离,生成所述第一图像的所述第一三维矢量信息;Calculate the distance between the original image point corresponding to each pixel point of the first image in the overlapping area and the first camera to obtain the first distance, and according to the first two-dimensional of each pixel point Coordinates and the first distance, generating the first three-dimensional vector information of the first image; 计算所述第二图像在所述重合区域中每个所述像素点对应的原像点距所述第二摄像头的距离,得到第二距离,并根据每个所述像素点的第二二维坐标和所述第二距离,生成所述第二图像的所述第二三维矢量信息。Calculate the distance between the original image point corresponding to each pixel point of the second image in the overlapping area and the second camera to obtain a second distance, and according to the second two-dimensional value of each pixel point Coordinates and the second distance to generate the second three-dimensional vector information of the second image. 2.根据权利要求1所述的方法,其特征在于,所述根据得到的所述第一三维矢量信息和所述第二三维矢量信息,通过预定的透视畸变校正算法,对所述第一图像和所述第二图像进行透视畸变校正的步骤包括:2. The method according to claim 1, characterized in that, according to the obtained first three-dimensional vector information and the second three-dimensional vector information, through a predetermined perspective distortion correction algorithm, the first image The step of performing perspective distortion correction with the second image comprises: 根据所述第一三维矢量信息调用预定的第一透视畸变校正参数,并通过所述透视畸变校正算法对所述第一图像的所述重合区域进行透视畸变校正;calling a predetermined first perspective distortion correction parameter according to the first three-dimensional vector information, and performing perspective distortion correction on the overlapped region of the first image through the perspective distortion correction algorithm; 根据所述第二三维矢量信息调用预定的第二透视畸变校正参数,并通过所述透视畸变校正算法对所述第二图像的所述重合区域进行透视畸变校正。Calling a predetermined second perspective distortion correction parameter according to the second three-dimensional vector information, and performing perspective distortion correction on the overlapped region of the second image through the perspective distortion correction algorithm. 3.根据权利要求1~2任一项所述的方法,其特征在于,所述根据得到的所述第一三维矢量信息和所述第二三维矢量信息,通过预定的透视畸变校正算法,对所述第一图像和所述第二图像进行透视畸变校正的步骤之后包括:3. The method according to any one of claims 1-2, characterized in that, according to the obtained first three-dimensional vector information and the second three-dimensional vector information, through a predetermined perspective distortion correction algorithm, the The steps of performing perspective distortion correction on the first image and the second image include: 若接收到图像展示指令,判断所述图像展示指令的类型;If an image display instruction is received, determine the type of the image display instruction; 若所述图像展示指令为二维图像展示指令,则截取出校正后的所述第一图像或所述第二图像中的所述重合区域进行展示;If the image display instruction is a two-dimensional image display instruction, intercepting the corrected first image or the overlapping area in the second image for display; 若所述图像展示指令为三维图像展示指令,则对校正后的所述第一图像和所述第二图像进行三维调制和展示。If the image display instruction is a three-dimensional image display instruction, perform three-dimensional modulation and display on the corrected first image and the second image. 4.一种图像透视畸变校正的系统,其特征在于,应用于包括两个摄像头的拍摄终端,所述系统包括有:4. A system for image perspective distortion correction, characterized in that it is applied to a shooting terminal including two cameras, and the system includes: 图像获取模块,用于通过第一摄像头和第二摄像头同时对被摄物体进行拍摄,获取对应的第一图像和第二图像;An image acquisition module, configured to simultaneously photograph the subject through the first camera and the second camera, and acquire corresponding first images and second images; 信息生成模块,用于分别生成所述第一图像对应的第一三维矢量信息和所述第二图像对应的第二三维矢量信息;an information generating module, configured to generate first three-dimensional vector information corresponding to the first image and second three-dimensional vector information corresponding to the second image; 图像校正模块,用于根据得到的所述第一三维矢量信息和所述第二三维矢量信息,通过预定的透视畸变校正算法,对所述第一图像和所述第二图像进行透视畸变校正;An image correction module, configured to perform perspective distortion correction on the first image and the second image through a predetermined perspective distortion correction algorithm according to the obtained first three-dimensional vector information and the second three-dimensional vector information; 所述信息生成模块包括:The information generation module includes: 第一生成子模块,用于生成所述第一图像中各像素点的所述第一三维矢量信息;A first generating submodule, configured to generate the first three-dimensional vector information of each pixel in the first image; 第二生成子模块,用于生成所述第二图像中各像素点的所述第二三维矢量信息;A second generating submodule, configured to generate the second three-dimensional vector information of each pixel in the second image; 所述信息生成模块包括:The information generation module includes: 区域分析子模块,用于分析出所述第一图像和所述第二图像的重合区域;an area analysis submodule, configured to analyze the overlapping area of the first image and the second image; 所述第一生成子模块,用于计算所述第一图像在所述重合区域中每个所述像素点对应的原像点距所述第一摄像头的距离,得到第一距离,并根据每个所述像素点的第一二维坐标和所述第一距离,生成所述第一图像的所述第一三维矢量信息;The first generation sub-module is used to calculate the distance between the original image point corresponding to each pixel point of the first image in the overlapping area and the first camera to obtain the first distance, and according to each The first two-dimensional coordinates and the first distance of each of the pixel points are used to generate the first three-dimensional vector information of the first image; 所述第二生成子模块,用于计算所述第二图像在所述重合区域中每个所述像素点对应的原像点距所述第二摄像头的距离,得到第二距离,并根据每个所述像素点的第二二维坐标和所述第二距离,生成所述第二图像的所述第二三维矢量信息。The second generation sub-module is used to calculate the distance between the original image point corresponding to each pixel point of the second image in the overlapping area and the second camera to obtain the second distance, and according to each The second two-dimensional coordinates of the pixel points and the second distance are used to generate the second three-dimensional vector information of the second image. 5.根据权利要求4所述的系统,其特征在于,所述图像校正模块包括:5. The system according to claim 4, wherein the image correction module comprises: 第一校正子模块,用于根据所述第一三维矢量信息调用预定的第一透视畸变校正参数,并通过所述透视畸变校正算法对所述第一图像的所述重合区域进行透视畸变校正;The first correction submodule is configured to call a predetermined first perspective distortion correction parameter according to the first three-dimensional vector information, and perform perspective distortion correction on the overlapped region of the first image through the perspective distortion correction algorithm; 第二校正子模块,用于根据所述第二三维矢量信息调用预定的第二透视畸变校正参数,并通过所述透视畸变校正算法对所述第二图像的所述重合区域进行透视畸变校正。The second correcting submodule is configured to call a predetermined second perspective distortion correction parameter according to the second three-dimensional vector information, and perform perspective distortion correction on the overlapped region of the second image through the perspective distortion correction algorithm. 6.根据权利要求4~5任一项所述的系统,其特征在于,还包括:6. The system according to any one of claims 4-5, further comprising: 指令接收模块,用于对所述第一图像和所述第二图像进行透视畸变校正之后,若接收到图像展示指令,判断所述图像展示指令的类型;An instruction receiving module, configured to determine the type of the image display instruction if an image display instruction is received after performing perspective distortion correction on the first image and the second image; 第一展示模块,用于若所述图像展示指令为二维图像展示指令时,截取出校正后的所述第一图像或所述第二图像中的所述重合区域进行展示;The first display module is configured to intercept the corrected first image or the overlapping area in the second image for display if the image display instruction is a two-dimensional image display instruction; 第二展示模块,用于若所述图像展示指令为三维图像展示指令时,对校正后的所述第一图像和所述第二图像进行三维调制和展示。The second display module is configured to perform three-dimensional modulation and display on the corrected first image and the second image if the image display instruction is a three-dimensional image display instruction.
CN201510149800.4A 2015-03-31 2015-03-31 The method and system of perspective image distortion correction Active CN104867113B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510149800.4A CN104867113B (en) 2015-03-31 2015-03-31 The method and system of perspective image distortion correction
PCT/CN2015/080314 WO2016155110A1 (en) 2015-03-31 2015-05-29 Method and system for correcting image perspective distortion

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510149800.4A CN104867113B (en) 2015-03-31 2015-03-31 The method and system of perspective image distortion correction

Publications (2)

Publication Number Publication Date
CN104867113A CN104867113A (en) 2015-08-26
CN104867113B true CN104867113B (en) 2017-11-17

Family

ID=53912930

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510149800.4A Active CN104867113B (en) 2015-03-31 2015-03-31 The method and system of perspective image distortion correction

Country Status (2)

Country Link
CN (1) CN104867113B (en)
WO (1) WO2016155110A1 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105704374B (en) * 2016-01-29 2019-04-05 努比亚技术有限公司 A kind of image conversion apparatus, method and terminal
CN107144241B (en) * 2017-06-09 2019-01-01 大连理工大学 A kind of binocular vision high-precision measuring method based on depth of field compensation
CN109146977A (en) * 2017-06-16 2019-01-04 中兴通讯股份有限公司 Image translation error correcting method, mobile terminal and computer readable storage medium
CN107680060A (en) * 2017-09-30 2018-02-09 努比亚技术有限公司 A kind of image distortion correction method, terminal and computer-readable recording medium
CN107748887A (en) * 2017-09-30 2018-03-02 五邑大学 It is a kind of based on dominant with recessive Line segment detection planar document perspective image antidote
CN108171744A (en) * 2017-12-26 2018-06-15 努比亚技术有限公司 Determining method, mobile terminal and the storage medium of disparity map in a kind of binocular virtualization
CN108197624A (en) * 2018-02-02 2018-06-22 杭州清本科技有限公司 The recognition methods of certificate image rectification and device, computer storage media
JP7346594B2 (en) * 2019-05-24 2023-09-19 オッポ広東移動通信有限公司 User equipment and strabismus correction method
CN110072045B (en) * 2019-05-30 2021-11-09 Oppo广东移动通信有限公司 Lens, camera and electronic equipment
CN117990609B (en) * 2022-11-01 2025-07-11 苏州博众半导体有限公司 Chip detection method, system, device and computer readable storage medium
CN117115144B (en) * 2023-10-18 2024-05-24 深圳市强达电路股份有限公司 Online detection system for hole site defects in PCB
CN118570558B (en) * 2024-07-31 2024-11-22 泉州职业技术大学 Binocular target detection method and system for blind guiding glasses

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102005039A (en) * 2010-08-24 2011-04-06 浙江大学 Fish-eye camera stereo vision depth measuring method based on Taylor series model
CN103065289A (en) * 2013-01-22 2013-04-24 清华大学 Four-ocular video camera front face reconstruction method based on binocular stereo vision
CN103824303A (en) * 2014-03-14 2014-05-28 格科微电子(上海)有限公司 Image perspective distortion adjusting method and device based on position and direction of photographed object
CN104259669A (en) * 2014-09-11 2015-01-07 苏州菲镭泰克激光技术有限公司 Precise three-dimensional curved surface laser marking method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004040395A (en) * 2002-07-02 2004-02-05 Fujitsu Ltd Image distortion correction apparatus, method and program
JP5631229B2 (en) * 2011-01-31 2014-11-26 キヤノン株式会社 Imaging apparatus, control method thereof, and program
CN103077521B (en) * 2013-01-08 2015-08-05 天津大学 A kind of area-of-interest exacting method for video monitoring

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102005039A (en) * 2010-08-24 2011-04-06 浙江大学 Fish-eye camera stereo vision depth measuring method based on Taylor series model
CN103065289A (en) * 2013-01-22 2013-04-24 清华大学 Four-ocular video camera front face reconstruction method based on binocular stereo vision
CN103824303A (en) * 2014-03-14 2014-05-28 格科微电子(上海)有限公司 Image perspective distortion adjusting method and device based on position and direction of photographed object
CN104259669A (en) * 2014-09-11 2015-01-07 苏州菲镭泰克激光技术有限公司 Precise three-dimensional curved surface laser marking method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Correction of Perspective Distortion Image Using Depth Information;Soon-KaK Kown et al.;《Journal of Korea Multimedia Society》;20150228;第18卷(第2期);全文 *
基于畸变校正的双目立体摄像机线性标定;崔莉娟 等;《电子技术应用》;20111231;第37卷(第1期);全文 *

Also Published As

Publication number Publication date
CN104867113A (en) 2015-08-26
WO2016155110A1 (en) 2016-10-06

Similar Documents

Publication Publication Date Title
CN104867113B (en) The method and system of perspective image distortion correction
US10306165B2 (en) Image generating method and dual-lens device
CN110689581B (en) Structured light module calibration method, electronic device, and computer-readable storage medium
US10609282B2 (en) Wide-area image acquiring method and apparatus
CN109474780B (en) Method and device for image processing
KR102143456B1 (en) Depth information acquisition method and apparatus, and image collection device
US11282232B2 (en) Camera calibration using depth data
CN106934777B (en) Scanning image acquisition method and device
US11523056B2 (en) Panoramic photographing method and device, camera and mobile terminal
CN111345029A (en) Target tracking method and device, movable platform and storage medium
CN101630406A (en) Camera calibration method and camera calibration device
JP2017520944A (en) Generation and use of 3D radon images
US12413701B2 (en) Foldable electronic device for multi-view image capture
CN110650288B (en) Focus control method and apparatus, electronic device, computer-readable storage medium
US20160093028A1 (en) Image processing method, image processing apparatus and electronic device
CN103824303A (en) Image perspective distortion adjusting method and device based on position and direction of photographed object
CN115174878B (en) Projection screen correction method, device and storage medium
CN106846395B (en) Method and system for calculating area of target graph in photo
CN112422848B (en) Video stitching method based on depth map and color map
WO2020257999A1 (en) Method, apparatus and platform for image processing, and storage medium
CN116912331A (en) Calibration data generation method, device, electronic equipment and storage medium
CN105227948A (en) A kind of method and device searching distorted region in image
CN114792332B (en) Image registration method and device
CN108377376B (en) Parallax calculation method, double-camera module and electronic equipment
JP2011182084A (en) Image processor and image processing program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20250630

Address after: 215100 Jiangsu Province Suzhou City Xiangcheng District Wangting Town Wangting Street 118 A1 Building 801-10 Room

Patentee after: MoUniverse (Suzhou) Technology Co.,Ltd.

Country or region after: China

Address before: 518040 Guangdong Province Shenzhen City Futian District Che Gong Miao Tian'an Innovation Technology Plaza B812C

Patentee before: COOLPAD SOFTWARE TEC (SHENZHEN) Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right