error: namespace “cv::cuda” has no member “resize”

核能气质少年 提交于 2021-01-29 04:08:50

问题


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;
}

回答1:


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



来源:https://stackoverflow.com/questions/57200705/error-namespace-cvcuda-has-no-member-resize

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!