Difference between different warping methods in OpenCV

Using OpenCV to stitch the image, I found that several deformation methods are provided for this operation:

if (warp_type == "plane") warper_creator = new cv::PlaneWarper(); else if (warp_type == "cylindrical") warper_creator = new cv::CylindricalWarper(); else if (warp_type == "spherical") warper_creator = new cv::SphericalWarper(); else if (warp_type == "fisheye") warper_creator = new cv::FisheyeWarper(); else if (warp_type == "stereographic") warper_creator = new cv::StereographicWarper(); else if (warp_type == "compressedPlaneA2B1") warper_creator = new cv::CompressedRectilinearWarper(2, 1); else if (warp_type == "compressedPlaneA1.5B1") warper_creator = new cv::CompressedRectilinearWarper(1.5, 1); else if (warp_type == "compressedPlanePortraitA2B1") warper_creator = new cv::CompressedRectilinearPortraitWarper(2, 1); else if (warp_type == "compressedPlanePortraitA1.5B1") warper_creator = new cv::CompressedRectilinearPortraitWarper(1.5, 1); else if (warp_type == "paniniA2B1") warper_creator = new cv::PaniniWarper(2, 1); else if (warp_type == "paniniA1.5B1") warper_creator = new cv::PaniniWarper(1.5, 1); else if (warp_type == "paniniPortraitA2B1") warper_creator = new cv::PaniniPortraitWarper(2, 1); else if (warp_type == "paniniPortraitA1.5B1") warper_creator = new cv::PaniniPortraitWarper(1.5, 1); else if (warp_type == "mercator") warper_creator = new cv::MercatorWarper(); else if (warp_type == "transverseMercator") warper_creator = new cv::TransverseMercatorWarper(); 

The above code is taken from the stitching_detailed.cpp project in official OpenCV samples.

I tried all of them to stitch a set of nine images: they create slightly different outputs (about distortion or perspectives), as well as other processing times.

Please can someone explain these differences in detail to me?

+5
source share
1 answer

Imagine that you place stickers on an object. Your original images are stickers, and warping methods indicate which object and how you are going to cover. In the case of PlaneWarper this is obviously a plane. For CylindricalWarper and SphericalWarper this is a cylinder and a sphere, respectively. Other warper process other general forecasts, such as Mercator and stereographic. If you do not know what it is, this is a good sign that you do not need to use them. http://en.wikipedia.org/wiki/Map_projection has a pretty decent amount of information to get you started.

The main differences between these warpers are mathematical formulas that are used to compare the pixels of the original image with the resulting panorama. Depending on your task, you must choose the right tool. If you are stitching a panorama, you should probably use CylindricalWarper or SphericalWarper . For more information, see http://www.panoguide.com/howto/panoramas/types.jsp .

+2
source

Source: https://habr.com/ru/post/1200119/


All Articles