0

我正在尝试用goodFeatureToTrackjava中的函数检测特征。它总是在那里崩溃。这是我的代码:

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 或 GREY)?

4

0 回答 0