Pittie
Pittie

Reputation: 301

error: namespace "cv::cuda" has no member "resize"

I have successfully built opencv with WITH_CUDA=on. but I'm still facing this error error: namespace "cv::cuda" has no member "resize". it is weird that the IDE suggests me that there is a resize function in that namespace but it fails on compile. Does anyone know how to tackle this matter?

#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/video/background_segm.hpp"
#include "opencv2/video/tracking.hpp"
#include "opencv2/cudev/ptr2d/gpumat.hpp"
#include "opencv2/cudev/ptr2d/resize.hpp"
#include "newfile.h"

using namespace cv;
using namespace std;

int test() {
    cv::Mat LoadedImage;
    cv::cuda::GpuMat Im;

    LoadedImage = imread("in.jpg", IMREAD_COLOR);
    Im.upload(LoadedImage);
    cv::cuda::resize(LoadedImage, LoadedImage, cv::Size(), 0.5, 0.5, cv::INTER_NEAREST);

    imwrite("Step4a.JPG", LoadedImage);
    return 0;
}

Upvotes: 3

Views: 4874

Answers (1)

Pittie
Pittie

Reputation: 301

as @john has pointed out. I should #include <opencv2/cudawarping.hpp> to solve the problem.

Upvotes: 5

Related Questions