输入mat在goodFeaturesToTrack中使用

时间:2013-04-25 15:28:35

标签: java opencv

我正在尝试使用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)?

0 个答案:

没有答案