我的要求是我需要从给定的 cctv 图像中检测人脸。cctv图像中会有不必要的物体需要去除。如果得到的人脸图像是模糊的也需要提高质量
目前我们正在尝试使用opencv API,代码如下
CascadeClassifier cascadeClassifier = new
CascadeClassifier("haarcascade_profileface.xml");
Mat image=Highgui.imread("testing.jpg");
MatOfRect bodyDetections = new MatOfRect();
cascadeClassifier.detectMultiScale(image, bodyDetections);
for (Rect rect : bodyDetections.toArray()) {
BufferedImage croppedImage = originalPic.getSubimage(rect.x,
rect.y,rect.width,rect.height); **unable to detect the body coordinates
here**
}
在上述方法中,图像的多个对象被检测为人脸,这是错误的。
在 cctvc 图像中如果只有侧面如何提取完整的脸部?
请建议实现我的要求的最佳方法。
谢谢 IMGen