Opencv 基于cv-android的目标检测
我使用Open CV检测对象的边缘。当我用相机拍摄图像时,也应用了canny边缘形态学运算,但并没有给出物体的实际边缘点。如何获得这一点?您可以使用其他边缘检测算法或不同的阈值进行边缘检测 我正在使用膨胀、高斯模糊和膨胀进行边缘检测Opencv 基于cv-android的目标检测,opencv,Opencv,我使用Open CV检测对象的边缘。当我用相机拍摄图像时,也应用了canny边缘形态学运算,但并没有给出物体的实际边缘点。如何获得这一点?您可以使用其他边缘检测算法或不同的阈值进行边缘检测 我正在使用膨胀、高斯模糊和膨胀进行边缘检测 Imgproc.GaussianBlur(imgSource, imgSource, new Size(11, 11), 0); // Imgproc.Canny(imgSource, imgSource, 20, 60); //
Imgproc.GaussianBlur(imgSource, imgSource, new Size(11, 11), 0);
// Imgproc.Canny(imgSource, imgSource, 20, 60);
// 2) AdaptiveThreshold -> classify as either black or white
Imgproc.adaptiveThreshold(imgSource, imgSource, 255,
Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY, 5, 2);
// 3) Invert the image -> so most of the image is black
Core.bitwise_not(imgSource, imgSource);
// 4) Dilate -> fill the image using the MORPH_DILATE
Mat kernel = Imgproc.getStructuringElement(Imgproc.MORPH_DILATE,
new Size(3, 3), new Point(1, 1));
Imgproc.dilate(imgSource, imgSource, kernel);
请任何人都知道这对android尽快给出答案。。。