图像处理-C++Dlib load_image_dataset问题
image processing - C++ Dlib load_image_dataset issues
当使用dlibs load_image_dataset加载一组图像时,如下所示:
//------------
command_line_parser parser;
parser.parse(argc, argv); //inputs argc, argv as defined by main where argv is an .xml containing all file locations
dlib::array<array2d<rgb_pixel> > images;
std::vector<std::vector<rectangle> > object_locations, ignore;
cout << "Loading image dataset from metadata file " << parser[1] << endl;
ignore = load_image_dataset(images, object_locations, parser[1]);
cout << "Number of images loaded: " << images.size() << endl;
//---------------
我得到以下错误:
"dlib::array2d<T, mem_manager> &dlib::array2d<T, mem_manager>::operator=(dlib::array2d<T, mem_manager> &) [with T=dlib::rgb_pixel, mem_manager=dlib::default_memory_manager]" (declared at line 320 of "C:..path-to-dlib...dlib-18.16dlib..dlib/image_processing/../image_processing/../matrix/../array2d/array2d_kernel.h") is inaccessible
如果我试图从"图像"中存储单个图像,如下所示:
//--------
array2d<rgb_pixel> img;
img = images[i];
//-----------
但没有错误,如果我只是显示它:
//------
image_window image_i(images[i], "Image i");
//---------
发生了什么,我该如何解决?
array2d在设计上是不可复制的,因为复制图像成本高昂,而且几乎总是不必要的。如果要移动图像,请使用swap()。如果确实需要复制图像,则可以使用assign_image()函数,也可以使用矩阵对象(可复制)来表示图像,而不是array2d。
但实际上,不要不必要地复制图像。
相关文章:
- 警告处理为错误这里有什么问题
- 最小硬币更换问题(自上而下方法)
- 为"adjacent"变量赋值时出现问题
- 我的神经网络不起作用 [XOR 问题]
- 在Ubuntu 16.04上安装Cilk时出现问题
- C++我的数学有什么问题,为什么我的代码不能正确循环
- 编译包含字符串的代码时遇到问题
- Project Euler问题4的错误解决方案
- 问题:什么是QAbstractItemView::NoEditTriggers的反面
- 在编译C++代码(具有dlib和opencv)到WASM时面临问题
- 在进程中对同一管道进行读取和写入时C++管道出现问题
- 静态数据成员的问题-修复链接错误会导致编译器错误
- C++ 雷神库 - 使用资源加载器类时出现问题(不命名类型)
- 一个关于在C++中重载布尔运算符的问题
- 首要问题的答案让值班员搞错了
- setlocale的C++土耳其字符串问题
- 如何重构类层次结构以避免菱形问题
- 基于boost的程序的静态链接——zlib问题
- C++格式化输出问题
- 使用mongocxx驱动程序时包含头文件问题