我正在尝试使用java中的goodFeatureToTrack
函数检测面部特征。它总是在那里崩溃。这是我的代码:
Mat eyeRegion = detectCascade();//i used here cascadeclassifier to detect eye region
if(eyeRegion.empty())
Log.i("face_calibrated","eye region is empty");
我确保我的地区不是空的。
if(eyeRegion.channels()==1)
{
//i convert my mat to rgb to detectfeatures
Imgproc.cvtColor(eyeRegion, eyeRegion, Imgproc.COLOR_GRAY2RGB);
Log.i("face_calibrated","eyeRegion is channel1");
}
问题在于:
Imgproc.goodFeaturesToTrack(eyeRegion,cornersA,4,0.01,5.0,null,3,false,0.04);
我已将cornersA
声明为全球MatOfPoint
public MatOfPoint cornersA = new MatOfPoint();
此功能应使用哪种输入垫(RGB或GRAY)?