OpenCV Error:This Eigenfaces model is not computed yet

开始使用的opencv3.2版本,并完成了分类器训练,之后切换到了3.3版本,

在人脸识别时一直报错:

D:\opencv3.2\sources\samples\cpp\example_cmake\face-rec\facerec>facerec.exe
begin
frame.empty() 0
OpenCV Error: Unspecified error (This Eigenfaces model is not computed yet. Did
you call Eigenfaces::train?) in predict, file D:\opencv3.3\sources\modules\openc
v_contrib\modules\face\src\eigen_faces.cpp, line 117
terminate called after throwing an instance of 'cv::Exception'
what(): D:\opencv3.3\sources\modules\opencv_contrib\modules\face\src\eigen_fa
ces.cpp:117: error: (-2) This Eigenfaces model is not computed yet. Did you call
Eigenfaces::train? in function predict


This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

经过排查终于查明原因:(版本兼容性问题,api发生了变化)

不能使用3.3版本中不能使用3.2版本生成的训练模型,需重新训练

opencv3.2版本使用是save和load方法

opencv3.3版本使用是write和read方法

转载于:https://www.cnblogs.com/navigate/p/7635678.html

你可能感兴趣的:(OpenCV Error:This Eigenfaces model is not computed yet)