Мой учитель предоставил мне исходный код проекта, который, возможно, основан на OpenCV 2 или 3 .
Я пытался запустить его, но получаю сообщение об ошибке: 'cvSaveImage' было не заявлен в этой области. Примерно так:
root@qrh-pc:/home/qrh/文档/TrafficSignQtProgram/build# make
Scanning dependencies of target TREFFIC_SIGN_QT_PROJECT
[ 3%] Building CXX object bin/CMakeFiles/TREFFIC_SIGN_QT_PROJECT.dir/Camera.cpp.o
/home/qrh/文档/TrafficSignQtProgram/TrafficSignBlockCalProject/src/Camera.cpp: In member function ‘void CCamera::renderImage()’:
/home/qrh/文档/TrafficSignQtProgram/TrafficSignBlockCalProject/src/Camera.cpp:380:5: error: ‘cvSaveImage’ was not declared in this scope
cvSaveImage(imageSaveFileName.c_str(), img);
^~~~~~~~~~~
/home/qrh/文档/TrafficSignQtProgram/TrafficSignBlockCalProject/src/Camera.cpp:380:5: note: suggested alternative: ‘cvShowImage’
cvSaveImage(imageSaveFileName.c_str(), img);
^~~~~~~~~~~
cvShowImage
/home/qrh/文档/TrafficSignQtProgram/TrafficSignBlockCalProject/src/Camera.cpp: In member function ‘void CCamera::renderImage(CameraParams, pcl::PointCloud<pcl::PointXYZRGBL>::Ptr, pcl::PointIndices&)’:
/home/qrh/文档/TrafficSignQtProgram/TrafficSignBlockCalProject/src/Camera.cpp:511:5: error: ‘cvSaveImage’ was not declared in this scope
cvSaveImage(imageSaveFileName.c_str(), img);
^~~~~~~~~~~
/home/qrh/文档/TrafficSignQtProgram/TrafficSignBlockCalProject/src/Camera.cpp:511:5: note: suggested alternative: ‘cvShowImage’
cvSaveImage(imageSaveFileName.c_str(), img);
^~~~~~~~~~~
cvShowImage
/home/qrh/文档/TrafficSignQtProgram/TrafficSignBlockCalProject/src/Camera.cpp: In member function ‘void CCamera::renderImageCalOccludeCloud(CameraParams, pcl::PointCloud<pcl::PointXYZRGBL>::Ptr, pcl::PointCloud<pcl::PointXYZRGBL>::Ptr)’:
/home/qrh/文档/TrafficSignQtProgram/TrafficSignBlockCalProject/src/Camera.cpp:659:5: error: ‘cvSaveImage’ was not declared in this scope
cvSaveImage(imageSaveFileName.c_str(), img);
^~~~~~~~~~~
/home/qrh/文档/TrafficSignQtProgram/TrafficSignBlockCalProject/src/Camera.cpp:659:5: note: suggested alternative: ‘cvShowImage’
cvSaveImage(imageSaveFileName.c_str(), img);
^~~~~~~~~~~
cvShowImage
bin/CMakeFiles/TREFFIC_SIGN_QT_PROJECT.dir/build.make:81: recipe for target 'bin/CMakeFiles/TREFFIC_SIGN_QT_PROJECT.dir/Camera.cpp.o' failed
make[2]: *** [bin/CMakeFiles/TREFFIC_SIGN_QT_PROJECT.dir/Camera.cpp.o] Error 1
CMakeFiles/Makefile2:133: recipe for target 'bin/CMakeFiles/TREFFIC_SIGN_QT_PROJECT.dir/all' failed
make[1]: *** [bin/CMakeFiles/TREFFIC_SIGN_QT_PROJECT.dir/all] Error 2
Makefile:102: recipe for target 'all' failed
make: *** [all] Error 2
root@qrh-pc:/home/qrh/文档/TrafficSignQtProgram/build#
OpenV C 3.4 - моя версия, я пытался включить много головных уборов, но это не работает.
#include "opencv2/opencv.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/videoio.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/imgproc/imgproc.hpp"
#include <opencv2/imgcodecs.hpp>