public Mat onCameraFrame(Mat aInputFrame) {
Imgproc.cvtColor(aInputFrame, grayscaleImage, Imgproc.COLOR_RGBA2RGB);
MatOfRect faces = new MatOfRect();
if (cascadeClassifier != null) {
cascadeClassifier.detectMultiScale(grayscaleImage, faces, 1.1, 2, 2,
new Size(absoluteFaceSize, absoluteFaceSize), new Size());
}
ArrayList<MatOfPoint2f> landmarks = new ArrayList<MatOfPoint2f>();
fm.fit(grayscaleImage, faces, landmarks)
...
return aInputFrame;
}
我遇到下一个错误: 未找到面孔。在函数cv :: face :: FacemarkKazemiImpl :: fit中终止..
答案 0 :(得分:0)
public Mat onCameraFrame(Mat aInputFrame) {
Imgproc.cvtColor(aInputFrame, grayscaleImage, Imgproc.COLOR_RGBA2RGB);
MatOfRect faces = new MatOfRect();
if (cascadeClassifier != null) {
cascadeClassifier.detectMultiScale(grayscaleImage, faces, 1.1, 2, 2,
new Size(absoluteFaceSize, absoluteFaceSize), new Size());
}
if(faces.empty())
return aInputFrame;
ArrayList<MatOfPoint2f> landmarks = new ArrayList<MatOfPoint2f>();
fm.fit(grayscaleImage, faces, landmarks)
...
return aInputFrame;
}