我已经根据本教程创建了程序 http://docs.opencv.org/2.4/modules/contrib/doc/facerec/tutorial/facerec_video_recognition.html 我以 .jpg 格式添加了自己的图像。但是一个目录中的某些图像(我有 3 个不同的目录,其中包含不同的人物照片)可能是错误的,我不知道为什么。我收到此错误:
OpenCV Error: Unsupported format or combination of formats (In the Fisherfaces method all input samples (training images) must be of equal size! Expected 921600 pixels, but was 1228800 pixels.) in cv::Fisherfaces::train, file C:\buildslaves64\win64_amdocl\2_4_PackSlave-win64-vc11-shared\opencv\modules\contrib\src\facerec.cpp, line 564
我使用 VS C++ 2012 和来自 openCV 2.4.7 的 vc11 库。有人可以帮我解决这个问题吗?
最佳答案
我解决了这个问题。这是图像大小的错误。程序需要 921600(它是 1280px x 720px)并且错误的图像有错误的大小。它们的大小或大或小,但不相等。我将它们全部格式化为 1280x720,它开始工作了。 所有训练图像的大小必须相同。
关于c++ - OpenCV - 不支持的格式或格式组合错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41537413/