异常内核库.dll.
Exception KernelBase.dll
我正在使用Visual Studio 2010和OpenCV 3.0。
以下代码尝试提取 HOG 特征以训练 SVM 分类器。但是,当我尝试在行中使用 HOG 的函数"计算"时
hog.compute(grayImg,descriptor,Size(),Size(),position);
出现以下错误:
TrainSVM.exe 中 0x000007fefd9bb16d (KernelBase.dll) 中的未处理异常:Exception de Microsoft C++: cv::Exception at memory location 0x0026e1b0.
String imagesPath = "Positivas/*.jpg";
vector<String> fn;
glob(imagesPath, fn, true); // recursive, if you want
for (size_t i=0; i<fn.size(); i++)
{
Mat img = imread(fn[i]);
std::vector<cv::Point> positions;
positions.push_back(cv::Point(0,0));
std::vector<float> descriptor;
cv::Mat grayImg;//(patchHeight,patchWidth,CV_8UC1,0);
cvtColor( img, grayImg, COLOR_BGR2GRAY );
hog.compute(grayImg,descriptor,Size(),Size(),positions);
Mat auxDescriptor = cv::Mat(descriptor);
Mat descriptorMat(1,auxDescriptor.rows,CV_32FC1);
transpose(auxDescriptor, descriptorMat);
trainingData.push_back(descriptorMat);
trainingLabels.push_back(labelPositive);
}
对此有什么想法吗?提前感谢!
收到异常消息后,我们发现对alignSize
的调用中断言失败。alignSize
的文档要求参数为2的幂。从那里,我们查看了hog.compute
的文档,发现它需要的窗口大小是 2 的幂。
相关文章:
- 挂起和取消挂起一个文件DLL
- std::threads可以从Windows DLL中的全局变量创建/销毁吗?
- 导入库可以跨dll版本工作吗
- 从C++dll访问C#中的一行主要参数
- 链接到自行创建的dll失败
- 为什么使用 P/Invoke 调用 dll 时,某些计算机中的 LoadLibrary 失败?
- 在调用FreeLibrary后,释放动态链接到具有相同版本的CRT堆的DLL的内存
- 如何指定我希望我的LIB链接到的DLL文件?-Visual Studio 2019
- 如何在内核C++中使用1920x1080x16M图形或类似的16M颜色?(VGA)
- 如何将图像传输到c++(dll)中的缓冲区,然后在c#的缓冲区中读/写
- CUDA内核和数学函数的显式命名空间
- 码头化的C++应用程序是否向后兼容早期的内核版本
- C++:将外部库链接到dll库
- 在 Windows 上,是否可以让 dll 在不使用 PATH 环境变量的情况下在另一个文件夹中查找依赖项?
- 不同的Visual Studio版本中缺少.dll
- 从DLL中删除类的实例
- 如何包装第三方DLL在R中使用
- 异常内核库.dll.
- 在内核模式下运行dll
- DirectXTK -过程入口点CreateFile2无法在内核32.dll中找到