C++ 使用OpenCV和C++;
我正在尝试使用OpenCV将一组图像缝合在一起 我从以下源代码中找到了一些示例代码:,我也包括了这些示例代码:C++ 使用OpenCV和C++;,c++,opencv,image-stitching,C++,Opencv,Image Stitching,我正在尝试使用OpenCV将一组图像缝合在一起 我从以下源代码中找到了一些示例代码:,我也包括了这些示例代码: #include <iostream> #include <fstream> #include "opencv2/highgui/highgui.hpp" #include "opencv2/stitching/stitcher.hpp" using namespace std; using namespace cv; bool try_use_gpu =
#include <iostream>
#include <fstream>
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/stitching/stitcher.hpp"
using namespace std;
using namespace cv;
bool try_use_gpu = false;
vector<Mat> imgs;
string result_name = "result.jpg";
void printUsage();
int parseCmdArgs(int argc, char** argv);
int main(int argc, char* argv[])
{
int retval = parseCmdArgs(argc, argv);
if (retval) return -1;
Mat pano;
Stitcher stitcher = Stitcher::createDefault(try_use_gpu);
Stitcher::Status status = stitcher.stitch(imgs, pano);
if (status != Stitcher::OK)
{
cout << "Can't stitch images, error code = " << status << endl;
return -1;
}
imwrite(result_name, pano);
return 0;
}
#包括
#包括
#包括“opencv2/highgui/highgui.hpp”
#包括“opencv2/stitching/stitcher.hpp”
使用名称空间std;
使用名称空间cv;
bool try\u use\u gpu=false;
向量imgs;
字符串result\u name=“result.jpg”;
无效打印用法();
int-parseCmdArgs(int-argc,字符**argv);
int main(int argc,char*argv[])
{
int-retval=parseCmdArgs(argc,argv);
if(retval)返回-1;
马特帕诺;
Stitcher-Stitcher=Stitcher::createDefault(尝试使用gpu);
缝合器::状态状态=缝合器缝合(imgs,pano);
如果(状态!=缝合器::确定)
{
您是否缺少链接到项目所需的.lib文件。您必须向msvc指定要使用该库,并使其能够找到该文件。嗨,Boyko,谢谢您的回答。您知道msvc需要哪个.lib文件吗?可能是包含您转发声明的函数的文件s(整数argc,字符**argv);