Bundler算法对原始图片的要求

          由于前期把bundler配置好了(见上篇博客),可以实现例子程序所说的重现效果,但是如果把图片换成自己的图片时,大家可能会遇到一些问题,我在尝试的过程中也遇到的相应的问题,并尝试了一些解决方法,现在把我的尝试的过程整理一下,希望能对进行相关尝试工作的伙伴给予一定的提示。

       最初按照该算法所说,我去网上随便搜索了一组关于自由女神像的图片,选择一些的角度进行下载,然后做成图片集放在一个文件夹下,按照上篇日志所说的步骤运行bundler,但是在运行到中途是,可能会出现各种错误,这个经过仔细对比我们运行的程序信息和例程运行的信息可以看出,在图片的信息提取过程这一步,例程提取到了CCD和focal length(焦距)信息,而我们的程序没有提取到相应的信息(即上面的两个信息为零)。而焦距信息对于我们后面三维点位置的确定和相机视角的确定是必不可少的。所以在进行后面的步骤时会出现各种各样的错误。

        那为什么我们找的照片没有CCD和focal length这两个关键信息呢,或者程序通过什么来获取照片的这两个信息呢。这是我们需要解决的关键问题。经过分析,我们知道程序有获取照片信息的程序,这个执行文件是jhead.exe,它可以获取而且只能获取.jpg图片文件的参数信息。通过运行这个程序我们可以清晰的看出,我们的照片和例程照片参数的差别,确实没有提供上述的两个关键信息。

         那我们怎么才能获取带有CCD和focal length这两个信息的照片呢,亦或是我们怎么从一个没有这两个信息的照片中提取出这两个信息呢。经过一段时间的查找,仔细阅读snavely给出的说明文件,发现其实作者早已经有说明,是在他的FAQ文件中做出的解释(见网址http://www.cs.cornell.edu/~snavely/bundler/faq.html)。这里给出它的问题1中给出的说明,正是我们一直考虑的问题。

 

    1. Q. Something seems to be broken. The geometry I get looks wrong. What's going on?

      A. There are many reasons why Bundler might produce erroneous results. However, there are a few common failure modes. The first is that there is not enough overlap between the images. A good rule of thumb is that each point in the scene needs to be visible in at least three images, and that when walking around an object, you should take photos at least every 15 degrees (i.e., 24 photos when capturing a full 360 view of an object). A second common failure mode is that Bundler can't get a good focal length estimate (though it will still try hard to produce a usually wrong result). Your camera may need to be added to the CCD width database inbin/extract_focal.pl. To tell if this is a problem, look at the generatedlist.txt file for your dataset. Each line should have three entries: the image name, a zero, and a focal length. If this isn't the case, either (a) your camera model needs to be registered (possible with most still cameras) or (b) you are using a video camera and therfore Bundler can't automatically detect focal lengths from the Exif tags in your images. Here are some instructions for handling these cases:

      Case (a): I am using a still digital camera: First, you will need to find the sensor width (in millimeters (mm)) of your camera. Sensor widths for most cameras can be found on dpreview; seethis page for more information. Once you have found the sensor width in mm, you must add a line to the sensor width database inbin/extract_focal.pl. First, use the provided jhead tool to find the camera make and model as listed in the Exif tags. You will then add a line tobin/extract_focal.pl of the form:

      "[Camera make] [Camera model]" => [Sensor width]

      See the existing entries for examples.
      Case (b): I am using a video camera, or my camera otherwise doesn't include the right Exif tags, or (a) didn't work for some other reason: You'll need to calibrate your camera yourself, to find the focal length. A good calibration tool isBouguet's Camera Calibration Toolbox. Once you know the focal length, first run the bundler pipeline on your images (it will probably not work well). Then edit thelist.txt file created (each line should contain just a filename, e.g. foo001.jpg), and append to each line a 0 followed by the focal length (assuming the focal length is the same for each frame; if the camera is zooming in or out you may have a problem). For instance, if the focal length (in pixels) is 2410.5, each line would look something like:

      foo001.jpg 0 2410.5

      Then rerun bundler (just bundler, and not the matching or other steps) as:

      bundler list.txt --options_file options.txt

            文字给出了三种情况下,我们如何处理我们自己重建时用到的照片。如果我们使用的相机型号是bin/extract_focal.pl文件中含有的类型,那么程序会自动算出照片的焦距信息。如果我们的相机型号不再extract_focal.pl文件中提到,我们可以自己把我们的相机型号加进去,按照上面所说的方法把相应的信息填进去,这样也可以得到焦距信息。最后一种最难处理,他需要借助另外的calibration toolbox对相机得到的照片进行计算,得到相机的焦距参数信息,这个需要很多工具,目前还没有尝试。不过有相应工具的可以按照上述的方法去尝试一下。本人还是初学者阶段,希望最后一种尝试成功的朋友能够留下大名,赐教如何运用第三种方法实现的bundler重建自己的照片~

            注意,如果大家用了以上方法找到了focal length 信息之后还没有得到最后的结果,这可能就和我们拍是照片时所处的环境有关系了(如光照等),另外还有可能跟图片的角度、图片数量有关。这都会影响后面的匹配结果,如果匹配点非常少,肯定不会得到我们想要的结果。

     



     

评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值