Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c++

opencv

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?

like image 624
user1767754 Avatar asked Nov 26 '14 10:11

user1767754


1 Answers

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

like image 88
berak Avatar answered Sep 27 '22 18:09

berak