gpt4 book ai didi

c++ - 错误 : namespace "cv::cuda" has no member "resize"

转载 作者:行者123 更新时间:2023-12-02 10:38:30 35 4
gpt4 key购买 nike

我已经使用 WITH_CUDA=on 成功构建了 opencv。但我仍然面临这个错误error: namespace "cv::cuda"has no member "resize"。奇怪的是,IDE 提示我在该命名空间中有一个调整大小的函数,但它在编译时失败了。有谁知道如何解决这个问题?

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

最佳答案

正如@john 指出的那样。我应该#include <opencv2/cudawarping.hpp>解决问题。

关于c++ - 错误 : namespace "cv::cuda" has no member "resize",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57200705/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com