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

I have successfully written a tool that converts the image color space from linear to sRGB, so opencv works. Then I wanted to resize the image using the cv :: resize function to create thumbnails. However, this did not work, here is a reproducible piece of code.

#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?

+5
source share
1 answer

you are missing a header file:

 #include "opencv2/imgproc/imgproc.hpp" 

(ofc, you also need to bind opencv_imgproc)

 #include "opencv2/opencv.hpp" 

escaped the first error, but you still have to take care of the correct libs

+9
source

Source: https://habr.com/ru/post/1207729/


All Articles