rocking5566 / face-detection-MTCNN-ncnn

10 stars 6 forks source link

error: binding ‘const cv::Mat’ to reference of type ‘cv::Mat&’ discards qualifiers #1

Open tomriddle54 opened 5 years ago

tomriddle54 commented 5 years ago

What is the fps if running on pi3 b I need this tow work on pi3 with 15 fps this is the error i am getting when running sh build_ubuntu.sh

Projects/mtcnn_pi/face-detection-MTCNN-ncnn/main.cpp: In function ‘void PlotDetectionResult(const cv::Mat&, const std::vector<SMtcnnFace>&)’:
Projects/mtcnn_pi/face-detection-MTCNN-ncnn/main.cpp:17:86: error: binding ‘const cv::Mat’ to reference of type ‘cv::Mat&’ discards qualifiers
     Point(it->boundingBox[2], it->boundingBox[3]), Scalar(0, 0, 255), 2, 8, 0);
                                                                              ^
In file included from Projects/mtcnn_pi/face-detection-MTCNN-ncnn/main.cpp:3:0:
/usr/include/opencv2/core/core.hpp:2594:19: note:   initializing argument 1 of ‘void cv::rectangle(cv::Mat&, cv::Point, cv::Point, const Scalar&, int, int, int)’
 CV_EXPORTS_W void rectangle(CV_IN_OUT Mat& img, Point pt1, Point pt2,
                   ^
Projects/mtcnn_pi/face-detection-MTCNN-ncnn/main.cpp:22:102: error: binding ‘const cv::Mat’ to reference of type ‘cv::Mat&’ discards qualifiers
 , Point(it->landmark[num], it->landmark[num + 5]), 3, Scalar(0, 255, 255), -1);
                                                                              ^
In file included from Projects/mtcnn_pi/face-detection-MTCNN-ncnn/main.cpp:3:0:
/usr/include/opencv2/core/core.hpp:2604:19: note:   initializing argument 1 of ‘void cv::circle(cv::Mat&, cv::Point, int, const Scalar&, int, int, int)’
 CV_EXPORTS_W void circle(CV_IN_OUT Mat& img, Point center, int radius,
                   ^
CMakeFiles/mtcnn.dir/build.make:62: recipe for target 'CMakeFiles/mtcnn.dir/main.o' failed
make[2]: *** [CMakeFiles/mtcnn.dir/main.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mtcnn.dir/all' failed
make[1]: *** [CMakeFiles/mtcnn.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
tomriddle54 commented 5 years ago

@rocking5566 Hello, To solve the above i have changed void PlotDetectionResult(const Mat& frame, const std::vector<SMtcnnFace>& bbox) to void PlotDetectionResult( Mat& frame, const std::vector<SMtcnnFace>& bbox) when I ran the code getting new error output but frame is showing

find_blob_index_by_name data failed
find_blob_index_by_name prob1 failed
find_blob_index_by_name conv4-2 failed
find_blob_index_by_name data failed
find_blob_index_by_name prob1 failed
find_blob_index_by_name conv4-2 failed
find_blob_index_by_name data failed
find_blob_index_by_name prob1 failed
find_blob_index_by_name conv4-2 failed
find_blob_index_by_name data failed
find_blob_index_by_name prob1 failed
find_blob_index_by_name conv4-2 failed
find_blob_index_by_name data failed
find_blob_index_by_name prob1 failed
find_blob_index_by_name conv4-2 failed
time = 2.71793 ms, FPS = 367.927, Average time = 4.65271