![]() Yet even then its accuracy is still a bit off. It performs a standard calibration using a checkerboard pattern. I originally got the focal length for my camera lens from calibration using the sample program (calibration.cpp) in the OpenCV 2.x directory. One can improve the results further by taking into consideration for radial distortion, but I’ll leave that as an exercise to the reader. There is no doubt a vast improvement by introducing non-linear optimisation to panoramic stitching. Much better! Not perfect, but much more pleasant to look at than the previous image. The reported root mean squared error is 3.84413 pixels. Panoramic stitching with non-linear optimisation I’ll now turn on the non-linear optimisation step for the 4 parameters mentioned previously. The results are without a doubt awful! Looking at it too long would cause me to require new glasses with a stronger optical prescription. The root mean squared error reported is 22.5008 pixels. Panoramic stitching without non-linear optimisation ![]() Below shows a close up section of the roof of the house without optimisation. For comparison I’ll be using the full size images (3872 x 2592), which is not included in the sample directory to keep the package size reasonable. I thought it would be interesting to compare results with and without any optimisation. I decided to optimise the focal length, yaw, pitch, and roll for each image. One of the crucial steps to getting good results is the non-linear optimisation step. Sample results from Simple Pano Stitcher Discussion If I had taken it on a tripod instead of hand held it should be less noticeable. On close inspection there is some noticeable parallax. Results with Simple Pano Stitcherīelow is a sample result I got after combining all the layers, by simply pasting them on top of each other. To keep things simple I only wrote the bare minimum to get it up and running, for more information check the comments in main.cpp at the top of the file. You’ll need to know the focal length in pixels used to capture each image. Edit the source code to load your own images. I’ve included sample images in the sample directory, which the program uses by default. It will output a bunch of layer-xxx.png images as output. To compile the code just type make and run bin/Release/SimplePanoStitcher. It uses OpenCV to do fundamental image processing stuff and includes a public domain Levenberg-Marquardt non-linear solver. In the meantime you can check out my Simple Pano Stitcher program here: I believe OpenCV is scheduled to include some sort of panoramic stitching engine in future release. In the process of doing so I learned some new things along the way. Being the practical man I like to think of myself, I decided to finally get down and dirty and write a simple panoramic stitcher that should help beginners venturing into panoramic stitching. In the past I’ve received emails from people on the OpenCV Yahoo group asking for help on panoramic stitching, to which I answered them to the best of my knowledge, though the answers were theoretical.
0 Comments
Leave a Reply. |