同样的问题
OpenCV Error: Null pointer (NULL or empty buffer) in cvOpenFileStorage, file /root/opencv-2.4.13/modules/core/src/persistence.cpp, line 2696
terminate called after throwing an instance of 'cv::Exception'
what(): /root/opencv-2.4.13/modules/core/src/persistence.cpp:2696: error: (-27) NULL or empty buffer in function cvOpenFileStorage
刚开始安装时有如下报错
checking for opencv.pc file in default path... found in /usr/local/lib/pkgconfig
configure: error: no result from pkg-config opencv --libs --cflags opencv
原因:
root# pkg-config opencv --libs --cflags opencv
返回
-I/usr/local/include/opencv -I/usr/local/include /usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_ocl.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_superres.so /usr/local/lib/libopencv_ts.a /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so -lrt -lpthread -lm -ldl
多了一个 /usr/local/lib/libopencv_ts.a
修改config.m4
elif test ${i:${#i}-3} = ".so" ;then
dir_name=dirname $i
file_name=${i/$dir_name/}
file_name=${file_name//lib/}
file_name=${file_name/.so/}
PHP_ADD_LIBRARY_WITH_PATH($file_name,$dir_name,TCLIP_SHARED_LIBADD)
elif test ${i:${#i}-2} = ".a" ;then
dir_name=dirname $i
file_name=${i/$dir_name/}
file_name=${file_name//lib/}
file_name=${file_name/.a/}
PHP_ADD_LIBRARY_WITH_PATH($file_name,$dir_name,TCLIP_SHARED_LIBADD)
增加静态链接库的处理
编译通过,但最后还是报这个错误!