CN116309041A - Infrared panoramic image stitching method, infrared panoramic monitoring device and electronic equipment - Google Patents
Infrared panoramic image stitching method, infrared panoramic monitoring device and electronic equipment Download PDFInfo
- Publication number
- CN116309041A CN116309041A CN202211578132.3A CN202211578132A CN116309041A CN 116309041 A CN116309041 A CN 116309041A CN 202211578132 A CN202211578132 A CN 202211578132A CN 116309041 A CN116309041 A CN 116309041A
- Authority
- CN
- China
- Prior art keywords
- image
- infrared
- point
- coordinate
- coordinate system
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4038—Image mosaicing, e.g. composing plane images from plane sub-images
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
Abstract
Description
技术领域technical field
本发明涉及图像处理技术领域,特别涉及一种红外全景图像拼接方法、红外全景监控装置和电子设备。The invention relates to the technical field of image processing, in particular to an infrared panoramic image splicing method, an infrared panoramic monitoring device and electronic equipment.
背景技术Background technique
现有的红外全景图像生成技术往往通过获得多张红外图像,将所有的红外图像进行拼接融合得到红外全景图像。The existing infrared panoramic image generation technology often obtains multiple infrared images, and stitches and fuses all the infrared images to obtain an infrared panoramic image.
然而,现有的红外全景图像生成技术存在数据运算量大、图像拼接速度慢的问题。However, the existing infrared panoramic image generation technology has the problems of large amount of data calculation and slow image stitching speed.
发明内容Contents of the invention
本发明旨在至少解决现有技术中存在的技术问题之一。为此,本发明提出一种红外全景图像拼接方法、红外全景监控装置和电子设备,能够解决现有的红外全景图像生成技术数据运算量大、图像拼接速度慢的问题。The present invention aims to solve at least one of the technical problems existing in the prior art. Therefore, the present invention proposes an infrared panoramic image mosaic method, an infrared panoramic monitoring device and electronic equipment, which can solve the problems of large data computation and slow image mosaic speed in the existing infrared panoramic image generation technology.
根据本发明第一方面实施例的红外全景图像拼接方法,包括:获得各个相机拍摄的红外图像;建立与各个所述相机对应的相机坐标系,以各个所述相机坐标系的原点的重心作为原点,建立世界坐标系;以所述世界坐标系的原点作为球心,以r为半径,建立球面,所述r为对所述相机标定获得;在所述世界坐标系内建立输出平面,获取所述输出平面上的点与所述球面上的点的映射关系,根据所述映射关系,得到第一坐标,所述第一坐标为球面映射点在所述世界坐标系内的坐标,所述球面映射点为与所述输出平面的点对应的所述球面上的点;获取所述世界坐标系和相机坐标系的RT关系,根据所述RT关系,将第一坐标转换为第二坐标,所述第二坐标为所述球面映射点坐标在相机坐标系中的坐标点,所述RT关系为所述世界坐标系和所述相机坐标系的坐标转换关系;将所述第二坐标转换为像素坐标点,将所述像素坐标点对应的所述红外图像的像素值作为目标像素值,所述目标像素值为所述输出平面的点的像素值,获得红外全景图像。The infrared panoramic image stitching method according to the embodiment of the first aspect of the present invention includes: obtaining infrared images taken by each camera; establishing a camera coordinate system corresponding to each of the cameras, and taking the center of gravity of the origin of each of the camera coordinate systems as the origin , establish a world coordinate system; use the origin of the world coordinate system as the center of the sphere, and use r as the radius to establish a spherical surface, and the r is obtained by calibrating the camera; establish an output plane in the world coordinate system, and obtain all The mapping relationship between the points on the output plane and the points on the spherical surface, according to the mapping relationship, the first coordinates are obtained, and the first coordinates are the coordinates of the spherical surface mapping points in the world coordinate system, and the spherical surface The mapping point is a point on the spherical surface corresponding to the point on the output plane; the RT relationship between the world coordinate system and the camera coordinate system is obtained, and the first coordinate is converted into a second coordinate according to the RT relationship, so The second coordinate is the coordinate point of the spherical mapping point coordinates in the camera coordinate system, and the RT relationship is the coordinate conversion relationship between the world coordinate system and the camera coordinate system; the second coordinate is converted into a pixel A coordinate point, using the pixel value of the infrared image corresponding to the pixel coordinate point as a target pixel value, and the target pixel value is a pixel value of a point on the output plane to obtain an infrared panoramic image.
根据本发明第一方面实施例的红外全景图像拼接方法,至少具有如下有益效果:The infrared panoramic image stitching method according to the embodiment of the first aspect of the present invention has at least the following beneficial effects:
通过获得各个相机拍摄的红外图像,建立与各个相机对应的相机坐标系,以各个相机坐标系的原点的重心作为原点,建立世界坐标系,以世界坐标系的原点作为球心,建立球面,在世界坐标系内建立输出平面,获取输出平面上的点与球面上的点的映射关系,根据映射关系,得到第一坐标,第一坐标为球面映射点在世界坐标系内的坐标,球面映射点为与输出平面的点对应的球面上的点,获取世界坐标系和相机坐标系的RT关系,根据RT关系,将第一坐标转换为第二坐标,第二坐标为球面映射点坐标在相机坐标系中的坐标点,RT关系为世界坐标系和相机坐标系的坐标转换关系,将第二坐标转换为像素坐标点,将像素坐标点对应的红外图像的像素值作为目标像素值,目标像素值为输出平面的点的像素值,获得红外全景图像,仅计算输出平面上各点对应的像素值,不用对所有的红外图像的数据进行处理计算,减少了数据运算量,图像拼接速度快。By obtaining the infrared images taken by each camera, the camera coordinate system corresponding to each camera is established, and the center of gravity of the origin of each camera coordinate system is used as the origin to establish the world coordinate system, and the origin of the world coordinate system is used as the center of the sphere to establish a spherical surface. The output plane is established in the world coordinate system, and the mapping relationship between the points on the output plane and the points on the spherical surface is obtained. According to the mapping relationship, the first coordinate is obtained. The first coordinate is the coordinate of the spherical mapping point in the world coordinate system, and the spherical mapping point For the point on the spherical surface corresponding to the point on the output plane, obtain the RT relationship between the world coordinate system and the camera coordinate system. According to the RT relationship, convert the first coordinate to the second coordinate. The second coordinate is the coordinate of the spherical mapping point in the camera coordinate The coordinate point in the system, the RT relationship is the coordinate conversion relationship between the world coordinate system and the camera coordinate system, convert the second coordinate into a pixel coordinate point, and use the pixel value of the infrared image corresponding to the pixel coordinate point as the target pixel value, and the target pixel value In order to obtain the infrared panoramic image by outputting the pixel values of the points on the plane, only the pixel values corresponding to each point on the output plane are calculated, and there is no need to process and calculate all the infrared image data, which reduces the amount of data calculation, and the image splicing speed is fast.
根据本发明的一些实施例,所述获取所述输出平面上的点与所述球面上的点的映射关系,根据所述映射关系,得到第一坐标,所述第一坐标为球面映射点在所述世界坐标系内的坐标,所述球面映射点为与所述输出平面的点对应的所述球面上的点,包括:获取所述输出平面的四个顶点P1、P2、P3和P4在所述世界坐标系内的坐标;对所述P1、所述P2、所述P3和所述P4之间进行等间隔采样,获得所述输出平面上各点在所述世界坐标系内的坐标;将所述输出平面上各点投影到所述球面,根据所述输出平面上的各点与所述球面的投影关系,得到所述第一坐标。According to some embodiments of the present invention, the acquisition of the mapping relationship between the points on the output plane and the points on the spherical surface, and according to the mapping relationship, the first coordinates are obtained, and the first coordinates are the spherical mapping points at Coordinates in the world coordinate system, the spherical mapping point is a point on the spherical surface corresponding to the point of the output plane, including: obtaining the four vertices P1, P2, P3 and P4 of the output plane in coordinates in the world coordinate system; sampling at equal intervals between the P1, the P2, the P3, and the P4 to obtain the coordinates of each point on the output plane in the world coordinate system; Projecting each point on the output plane to the spherical surface, and obtaining the first coordinates according to a projection relationship between each point on the output plane and the spherical surface.
根据本发明的一些实施例,所述获取所述输出平面上的点与所述球面上的点的映射关系,根据所述映射关系,得到第一坐标,所述第一坐标为球面映射点在所述世界坐标系内的坐标,所述球面映射点为与所述输出平面的点对应的所述球面上的点,包括:在所述输出平面上取N个纵线和M个横线,N个所述纵线将所述输出平面横向等分,M个所述横线将所述输出平面纵向等分,N个所述纵线和M个所述横线形成N*M个第一交叉点;在所述球面上取N个经线和M个纬线,N个所述经线将所述球面横向等分,M个所述横线将所述球面纵向等分,N个所述经线和M个所述纬线形成N*M个第二交叉点;将N*M个所述第一交叉点与N*M所述第二交叉点依序一一对应,得到所述第一坐标。According to some embodiments of the present invention, the acquisition of the mapping relationship between the points on the output plane and the points on the spherical surface, and according to the mapping relationship, the first coordinates are obtained, and the first coordinates are the spherical mapping points at Coordinates in the world coordinate system, the spherical mapping point is a point on the spherical surface corresponding to the point on the output plane, including: taking N vertical lines and M horizontal lines on the output plane, The N vertical lines divide the output plane horizontally, the M horizontal lines divide the output plane vertically, and the N vertical lines and the M horizontal lines form N*M first Intersection; N warps and M latitudes are taken on the spherical surface, N said longitudes divide the spherical surface equally horizontally, M said transverse lines divide the spherical surface vertically equally, N said longitudes and The M parallels form N*M second intersection points; and the N*M first intersection points are sequentially and one-to-one corresponding to the N*M second intersection points to obtain the first coordinates.
根据本发明的一些实施例,所述获取所述输出平面上的点与所述球面上的点的映射关系,根据所述映射关系,得到第一坐标,所述第一坐标为球面映射点在所述世界坐标系内的坐标,所述球面映射点为与所述输出平面的点对应的所述球面上的点,包括:在球面内建立内接圆平面,所述内接圆平面的半径与所述球面的半径相同,所述内接圆平面的外接正方形平面为所述输出平面;获取所述内接圆平面各点在所述世界坐标系内的坐标,即所述外接正方形平面与所述内接圆平面的交点在所述世界坐标系内的坐标,得到所述第一坐标。According to some embodiments of the present invention, the acquisition of the mapping relationship between the points on the output plane and the points on the spherical surface, and according to the mapping relationship, the first coordinates are obtained, and the first coordinates are the spherical mapping points at Coordinates in the world coordinate system, the spherical mapping point is a point on the spherical surface corresponding to the point of the output plane, including: establishing an inscribed circular plane in the spherical surface, and the radius of the inscribed circular plane The same as the radius of the spherical surface, the circumscribed square plane of the inscribed circle plane is the output plane; obtain the coordinates of each point of the inscribed circle plane in the world coordinate system, that is, the circumscribed square plane and The coordinates of the intersection point of the inscribed circle plane in the world coordinate system are obtained to obtain the first coordinates.
根据本发明的一些实施例,将所述像素坐标点对应的所述红外图像的像素值作为目标像素值,所述目标像素值为所述输出平面的点的像素值,获得红外全景图像,包括:将所有所述像素坐标点对应的各个所述红外图像的重合区域进行图像融合,得到目标红外图像,所述重合区域内各个所述像素坐标点对应多张所述红外图像的像素值;将所述像素坐标点对应的所述目标红外图像的像素值作为目标像素值,所述目标像素值为所述输出平面的点的像素值,获得红外全景图像。According to some embodiments of the present invention, the pixel value of the infrared image corresponding to the pixel coordinate point is used as a target pixel value, and the target pixel value is a pixel value of a point on the output plane to obtain an infrared panoramic image, including : performing image fusion on overlapping areas of each of the infrared images corresponding to all the pixel coordinate points to obtain a target infrared image, and each of the pixel coordinate points in the overlapping area corresponds to a plurality of pixel values of the infrared images; The pixel value of the target infrared image corresponding to the pixel coordinate point is used as a target pixel value, and the target pixel value is a pixel value of a point on the output plane to obtain an infrared panoramic image.
根据本发明的一些实施例,所述将所有所述像素坐标点对应的各个所述红外图像的重合区域进行图像融合,得到目标红外图像,包括:获取所述红外图像对应的微光图像;对所述微光图像和所述红外图像进行增强处理得到过渡微光图像和过渡红外图像;对所述过渡微光图像和所述过渡红外图像进行融合得到增强红外图像;将所有所述像素坐标点对应的各个所述增强红外图像的重合区域进行图像融合,得到目标红外图像。According to some embodiments of the present invention, performing image fusion on overlapping areas of the infrared images corresponding to all the pixel coordinate points to obtain the target infrared image includes: acquiring a low-light image corresponding to the infrared image; The low-light image and the infrared image are enhanced to obtain a transitional low-light image and a transitional infrared image; the transitional low-light image and the transitional infrared image are fused to obtain an enhanced infrared image; all the pixel coordinate points Image fusion is performed on overlapping areas of corresponding enhanced infrared images to obtain a target infrared image.
根据本发明的一些实施例,所述对所述微光图像和所述红外图像进行增强处理得到过渡微光图像和过渡红外图像,包括以下步骤:预设gamma查找表;根据所述gamma查找表,将所述微光图像的像素值映射到对应的gamma校正像素值得到过渡微光图像;根据所述gamma查找表,将所述红外图像的像素值映射到对应的gamma校正像素值得到过渡红外图像。According to some embodiments of the present invention, said enhancing the low-light image and the infrared image to obtain the transitional low-light image and the transitional infrared image comprises the following steps: preset a gamma lookup table; according to the gamma lookup table , mapping the pixel value of the low-light image to the corresponding gamma-corrected pixel value to obtain a transitional low-light image; according to the gamma lookup table, mapping the pixel value of the infrared image to the corresponding gamma-corrected pixel value to obtain a transitional infrared image.
根据本发明的一些实施例,对所述过渡微光图像和所述过渡红外图像进行融合得到增强红外图像,包括:将所述过渡微光图像分解成基础层图像和细节层图像;将所述过渡红外图像分解成基础层图像和细节层图像;对所述过渡微光图像的所述基础层图像和所述过渡红外图像的所述基础层图像进行融合得到目标基础层图像;对所述过渡微光图像的所述细节层图像和所述过渡红外图像的所述细节层图像融合得到目标细节层图像;对所述目标基础层图像和所述目标细节层图像进行重构得到红外全景图像。According to some embodiments of the present invention, fusing the transitional low-light image and the transitional infrared image to obtain an enhanced infrared image includes: decomposing the transitional low-light image into a base layer image and a detail layer image; The transition infrared image is decomposed into a base layer image and a detail layer image; the base layer image of the transition low-light image and the base layer image of the transition infrared image are fused to obtain a target base layer image; the transition The detail layer image of the low-light image and the detail layer image of the transition infrared image are fused to obtain a target detail layer image; the target base layer image and the target detail layer image are reconstructed to obtain an infrared panoramic image.
根据本发明第二方面实施例的红外全景监控装置,包括:相机,所述相机用于采集多个角度的微光图像和红外图像;The infrared panoramic monitoring device according to the embodiment of the second aspect of the present invention includes: a camera, the camera is used to collect low-light images and infrared images from multiple angles;
图像处理模块,所述相机的输出端连接所述图像处理模块的输入端,所述图像处理模块执行如上述的红外全景图像拼接方法;An image processing module, the output end of the camera is connected to the input end of the image processing module, and the image processing module executes the above-mentioned infrared panoramic image stitching method;
通信模块,所述图像处理模块的输出端连接所述通信模块的输入端,所述通信模块用于将所述红外全景图像传输至主机端。A communication module, the output end of the image processing module is connected to the input end of the communication module, and the communication module is used to transmit the infrared panoramic image to the host end.
根据本发明第二方面实施例的红外全景监控装置,至少具有如下有益效果:The infrared panoramic monitoring device according to the embodiment of the second aspect of the present invention has at least the following beneficial effects:
通过获得各个相机拍摄的红外图像,建立与各个相机对应的相机坐标系,以各个相机坐标系的原点的重心作为原点,建立世界坐标系,以世界坐标系的原点作为球心,建立球面,在世界坐标系内建立输出平面,获取输出平面上的点与球面上的点的映射关系,根据映射关系,得到第一坐标,第一坐标为球面映射点在世界坐标系内的坐标,球面映射点为与输出平面的点对应的球面上的点,获取世界坐标系和相机坐标系的RT关系,根据RT关系,将第一坐标转换为第二坐标,第二坐标为球面映射点坐标在相机坐标系中的坐标点,RT关系为世界坐标系和相机坐标系的坐标转换关系,将第二坐标转换为像素坐标点,将像素坐标点对应的红外图像的像素值作为目标像素值,目标像素值为输出平面的点的像素值,获得红外全景图像,仅计算输出平面上各点对应的像素值,不用对所有的红外图像的数据进行处理计算,减少了数据运算量,图像拼接速度快。By obtaining the infrared images taken by each camera, the camera coordinate system corresponding to each camera is established, and the center of gravity of the origin of each camera coordinate system is used as the origin to establish the world coordinate system, and the origin of the world coordinate system is used as the center of the sphere to establish a spherical surface. The output plane is established in the world coordinate system, and the mapping relationship between the points on the output plane and the points on the spherical surface is obtained. According to the mapping relationship, the first coordinate is obtained. The first coordinate is the coordinate of the spherical mapping point in the world coordinate system, and the spherical mapping point For the point on the spherical surface corresponding to the point on the output plane, obtain the RT relationship between the world coordinate system and the camera coordinate system. According to the RT relationship, convert the first coordinate to the second coordinate. The second coordinate is the coordinate of the spherical mapping point in the camera coordinate The coordinate point in the system, the RT relationship is the coordinate conversion relationship between the world coordinate system and the camera coordinate system, convert the second coordinate into a pixel coordinate point, and use the pixel value of the infrared image corresponding to the pixel coordinate point as the target pixel value, and the target pixel value In order to obtain the infrared panoramic image by outputting the pixel values of the points on the plane, only the pixel values corresponding to each point on the output plane are calculated, and there is no need to process and calculate all the infrared image data, which reduces the amount of data calculation, and the image splicing speed is fast.
根据本发明第三方面实施例的一种电子设备,包括:至少一个处理器;至少一个存储器,用于存储至少一个程序;当至少一个所述程序被至少一个所述处理器执行时实现如上述的红外全景图像拼接方法。An electronic device according to the embodiment of the third aspect of the present invention includes: at least one processor; at least one memory for storing at least one program; when at least one of the programs is executed by at least one of the processors, the above-mentioned Infrared panoramic image stitching method.
根据本发明第三方面实施例的一种电子设备,至少具有如下有益效果:An electronic device according to an embodiment of the third aspect of the present invention has at least the following beneficial effects:
通过获得各个相机拍摄的红外图像,建立与各个相机对应的相机坐标系,以各个相机坐标系的原点的重心作为原点,建立世界坐标系,以世界坐标系的原点作为球心,建立球面,在世界坐标系内建立输出平面,获取输出平面上的点与球面上的点的映射关系,根据映射关系,得到第一坐标,第一坐标为球面映射点在世界坐标系内的坐标,球面映射点为与输出平面的点对应的球面上的点,获取世界坐标系和相机坐标系的RT关系,根据RT关系,将第一坐标转换为第二坐标,第二坐标为球面映射点坐标在相机坐标系中的坐标点,RT关系为世界坐标系和相机坐标系的坐标转换关系,将第二坐标转换为像素坐标点,将像素坐标点对应的红外图像的像素值作为目标像素值,目标像素值为输出平面的点的像素值,获得红外全景图像,仅计算输出平面上各点对应的像素值,不用对所有的红外图像的数据进行处理计算,减少了数据运算量,图像拼接速度快。By obtaining the infrared images taken by each camera, the camera coordinate system corresponding to each camera is established, and the center of gravity of the origin of each camera coordinate system is used as the origin to establish the world coordinate system, and the origin of the world coordinate system is used as the center of the sphere to establish a spherical surface. The output plane is established in the world coordinate system, and the mapping relationship between the points on the output plane and the points on the spherical surface is obtained. According to the mapping relationship, the first coordinate is obtained. The first coordinate is the coordinate of the spherical mapping point in the world coordinate system, and the spherical mapping point For the point on the spherical surface corresponding to the point on the output plane, obtain the RT relationship between the world coordinate system and the camera coordinate system. According to the RT relationship, convert the first coordinate to the second coordinate. The second coordinate is the coordinate of the spherical mapping point in the camera coordinate The coordinate point in the system, the RT relationship is the coordinate conversion relationship between the world coordinate system and the camera coordinate system, convert the second coordinate into a pixel coordinate point, and use the pixel value of the infrared image corresponding to the pixel coordinate point as the target pixel value, and the target pixel value In order to obtain the infrared panoramic image by outputting the pixel values of the points on the plane, only the pixel values corresponding to each point on the output plane are calculated, and there is no need to process and calculate all the infrared image data, which reduces the amount of data calculation, and the image splicing speed is fast.
本发明的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。Additional aspects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
附图说明Description of drawings
下面结合附图和实施例对本发明做进一步的说明,其中:The present invention will be further described below in conjunction with accompanying drawing and embodiment, wherein:
图1为本发明的红外全景图像拼接方法的流程图;Fig. 1 is the flowchart of the infrared panoramic image mosaic method of the present invention;
图2为本发明的红外全景图像拼接方法的获取输出平面上的点与球面上的点的映射关系,根据映射关系,得到第一坐标的流程图a;Fig. 2 is the mapping relationship between the points on the acquisition output plane and the points on the spherical surface obtained by the infrared panoramic image stitching method of the present invention, according to the mapping relationship, the flow chart a of the first coordinate is obtained;
图3为本发明的红外全景图像拼接方法的获取输出平面上的点与球面上的点的映射关系,根据映射关系,得到第一坐标的流程图b;Fig. 3 is the mapping relationship between the points on the acquisition output plane and the points on the spherical surface obtained by the infrared panoramic image stitching method of the present invention, according to the mapping relationship, the flow chart b of the first coordinate is obtained;
图4为本发明的红外全景图像拼接方法的获取输出平面上的点与球面上的点的映射关系,根据映射关系,得到第一坐标的流程图c;Fig. 4 is the mapping relationship between the points on the acquisition output plane and the points on the spherical surface obtained by the infrared panoramic image stitching method of the present invention, according to the mapping relationship, the flow chart c of the first coordinate is obtained;
图5为本发明的红外全景图像拼接方法的将像素坐标点对应的红外图像的像素值作为目标像素值,目标像素值为输出平面的点的像素值,获得红外全景图像的流程图;Fig. 5 is the flow chart of obtaining the infrared panoramic image by using the pixel value of the infrared image corresponding to the pixel coordinate point as the target pixel value in the infrared panoramic image splicing method of the present invention, and the target pixel value is the pixel value of the point of the output plane;
图6为本发明的红外全景图像拼接方法的将所有像素坐标点对应的各个红外图像的重合区域进行图像融合,得到目标红外图像的流程图;Fig. 6 is a flow chart of the infrared panoramic image mosaic method of the present invention that performs image fusion on overlapping areas of the respective infrared images corresponding to all pixel coordinate points to obtain the target infrared image;
图7为本发明的红外全景图像拼接方法的输出平面上第一红外图像和第二红外图像的位置关系图;FIG. 7 is a positional diagram of the first infrared image and the second infrared image on the output plane of the infrared panoramic image stitching method of the present invention;
图8为本发明的红外全景监控装置的功能框图。Fig. 8 is a functional block diagram of the infrared panoramic monitoring device of the present invention.
附图标记:Reference signs:
相机100、
图像处理模块200、
通信模块300。
具体实施方式Detailed ways
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本发明,而不能理解为对本发明的限制。Embodiments of the present invention are described in detail below, examples of which are shown in the drawings, wherein the same or similar reference numerals designate the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the figures are exemplary only for explaining the present invention and should not be construed as limiting the present invention.
在本发明的描述中,需要理解的是,涉及到方位描述,例如上、下等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。In the description of the present invention, it should be understood that when it comes to orientation descriptions, for example, the orientation or positional relationship indicated by up, down, etc. is based on the orientation or positional relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description , rather than indicating or implying that the device or element referred to must have a particular orientation, be constructed and operate in a particular orientation, and thus should not be construed as limiting the invention.
在本发明的描述中,多个指的是两个以上。如果有描述到第一、第二只是用于区分技术特征为目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量或者隐含指明所指示的技术特征的先后关系。In the description of the present invention, a plurality refers to two or more. If the description of the first and second is only for the purpose of distinguishing the technical features, it cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features relation.
本发明的描述中,除非另有明确的限定,设置、安装、连接等词语应做广义理解,所属技术领域技术人员可以结合技术方案的具体内容合理确定上述词语在本发明中的具体含义。In the description of the present invention, unless otherwise clearly defined, words such as setting, installation, and connection should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above words in the present invention in combination with the specific content of the technical solution.
下面参照图1至图8描述根据本发明实施例的一种红外全景图像拼接方法、红外全景监控装置和电子设备。An infrared panoramic image stitching method, an infrared panoramic monitoring device and electronic equipment according to an embodiment of the present invention will be described below with reference to FIGS. 1 to 8 .
如图1所示,根据本发明第一方面实施例的红外全景图像拼接方法,包括以下步骤:As shown in Figure 1, the infrared panoramic image stitching method according to the embodiment of the first aspect of the present invention includes the following steps:
S100、获得各个相机100拍摄的红外图像;S100. Obtain infrared images taken by each
S200、建立与各个相机100对应的相机坐标系,以各个相机坐标系的原点的重心作为原点,建立世界坐标系;S200. Establish a camera coordinate system corresponding to each
S300、以世界坐标系的原点作为球心,以r为半径,建立球面,r为对相机100标定获得;S300. Taking the origin of the world coordinate system as the center of the sphere and taking r as the radius to establish a spherical surface, where r is obtained by calibrating the
S400、在世界坐标系内建立输出平面,获取输出平面上的点与球面上的点的映射关系,根据映射关系,得到第一坐标,第一坐标为球面映射点在世界坐标系内的坐标,球面映射点为与输出平面的点对应的球面上的点;S400. Establish an output plane in the world coordinate system, obtain the mapping relationship between the points on the output plane and the points on the spherical surface, and obtain the first coordinate according to the mapping relationship. The first coordinate is the coordinate of the spherical surface mapping point in the world coordinate system, Spherical mapping points are points on the sphere corresponding to points on the output plane;
S500、获取世界坐标系和相机坐标系的RT关系,根据RT关系,将第一坐标转换为第二坐标,第二坐标为球面映射点坐标在相机坐标系中的坐标点,RT关系为世界坐标系和相机坐标系的坐标转换关系;S500. Obtain the RT relationship between the world coordinate system and the camera coordinate system, and convert the first coordinate into a second coordinate according to the RT relationship. The second coordinate is the coordinate point of the spherical mapping point coordinate in the camera coordinate system, and the RT relationship is the world coordinate. The coordinate transformation relationship between the camera coordinate system and the camera coordinate system;
S600、将第二坐标转换为像素坐标点,将像素坐标点对应的红外图像的像素值作为目标像素值,目标像素值为输出平面的点的像素值,获得红外全景图像。S600. Convert the second coordinates into pixel coordinate points, use the pixel value of the infrared image corresponding to the pixel coordinate point as a target pixel value, and the target pixel value is a pixel value of a point on an output plane, to obtain an infrared panoramic image.
通过获得各个相机100拍摄的红外图像,建立与各个相机100对应的相机坐标系,以各个相机坐标系的原点的重心作为原点,建立世界坐标系,以世界坐标系的原点作为球心,建立球面,在世界坐标系内建立输出平面,获取输出平面上的点与球面上的点的映射关系,根据映射关系,得到第一坐标,第一坐标为球面映射点在世界坐标系内的坐标,球面映射点为与输出平面的点对应的球面上的点,获取世界坐标系和相机坐标系的RT关系,根据RT关系,将第一坐标转换为第二坐标,第二坐标为球面映射点坐标在相机坐标系中的坐标点,RT关系为世界坐标系和相机坐标系的坐标转换关系,将第二坐标转换为像素坐标点,将像素坐标点对应的红外图像的像素值作为目标像素值,目标像素值为输出平面的点的像素值,获得红外全景图像,仅计算输出平面上各点对应的像素值,不用对所有的红外图像的数据进行处理计算,减少了数据运算量,图像拼接速度快。By obtaining the infrared images taken by each
在本发明的一些实施例中,确定世界坐标系原点(x0,y0,z0)的方法为:选取一个相机100的相机坐标系为过渡世界坐标系,然后根据中央相机100与其它相机100的RT关系,将其余相机100的相机坐标系的原点通过以下计算公式转换到过渡世界坐标系中:In some embodiments of the present invention, the method for determining the origin (x0, y0, z0) of the world coordinate system is: select the camera coordinate system of one
[X,Y,Z]·R·T=[X′,Y′,Z′][X, Y, Z] · R · T = [X', Y', Z']
其中,[X,Y,Z]为各相机坐标系的原点坐标,[X′,Y′,Z′]为各相机坐标系的原点坐标在过渡世界坐标系中的坐标,其中,R为旋转矩阵,T为平移向量;Among them, [X, Y, Z] are the origin coordinates of each camera coordinate system, [X′, Y′, Z′] are the coordinates of the origin coordinates of each camera coordinate system in the transition world coordinate system, where R is the rotation Matrix, T is the translation vector;
通过以下计算公式对所有相机坐标系的原点在过渡世界坐标系中的坐标求重心:Use the following calculation formula to find the center of gravity for the coordinates of the origin of all camera coordinate systems in the transition world coordinate system:
其中,N为相机100的个数,XOW为重心的X轴坐标,YOW为重心的Y轴坐标,ZOW为重心的Z轴坐标,以重心的坐标(XOW,YOw,ZOw)作为原点,建立世界坐标系。Wherein, N is the number of
如图2所示,在本发明的一些实施例,步骤S400中,获取输出平面上的点与球面上的点的映射关系,映射关系为直线投影映射关系,根据直线投影映射关系,得到第一坐标,第一坐标为球面映射点在世界坐标系内的坐标,球面映射点为与输出平面的点对应的球面上的点,包括以下步骤:As shown in Figure 2, in some embodiments of the present invention, in step S400, the mapping relationship between points on the output plane and points on the spherical surface is obtained, and the mapping relationship is a linear projection mapping relationship. According to the linear projection mapping relationship, the first Coordinates, the first coordinate is the coordinate of the spherical mapping point in the world coordinate system, the spherical mapping point is the point on the spherical surface corresponding to the point of the output plane, including the following steps:
S410、获取输出平面的四个顶点P1、P2、P3和P4在世界坐标系内的坐标;S410. Obtain the coordinates of the four vertices P1, P2, P3 and P4 of the output plane in the world coordinate system;
S420、对P1、P2、P3和P4之间进行等间隔采样,获得输出平面上各点在世界坐标系内的坐标;S420. Sampling at equal intervals among P1, P2, P3, and P4 to obtain the coordinates of each point on the output plane in the world coordinate system;
S430、将输出平面上各点投影到球面,根据输出平面上的各点与球面的投影关系,得到第一坐标。S430. Project each point on the output plane to a spherical surface, and obtain a first coordinate according to a projection relationship between each point on the output plane and the spherical surface.
在本发明的一些实施例中,假定输出平面的垂直视角宽度为2β,水平视角宽度为2α,初始状态下P1,P2,P3,P4各点在世界坐标系内的坐标如下:In some embodiments of the present invention, it is assumed that the vertical viewing angle width of the output plane is 2β, and the horizontal viewing angle width is 2α. In the initial state, the coordinates of each point P1, P2, P3, and P4 in the world coordinate system are as follows:
其中pw1为P1在世界坐标系内的坐标,pw2为P2在世界坐标系内的坐标,pw3为P3在世界坐标系内的坐标,Pw4为P4在世界坐标系内的坐标,r为球面半径,r的最优值可在相机100立体标定时求得(相机100至棋盘距离),也可作为参数手动设置(即设置拼接距离)。Among them, p w1 is the coordinate of P1 in the world coordinate system, p w2 is the coordinate of P2 in the world coordinate system, p w3 is the coordinate of P3 in the world coordinate system, P w4 is the coordinate of P4 in the world coordinate system, r is the radius of the spherical surface, and the optimal value of r can be obtained during stereo calibration of the camera 100 (the distance from the
用户需设置输出平面的显示分辨率(水平分辨率/垂直分辨率),设置完输出平面的显示分辨率后,可对世界坐标系中Pw1、Pw2、Pw3、Pw4构成的输出平面进行图像输出,为了求得整个输出平面上的坐标点在世界坐标系的坐标,对Pw1、Pw2、pw3、pw4四点间按照Δx,Δy,Δz进行等间隔采样,量化得到输出平面上所有点在世界坐标系的坐标。The user needs to set the display resolution of the output plane (horizontal resolution/vertical resolution). After setting the display resolution of the output plane, the output plane composed of P w1 , P w2 , P w3 , and P w4 in the world coordinate system can be For image output, in order to obtain the coordinates of the coordinate points on the entire output plane in the world coordinate system, the four points P w1 , P w2 , p w3 , and p w4 are sampled at equal intervals according to Δx, Δy, and Δz, and quantized to obtain the output The coordinates of all points on the plane in the world coordinate system.
当用户调整姿态角,如依次绕X轴、Y轴和Z轴旋转角度ψ,Φ和θ时,总的旋转矩阵R等于各旋转矩阵的乘积:When the user adjusts the attitude angle, such as rotating the angles ψ, Φ, and θ around the X-axis, Y-axis, and Z-axis in turn, the total rotation matrix R is equal to the product of each rotation matrix:
R=R(ψ)·R(Φ)·R(θ)R=R(ψ)·R(Φ)·R(θ)
其中,R(ψ)为绕X轴的旋转矩阵,R(Φ)为绕Y轴的旋转矩阵,R(θ)为绕Z轴的旋转矩阵。Among them, R(ψ) is the rotation matrix around the X axis, R(Φ) is the rotation matrix around the Y axis, and R(θ) is the rotation matrix around the Z axis.
根据总的旋转矩阵可以求得pw1、pw2、Pw3、Pw4在姿态角度变换后的坐标。The coordinates of p w1 , p w2 , P w3 , and P w4 after attitude angle transformation can be obtained according to the total rotation matrix.
将输出平面内所有点投影到球面,通过如下计算公式求得对应的球面上的点在世界坐标系内的坐标,得到第一坐标(XW,YW,ZW):Project all points in the output plane to the spherical surface, and obtain the coordinates of the points on the corresponding spherical surface in the world coordinate system through the following calculation formula, and obtain the first coordinates (X W , Y W , Z W ):
其中,Xp为输出平面上的点在世界坐标系内的X轴坐标,Yp为输出平面上的点在世界坐标系内的Y轴坐标,Zp为输出平面上的点在世界坐标系内的Z轴坐标。Among them, X p is the X-axis coordinate of the point on the output plane in the world coordinate system, Y p is the Y-axis coordinate of the point on the output plane in the world coordinate system, Z p is the point on the output plane in the world coordinate system The Z-axis coordinates within.
根据世界坐标系与各个相机坐标系的RT关系求得第二坐标。The second coordinates are obtained according to the RT relationship between the world coordinate system and each camera coordinate system.
如图3所示,在本发明的一些实施例,步骤S400中,根据本发明的一些实施例,获取输出平面上的点与球面上的点的映射关系,映射关系为等距圆柱投影映射关系,根据距圆柱投影映射关系,得到第一坐标,第一坐标为球面映射点在世界坐标系内的坐标,球面映射点为与输出平面的点对应的球面上的点,包括:As shown in Figure 3, in some embodiments of the present invention, in step S400, according to some embodiments of the present invention, the mapping relationship between points on the output plane and points on the spherical surface is obtained, and the mapping relationship is an equidistant cylindrical projection mapping relationship , according to the mapping relationship from the cylindrical projection, the first coordinate is obtained. The first coordinate is the coordinate of the spherical mapping point in the world coordinate system. The spherical mapping point is the point on the spherical surface corresponding to the point of the output plane, including:
S410、在输出平面上取N个纵线和M个横线,N个纵线将输出平面横向等分,M个横线将输出平面纵向等分,N个纵线和M个横线形成N*M个第一交叉点;S410. Take N vertical lines and M horizontal lines on the output plane, the N vertical lines divide the output plane into equal parts horizontally, the M horizontal lines divide the output plane into equal parts vertically, and the N vertical lines and M horizontal lines form N *M first intersection points;
S420、在球面上取N个经线和M个纬线,N个经线将球面横向等分,M个横线将球面纵向等分,N个经线和M个纬线形成N*M个第二交叉点;S420. Take N meridians and M latitude lines on the spherical surface, the N meridians divide the spherical surface into equal parts horizontally, the M horizontal lines divide the spherical surface into equal parts longitudinally, and the N meridians and M latitude lines form N*M second intersection points;
S430、将N*M个第一交叉点与N*M第二交叉点依序一一对应,得到第一坐标。S430. Sequentially make one-to-one correspondence between the N*M first intersection points and the N*M second intersection points, to obtain first coordinates.
如图4所示,在本发明的一些实施例,步骤S400中,获取输出平面上的点与球面上的点的映射关系,映射关系为3D直线投影,根据3D直线投影映射关系,得到第一坐标,第一坐标为球面映射点在世界坐标系内的坐标,球面映射点为与输出平面的点对应的球面上的点,包括以下步骤:As shown in Figure 4, in some embodiments of the present invention, in step S400, the mapping relationship between the points on the output plane and the points on the spherical surface is obtained, the mapping relationship is a 3D linear projection, and according to the 3D linear projection mapping relationship, the first Coordinates, the first coordinate is the coordinate of the spherical mapping point in the world coordinate system, the spherical mapping point is the point on the spherical surface corresponding to the point of the output plane, including the following steps:
S410、在球面内建立内接圆平面,内接圆平面的半径与球面的半径相同,内接圆平面的外接正方形平面为输出平面;S410. Establish an inscribed circular plane in the spherical surface, the radius of the inscribed circular plane is the same as the radius of the spherical surface, and the circumscribed square plane of the inscribed circular plane is an output plane;
S420、获取内接圆平面各点在世界坐标系内的坐标,即外接正方形平面与内接圆平面的交点在世界坐标系内的坐标,得到第一坐标。S420. Obtain the coordinates of each point of the inscribed circle plane in the world coordinate system, that is, the coordinates of the intersection point of the circumscribed square plane and the inscribed circle plane in the world coordinate system, to obtain the first coordinate.
在本发明的一些实施例,设置输出平面的分辨率为w*h,根据,在世界坐标系中Z轴和Y轴平面的第一象限内,通过如下计算公式求得输出平面上任何一点Pw(m,n)在世界坐标系中的坐标:In some embodiments of the present invention, the resolution of the output plane is set to w*h. According to the following calculation formula, any point P on the output plane is obtained in the first quadrant of the Z-axis and Y-axis planes in the world coordinate system The coordinates of w (m, n) in the world coordinate system:
同理可以求得,输出平面在其他象限的坐标,得到第一坐标,根据公式当R>r,说明输出平面上该点不在内接圆平面内,可以直接丢弃。In the same way, it can be obtained, output the coordinates of the plane in other quadrants, and obtain the first coordinates, according to the formula When R>r, it means that the point on the output plane is not in the inscribed circle plane and can be discarded directly.
当转动内接圆平面时,根据旋转矩阵可求得新的内接圆平面内的各点在世界坐标系内的坐标。When rotating the inscribed circle plane, the coordinates of each point in the new inscribed circle plane in the world coordinate system can be obtained according to the rotation matrix.
如图5所示,在本发明的一些实施例,步骤S600中,将像素坐标点对应的红外图像的像素值作为目标像素值,目标像素值为输出平面的点的像素值,获得红外全景图像,包括:As shown in Figure 5, in some embodiments of the present invention, in step S600, the pixel value of the infrared image corresponding to the pixel coordinate point is used as the target pixel value, and the target pixel value is the pixel value of the point of the output plane to obtain an infrared panoramic image ,include:
S610、将所有像素坐标点对应的各个红外图像的重合区域进行图像融合,得到目标红外图像,重合区域内各个像素坐标点对应多张红外图像的像素值;S610. Perform image fusion on the overlapping areas of the infrared images corresponding to all the pixel coordinate points to obtain the target infrared image, and each pixel coordinate point in the overlapping area corresponds to the pixel values of multiple infrared images;
S620、将像素坐标点对应的目标红外图像的像素值作为目标像素值,目标像素值为输出平面的点的像素值,获得红外全景图像。S620. Using the pixel value of the target infrared image corresponding to the pixel coordinate point as the target pixel value, the target pixel value is the pixel value of a point on the output plane, to obtain an infrared panoramic image.
在本发明的一些实施例,如图7所示,输出平面对应有两张红外图像,分别为第一红外图像和第二红外图像,第一红外图像包括D1区域和D2区域,第二红外图像包括D3区域和D4区域,其中,D1区域和D4区域对应输出平面的不同区域,即D1区域和D4区域为非重合区域,D2区域和D3区域在输出平面上对应同一区域,即D2区域和D3区域为重合区域,对D2区域的红外图像和D3区域的红外图像进行融合得到融合区域红外图像,将D1区域、融合区域和D4区域的红外图像依次覆盖到输出平面得到目标红外图像,将像素坐标点对应的目标红外图像的像素值作为目标像素值,目标像素值为输出平面的点的像素值,获得红外全景图像。D2区域和D3区域采用线性融合算法进行融合,按照融合权值进行动态调整,融合权值根据红外图像上的像素点至红外图像边缘的距离确定,距离越近则融合权值越小,距离越远则融合权值越大,保证重合区域图像过渡平滑。若第一红外图像和第二红外图像的重叠区域过大,可设置掩码图片(二值化矩形图片),缩小对应的相机100获得的红外图像的视野范围,减少融合点数,可提高融合效率。In some embodiments of the present invention, as shown in Figure 7, the output plane corresponds to two infrared images, respectively the first infrared image and the second infrared image, the first infrared image includes the D1 area and the D2 area, and the second infrared image Including the D3 area and the D4 area, wherein, the D1 area and the D4 area correspond to different areas of the output plane, that is, the D1 area and the D4 area are non-overlapping areas, and the D2 area and the D3 area correspond to the same area on the output plane, that is, the D2 area and the D3 area The area is an overlapping area, and the infrared image of the D2 area and the infrared image of the D3 area are fused to obtain the infrared image of the fusion area, and the infrared images of the D1 area, the fusion area and the D4 area are sequentially overlaid on the output plane to obtain the target infrared image, and the pixel coordinates The pixel value of the target infrared image corresponding to the point is used as the target pixel value, and the target pixel value is the pixel value of the point on the output plane to obtain the infrared panoramic image. The D2 area and the D3 area are fused using a linear fusion algorithm, and dynamically adjusted according to the fusion weight. The fusion weight is determined according to the distance from the pixel on the infrared image to the edge of the infrared image. The closer the distance, the smaller the fusion weight, and the closer the distance. The farther the fusion weight is, the larger the fusion weight is to ensure smooth image transition in the overlapping area. If the overlapping area of the first infrared image and the second infrared image is too large, a mask picture (binarized rectangular picture) can be set to reduce the field of view of the infrared image obtained by the corresponding
如图6所示,在本发明的一些实施例,步骤S610中,将所有像素坐标点对应的各个红外图像的重合区域进行图像融合,得到目标红外图像,包括:As shown in FIG. 6, in some embodiments of the present invention, in step S610, image fusion is performed on overlapping regions of the respective infrared images corresponding to all pixel coordinate points to obtain the target infrared image, including:
S611、获取红外图像对应的微光图像;S611. Acquire a low-light image corresponding to the infrared image;
S612、对微光图像和红外图像进行增强处理得到过渡微光图像和过渡红外图像;S612. Perform enhancement processing on the low-light image and the infrared image to obtain the transitional low-light image and the transitional infrared image;
S613、对过渡微光图像和过渡红外图像进行融合得到增强红外图像;S613. Fusion the transitional low-light image and the transitional infrared image to obtain an enhanced infrared image;
S614、将所有像素坐标点对应的各个增强红外图像的重合区域进行图像融合,得到目标红外图像。S614. Perform image fusion on overlapping regions of the enhanced infrared images corresponding to all pixel coordinate points to obtain the target infrared image.
在本发明的一些实施例,步骤S614中,拉普拉斯金字塔的融合方式对过渡微光图像和过渡红外图像进行融合得到增强红外图像,包括:In some embodiments of the present invention, in step S614, the fusion method of the Laplacian pyramid is used to fuse the transition low-light image and the transition infrared image to obtain an enhanced infrared image, including:
将过渡微光图像分解成基础层图像和细节层图像;Decompose the transition low-light image into a base layer image and a detail layer image;
将过渡红外图像分解成基础层图像和细节层图像;Decompose the transitional infrared image into a base layer image and a detail layer image;
对过渡微光图像的基础层图像和过渡红外图像的基础层图像进行融合得到目标基础层图像;Fusing the base layer image of the transition low-light image and the base layer image of the transition infrared image to obtain the target base layer image;
对过渡微光图像的细节层图像和过渡红外图像的细节层图像融合得到目标细节层图像;对目标基础层图像和目标细节层图像进行重构得到红外全景图像。The detail layer image of the transition low-light image and the detail layer image of the transition infrared image are fused to obtain the target detail layer image; the target base layer image and the target detail layer image are reconstructed to obtain an infrared panoramic image.
通过对过渡微光图像和过渡红外图像进行两尺度分解,分解成基础层图像与细节层图像,采用加权系数的方法对基础层图像进行融合,采用加权系数的方法对细节层图像进行融合,最后将各层融合图像进行重构,快速有效地将各个尺度上的图像信息相融合,得到红外全景图像,红外全景图像的图像信息丰富,清晰度和可辨性高。采用GPU并行加速计算方法进行红外全景图像拼接融合,提高拼接融合的效率。Through the two-scale decomposition of the transition low-light image and the transition infrared image, decompose it into the base layer image and the detail layer image, use the weighting coefficient method to fuse the base layer image, and use the weighting coefficient method to fuse the detail layer image, and finally The fusion images of each layer are reconstructed, and the image information on each scale is quickly and effectively fused to obtain an infrared panoramic image. The infrared panoramic image has rich image information, high definition and recognizability. Using GPU parallel acceleration computing method to stitch and fuse infrared panoramic images to improve the efficiency of stitching and fusion.
在步骤S612中,采用gamma图像增强算法对微光图像和红外图像进行增强处理得到过渡微光图像和过渡红外图像,包括以下步骤:In step S612, the gamma image enhancement algorithm is used to enhance the low-light image and the infrared image to obtain the transitional low-light image and the transitional infrared image, including the following steps:
预设gamma查找表;Preset gamma lookup table;
根据gamma查找表,将微光图像的像素值映射到对应的gamma校正像素值得到过渡微光图像;According to the gamma lookup table, the pixel value of the low-light image is mapped to the corresponding gamma-corrected pixel value to obtain the transitional low-light image;
根据gamma查找表,将红外图像的像素值映射到对应的gamma校正像素值得到过渡红外图像。According to the gamma lookup table, the pixel values of the infrared image are mapped to the corresponding gamma-corrected pixel values to obtain the transition infrared image.
gamma图像增强算法的原理如下:The principle of the gamma image enhancement algorithm is as follows:
S100、归一化:将像素值转换为0~1之间的实数,归一化的计算公式为:S100, normalization: convert the pixel value into a real number between 0 and 1, the calculation formula of normalization is:
f=(i+0.5)/256,其中,f为归一化的像素值,i为像素值f=(i+0.5)/256, where f is the normalized pixel value and i is the pixel value
S200、预补偿:对归一化值进行预补偿,预补偿的计算公式为:S200. Pre-compensation: perform pre-compensation on the normalized value, the formula for calculating the pre-compensation is:
F=(1/gamma)*f,F为预补偿的像素值F=(1/gamma)*f, F is the pre-compensated pixel value
S300、反归一化:将经过预补偿的实数值反变换为0~255之间的整数值,反归一化的计算公式为:S300. Denormalization: reversely transform the pre-compensated real value into an integer value between 0 and 255, and the calculation formula for denormalization is:
P=F*256-0.5,P为反归一化的像素值P=F*256-0.5, P is the denormalized pixel value
微光图像和红外图像中任何一个像素值限定为0~255中的整数,gamma值根据增强强度要求在0~10之间取一值,经过归一化、预补偿、反归一化操作后,所对应的计算结果是唯一的,并且也落在0~255这个范围内,大幅减少计算量,处理速度快,提高暗区图像的可辨性。Any pixel value in the low-light image and infrared image is limited to an integer from 0 to 255, and the gamma value takes a value between 0 and 10 according to the enhancement intensity requirements. After normalization, pre-compensation, and denormalization operations , the corresponding calculation result is unique, and also falls within the range of 0-255, greatly reducing the amount of calculation, fast processing speed, and improving the recognizability of images in dark areas.
如图8所示,根据本发明第二方面实施例的红外全景监控装置,包括:相机100、图像处理模块200和通信模块300,相机100用于采集多个角度的微光图像和红外图像,相机100的输出端连接图像处理模块200的输入端,图像处理模块200执行如上述的红外全景图像拼接方法,图像处理模块200的输出端连接通信模块300的输入端,通信模块300用于将红外全景图像传输至主机端。As shown in FIG. 8, the infrared panoramic monitoring device according to the embodiment of the second aspect of the present invention includes: a
通过获得各个相机100拍摄的红外图像,建立与各个相机100对应的相机坐标系,以各个相机坐标系的原点的重心作为原点,建立世界坐标系,以世界坐标系的原点作为球心,建立球面,在世界坐标系内建立输出平面,获取输出平面上的点与球面上的点的映射关系,根据映射关系,得到第一坐标,第一坐标为球面映射点在世界坐标系内的坐标,球面映射点为与输出平面的点对应的球面上的点,获取世界坐标系和相机坐标系的RT关系,根据RT关系,将第一坐标转换为第二坐标,第二坐标为球面映射点坐标在相机坐标系中的坐标点,RT关系为世界坐标系和相机坐标系的坐标转换关系,将第二坐标转换为像素坐标点,将像素坐标点对应的红外图像的像素值作为目标像素值,目标像素值为输出平面的点的像素值,获得红外全景图像,仅计算输出平面上各点对应的像素值,不用对所有的红外图像的数据进行处理计算,减少了数据运算量,图像拼接速度快,主机端的监控显示画面实时性好。By obtaining the infrared images taken by each
相机100的数量为六个,六个相机100位于同一球面上,六个相机100的拍摄范围覆盖球面的上半球,能获取水平360度的红外图像和微光图像。相机100采用鱼眼相机100,拍摄视角更广泛。还可以根据应用场景设置成其他数量的相机100。The number of
根据本发明第三方面实施例的一种电子设备,包括:至少一个处理器;至少一个存储器,用于存储至少一个程序;当至少一个程序被至少一个处理器执行时实现上述的红外全景图像拼接方法。An electronic device according to an embodiment of the third aspect of the present invention includes: at least one processor; at least one memory for storing at least one program; when the at least one program is executed by at least one processor, the above infrared panoramic image stitching is realized method.
通过获得各个相机100拍摄的红外图像,建立与各个相机100对应的相机坐标系,以各个相机坐标系的原点的重心作为原点,建立世界坐标系,以世界坐标系的原点作为球心,建立球面,在世界坐标系内建立输出平面,获取输出平面上的点与球面上的点的映射关系,根据映射关系,得到第一坐标,第一坐标为球面映射点在世界坐标系内的坐标,球面映射点为与输出平面的点对应的球面上的点,获取世界坐标系和相机坐标系的RT关系,根据RT关系,将第一坐标转换为第二坐标,第二坐标为球面映射点坐标在相机坐标系中的坐标点,RT关系为世界坐标系和相机坐标系的坐标转换关系,将第二坐标转换为像素坐标点,将像素坐标点对应的红外图像的像素值作为目标像素值,目标像素值为输出平面的点的像素值,获得红外全景图像,仅计算输出平面上各点对应的像素值,不用对所有的红外图像的数据进行处理计算,减少了数据运算量,图像拼接速度快。By obtaining the infrared images taken by each
上面结合附图对本发明实施例作了详细说明,但是本发明不限于上述实施例,在所属技术领域普通技术人员所具备的知识范围内,还可以在不脱离本发明宗旨的前提下作出各种变化。The embodiments of the present invention have been described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned embodiments, and within the scope of knowledge of those of ordinary skill in the art, various modifications can be made without departing from the spirit of the present invention. Variety.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211578132.3A CN116309041B (en) | 2022-12-06 | 2022-12-06 | Infrared panoramic image stitching method, infrared panoramic monitoring device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211578132.3A CN116309041B (en) | 2022-12-06 | 2022-12-06 | Infrared panoramic image stitching method, infrared panoramic monitoring device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116309041A true CN116309041A (en) | 2023-06-23 |
CN116309041B CN116309041B (en) | 2025-09-12 |
Family
ID=86824638
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211578132.3A Active CN116309041B (en) | 2022-12-06 | 2022-12-06 | Infrared panoramic image stitching method, infrared panoramic monitoring device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116309041B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118429516A (en) * | 2024-04-19 | 2024-08-02 | 摩尔线程智能科技(北京)有限责任公司 | Image processing method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6009190A (en) * | 1997-08-01 | 1999-12-28 | Microsoft Corporation | Texture map construction method and apparatus for displaying panoramic image mosaics |
CN106600546A (en) * | 2016-11-14 | 2017-04-26 | Tcl集团股份有限公司 | Ultra-wide angle camera distortion correction method and system |
WO2022222121A1 (en) * | 2021-04-23 | 2022-10-27 | 华为技术有限公司 | Panoramic image generation method, vehicle-mounted image processing apparatus, and vehicle |
-
2022
- 2022-12-06 CN CN202211578132.3A patent/CN116309041B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6009190A (en) * | 1997-08-01 | 1999-12-28 | Microsoft Corporation | Texture map construction method and apparatus for displaying panoramic image mosaics |
CN106600546A (en) * | 2016-11-14 | 2017-04-26 | Tcl集团股份有限公司 | Ultra-wide angle camera distortion correction method and system |
WO2022222121A1 (en) * | 2021-04-23 | 2022-10-27 | 华为技术有限公司 | Panoramic image generation method, vehicle-mounted image processing apparatus, and vehicle |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118429516A (en) * | 2024-04-19 | 2024-08-02 | 摩尔线程智能科技(北京)有限责任公司 | Image processing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN116309041B (en) | 2025-09-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7271803B2 (en) | Method and system for simulating stereographic vision | |
CN106934772B (en) | Horizontal calibration method and system for panoramic image or video and portable terminal | |
US6574376B1 (en) | Arithmetic unit for image transformation and monitoring system | |
CN106558017B (en) | Spherical display image processing method and system | |
WO2013018173A1 (en) | Image processing apparatus, image processing method and image processing program | |
CN111294580B (en) | Camera video projection method, device and equipment based on GPU and storage medium | |
CN106780317B (en) | Panoramic projection method and device | |
JPWO2018235163A1 (en) | Calibration apparatus, calibration chart, chart pattern generation apparatus, and calibration method | |
CN111311682A (en) | Pose estimation method and device in LED screen correction process and electronic equipment | |
CN115861514A (en) | Rendering method, device and equipment of virtual panorama and storage medium | |
CN111161130B (en) | A video correction method based on three-dimensional geographic information | |
CN105825470A (en) | Fisheye image correction method base on point cloud image | |
US20180288325A1 (en) | System and method for image stitching | |
CN107845061A (en) | Image processing method, device and terminal | |
CN106586041A (en) | Simulation method of Mars object for deep space exploration | |
TWI756956B (en) | Image processing method and device for panorama image | |
CN116309041B (en) | Infrared panoramic image stitching method, infrared panoramic monitoring device and electronic equipment | |
CN114187367B (en) | Camera external parameter calibration method and device, electronic equipment and storage medium | |
CN116245748B (en) | Distortion correction method, device, equipment, system and storage medium for ring-looking lens | |
CN110519774B (en) | Base station investigation method, system and equipment based on VR technology | |
CN117115211A (en) | Point cloud coloring method, point cloud coloring device and computer-readable storage medium | |
CN110786017B (en) | Distributed image generation method | |
CN110728619B (en) | Panoramic image stitching rendering method and device | |
US11388336B2 (en) | Horizontal calibration method and system for panoramic image or video, and portable terminal | |
CN111161148A (en) | Panoramic image generation method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |