how to speed up detection using gray image ?
e-snail opened this issue · comments
There is a TODO in "jni/jni_detections/detector.h", saying:
// TODO : Convert to gray image to speed up detection
// It's unnecessary to use color image for face/landmark detection
I tried to use gray image with following code:
cv::cvtColor(bgrMat, grayMat, cv::COLOR_BGR2GRAY);
dlib::cv_image<unsigned char> img(image); //image has only 1 channel
It seems does NOT work in speeding up detection.
How to fix it ?
Thanks a lot !
Please, read previous issues instead of creating new ones. It is highly probable that was asked before. Please refer to this issue, you will find the solution: #46
Thanks!
I followed the method u mentioned, another error came out:
E/cv::error(): OpenCV Error: Assertion failed (!fixedType() || ((Mat*)obj)->type() == mtype) in void cv::_OutputArray::create(cv::Size, int, int, bool, int) const, file /Volumes/Linux/builds/master_pack-android/opencv/modules/core/src/matrix.cpp, line 2191
when executing
cv::cvtColor(image, image, CV_BGR2GRAY);