In this post I am demonstarting how LinearPolar transform can used to unwrap 360 degree image to panoramic image.
Basically we have to load the image and input to LinearPolar function, the function have the arguments
src – Source image
dst – Destination image.
center – The transformation center;
maxRadius – The radius of the bounding circle to transform.
flags – INTER_CUBIC, WARP_FILL_OUTLIERS, WARP_INVERSE_MAP etc..
Here is another post related to unwrap fisheye image Unwrap 360 degree image using OpenCV | Converting fisheye image into panorama image
Basically we have to load the image and input to LinearPolar function, the function have the arguments
src – Source image
dst – Destination image.
center – The transformation center;
maxRadius – The radius of the bounding circle to transform.
flags – INTER_CUBIC, WARP_FILL_OUTLIERS, WARP_INVERSE_MAP etc..
C++ Code
Mat src = imread("pan9.jpg", 1);
Mat linearPolarMat;
linearPolar(src,linearPolarMat,Point(src.cols/2, src.rows/2),src.cols/2,INTER_CUBIC);
//Rotate 90 degree
transpose(linearPolarMat, linearPolarMat);
flip(linearPolarMat, linearPolarMat,0);
imshow("linearPolar", linearPolarMat);
imshow("src", src);
waitKey();
Result
Source
linearPolar Transform
Source
linearPolar Transform
Here is another post related to unwrap fisheye image Unwrap 360 degree image using OpenCV | Converting fisheye image into panorama image
No comments:
Post a Comment