How to zoom in an image with opencv and C ++?

1

I have to program an algorithm to zoom in on an image without using the opencv tools, but I can not do it. How to zoom in an image using for loops?

Mat img = imread("copo.jpg", CV_LOAD_IMAGE_COLOR);
Mat img2 = Mat::zeros(img.size(), CV_8UC3);
int wid = img.size().width;
int hei = img.size().height;
for(int i = 0;i < wid;i++){
    for(int j = 0;j < hei;j++){
        for(int k = 0;k < 100;k++){
            for(int h = 0;h < 100;h++){
                img2.at<Vec3b>(i, j) = img.at<Vec3b>(k, h);
            }
        }
    }
}
    
asked by anonymous 07.11.2016 / 12:43

0 answers