gpt4 book ai didi

opencv - cvResize 标识符未定义

转载 作者:太空宇宙 更新时间:2023-11-03 21:02:27 25 4
gpt4 key购买 nike

我所有的 OpenCV 函数都运行良好。但是 cvResize() 没有被编译器找到。我猜这个功能在安装过​​程中没有安装。以下程序告诉我 cvResize identifier is undefined 的错误

这个功能可以单独下载使用吗?如何?

#include "opencv2/highgui/highgui.hpp"
#include <iostream>
#include <ctype.h>
#include <iostream>

using namespace std;

int main( int argc, char** argv )
{

// Create an IplImage object *image
IplImage *source = cvLoadImage( argv[1]);
// Here we retrieve a percentage value to a integer
int percent = atoi(argv[3]);

// declare a destination IplImage object with correct size, depth and channels
IplImage *destination = cvCreateImage
( cvSize((int)((source->width*percent)/100) , (int)((source->height*percent)/100) ), source->depth, source->nChannels );

//use cvResize to resize source to a destination image
cvResize(source, destination);

// save image with a name supplied with a second argument
cvSaveImage( argv[2], destination );

return 0;
}

最佳答案

您缺少一个包含:

#include "opencv2/imgproc/imgproc_c.h"

关于opencv - cvResize 标识符未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13330405/

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