user1767754
user1767754

Reputation: 25094

OpenCV resize is not a member of cv (OpenCV Basics)

I successfully wrote a tool that converts an image's colors space from linear to sRGB, so opencv is working. Then i wanted to rescale the image with the cv::resize function to generate Thumbnails. However it didn't work, here is the reproduced code-snippet.

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>

using namespace std;

int main( int argc, char** argv )
{
    // Load images in the C++ format
    cv::Mat img = cv::imread("something.jpg");
    cv::Mat src = cv::imread("src.jpg");

    // Resize src so that is has the same size as img
    **cv::resize**(src, src, img.size());

    return 0;
}

I am using OpenCV 2.4.8. What am i doing wrong?

Upvotes: 8

Views: 21810

Answers (1)

berak
berak

Reputation: 39796

you're lacking a header file:

#include "opencv2/imgproc/imgproc.hpp"

(ofc, you have to link opencv_imgproc, too)

#include "opencv2/opencv.hpp"

would have avoided the 1st error, but you still have to care for the correct libs

Upvotes: 18

Related Questions