我正在尝试使用 opencv 进行面部识别。为此,训练和测试图像的大小必须相同。所以我使用了这个功能:
resize(testing,output, images[0].size(),0,0,INTER_NEAREST);
其中 testing 是我来自网络摄像头的 Mat , Output 是调整大小的图像 , images[0].size() 是我的矢量图像数据库。但是我收到以下错误:
OpenCV Error: Bad argument (Wrong shapes for given matrices. Was size(src) = (1,921600),
size(W) = (307200,6).) in subspaceProject,
file /home/someplae/OpenCV-2.4.2/modules/contrib/src/lda.cpp,
line 187
terminate called after throwing an instance of 'cv::Exception'
what(): /home/someplace/OpenCV-2.4.2/modules/contrib/src/lda.cpp:187:
error: (-5) Wrong shapes for given matrices. Was size(src) = (1,921600), size(W) = (307200,6).
in function subspaceProject