Sometimes, there is a need for resizing an image, the translation of images, and the rotation of images for larger computer vision applications. These kinds of geometric transformation is explained in this section.
Geometric transformation on images
Image resizing
images need to be of specific sizes in some computer vision applications. So there is a need to convert the image of arbitrary size into the specific size. OpenCV provides a function to resize an image. The code for image resizing is as follows:
#include <iostream>
#include "opencv2/opencv.hpp"
int main ()
{
cv::Mat h_img1 = cv::imread("images/cameraman.tif",0);
cv::cuda::GpuMat d_img1,d_result1,d_result2;
d_img1.upload(h_img1);
int width...