ppwwyyxx / OpenPano

Automatic Panorama Stitching From Scratch
MIT License
1.86k stars 553 forks source link

Image Quality and Size Warnings #14

Closed GitZChen closed 8 years ago

GitZChen commented 8 years ago

Thank you for open sourcing this - the stitching performance is really amazing! However, as I was testing this software, I noticed several things that I didn't really understand that I hope you could clarify.

Background: I was using full sized images produced by my UAV which are generally about 5.5-6 Mb each. I have 19 images taken systematically (60 deg apart horizontally and 30 degrees apart vertically) to produce a 360 spherical panorama. I am testing on a 4GB RAM Ubuntu.

  1. Is the final pano's image quality reduced to save memory? The files are a lot smaller than the ones I get when using Autostitch or PtGUI.
  2. I am getting some pretty random "error: Result too large. Something must be wrong!" messages, accompanied by some unusual projection ranges.

If I feed a set of 6 images taken horizontally, it successfully produces the 1st image below. If I feed the second set of 6 images taken with my drone's gimbal pitch down at 30 deg, it successfully produces the 2nd image below. But if I try to feed all twelve images to it, it gives me "error: Result too large. Something must be wrong!" So I thought maybe this is a memory issue. However, I don't think that is the case because then I tried to stitch the images vertically in sets of 3. The 1st set successfully gives the 3rd image below, while the second set encountered that same "result too large" error. 6a1x 6a2x-smaller 31x

This is selected parts of a sample run that got the message

[init_config@main.cc:271] Run with camera estimation mode.
[calc_feature@stitcherbase.cc:19] Image 2 has 2668 features
[calc_feature@stitcherbase.cc:19] Image 0 has 2380 features
[calc_feature@stitcherbase.cc:19] Image 1 has 3719 features

...

Estimate Camera: 19.387000 milliseconds.
[build@stitcher.cc:59] Using projection method: 1
[update_proj_range@stitcher_image.cc:81] Range: (-0.796360,-0.391022)~(0.765416,0.947269)
[update_proj_range@stitcher_image.cc:81] Range: (-1.178559,0.121779)~(1.211932,3.385148)
[update_proj_range@stitcher_image.cc:81] Range: (0.000134,0.589339)~(6.282658,130.113268)
projmin:-1.17856 -0.391022projmax6.28266 130.113
error: Result too large. Something must be wrong!

Thank you again for your help and your awesome work!

ppwwyyxx commented 8 years ago
  1. Yes the results are resized. You can change the threshold MAX_OUTPUT_SIZE in config.cfg.
  2. This error is usually a result of a stitching failure. From the log it looks like the placement of the third image was estimated wrong. One possible cause is that large FOV cameras usually have serious lens distortion and it needs to be undistorted first, to get a better result. Feel free to send me the data so I could find out what to do with this kind of data.
GitZChen commented 8 years ago

Cool, thanks! Can we email you our source images at the email in your source code?

ppwwyyxx commented 8 years ago

Sure!

ppwwyyxx commented 8 years ago

After commit d6b50848c7, things should work well with your data: small

Thanks for providing data and your images revealed several problems in my code. Could you allow me to include your images in the example data for test purposes? I've never tested on images with such a large vertical range.

GitZChen commented 8 years ago

Thank you for providing such great software and support! I don't have any problem with you including the images in example data, but I didn't take these images, so I need to check with someone else first - but I think @dbaldwin won't mind!

dbaldwin commented 8 years ago

@ppwwyyxx this is amazing work. Thank you! Yes, you can feel free to use the imagery in your sample data and I can provide a lot more if you'd like.