简体   繁体   English

C ++ OpenCV天空图像拼接

[英]C++ OpenCV sky image stitching

Some background: Hi all! 一些背景:大家好 I have a project which involves cloud imaging. 我有一个涉及云成像的项目。 I take pictures of the sky using a camera mounted on a rotating platform. 我使用安装在旋转平台上的相机拍摄天空的照片。 I then need to compute the amount of cloud present based on some color threshold. 然后,我需要根据某个颜色阈值来计算存在的云量。 I am able to this individually for each picture. 我可以为每张照片单独设置。 To completely achieve my goal, I need to do the computation on the whole image of the sky. 为了完全实现我的目标,我需要对整个天空图像进行计算。 So my problem lies with stitching several images (about 44-56 images). 所以我的问题在于缝合几个图像(大约44-56个图像)。 I've tried using the stitch function on all and some subsets of image set but it returns an incomplete image (some images were not stitched). 我尝试在图像集的所有子集和某些子集上使用stitch函数,但是它返回的图像不完整(某些图像未拼接)。 This could be because of a lack of overlap of something, I dunno. 我不知道这可能是因为缺少某些东西的重叠。 Also the output image has been distorted weirdly (I am actually expecting the output to be something similar to a picture taken by a fish-eye lense). 另外,输出图像也已怪异地失真了(我实际上期望输出类似于鱼眼镜头拍摄的图像)。

The actual problem: So now I'm trying to figure out the opencv stitching pipeline. 实际的问题:所以现在我试图找出opencv拼接管道。 Here is a link: http://docs.opencv.org/modules/stitching/doc/introduction.html 这是一个链接: http : //docs.opencv.org/modules/stitching/doc/introduction.html

Based on what I have researched I think this is what I want to do. 根据我的研究,我认为这是我想要做的。 I want to map all the images to a circular shape, mainly because of the way how my camera rotates, or something else that has uses a fairly simple coordinate transformation. 我想将所有图像映射为圆形,这主要是由于相机的旋转方式或其他使用相当简单的坐标变换的方式。 So I think I need get some sort of fixed coordinate transform thing for the images. 所以我认为我需要对图像进行某种固定的坐标转换。 Is this what they call the homography? 这就是所谓的单应性吗? If so, does anyone have any idea how I can go about my problem? 如果是这样,是否有人知道我该如何解决我的问题? After this, I believe I need to get a mask for blending the images. 在此之后,我相信我需要为混合图像使用遮罩。 Will I need to get a fixed mask like the one I want for my homography? 我需要像单应性一样使用固定的口罩吗?

Am I going through a possible path? 我正在走一条可行的道路吗? I have some background in programming but almost none in image processing. 我在编程方面有一定的背景,但是在图像处理方面几乎没有。 I'm basically lost. 我基本上迷路了。 TT TT

"So I think I need get some sort of fixed coordinate transform thing for the images. Is this what they call the homography?" “所以我认为我需要对图像进行某种固定的坐标变换。这就是所谓的单应性吗?”

Yes, the homography matrix is the transformation matrix between an original image and the ideal result. 是的,单应性矩阵是原始图像和理想结果之间的转换矩阵。 It warps an image in perspective so it can fit in stitching to the other image. 它会透视透视图像,以便可以与其他图像拼接在一起。

"If so, does anyone have any idea how I can go about my problem?" “如果是这样,有谁知道我该如何解决我的问题?”

Not with the limited information you provided. 您提供的信息有限。 It would ease the problem a lot if you know the order of pictures (which borders which.. row, column position) 如果您知道图片的顺序(与哪个..行,列位置相邻),则可以大大缓解该问题。

If you have no experience in image processing, I would recommend you use a tutorial covering stitching using more basic functions in detail. 如果您没有图像处理方面的经验,建议您使用一本教程,其中详细介绍更多有关基本绣花的内容。 There is some important work behind the scenes, and it's not THAT harder to actually do it yourself. 幕后有一些重要的工作,您自己实际完成工作并不难。

Start with this example. 从这个例子开始。 It stitches two pictures. 它缝制了两张图片。

http://ramsrigoutham.com/2012/11/22/panorama-image-stitching-in-opencv/ http://ramsrigoutham.com/2012/11/22/panorama-image-stitching-in-opencv/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM