Android OpenCV边缘检测
问题描述:
我在Android上使用OpenCV进行车牌识别。作为该过程的一部分,我使用Canny边缘检测来查找图像中的边缘。我遇到的问题是图像中的水平边缘没有被检测为实线。的问题是,由于线不是固体我不能将其检测为一个轮廓Android OpenCV边缘检测
这是我正在运行上
此边缘检测图像的边缘检测的结果。正如你所看到的,车牌的垂直边缘已经被检测为实线,但水平线是虚线的。
这是我的代码
org.opencv.imgproc.Imgproc.Canny(snapshot.getImage(), dst,
Configurator.PlateDetectCannyThreshold1,
Configurator.PlateDetectCannyThreshold2,
Configurator.PlateDetectCannyApperture);
List<Mat> contours = new Vector<Mat>();
org.opencv.imgproc.Imgproc.findContours(dst, contours, new Mat(),
org.opencv.imgproc.Imgproc.CV_RETR_LIST,
org.opencv.imgproc.Imgproc.CV_CHAIN_APPROX_SIMPLE,
new org.opencv.core.Point(0, 0));
答
我遇到了类似的问题,当我实现文档边缘检测和使用形态扩张边缘更好的检测:
Mat kernel = Imgproc.getStructuringElement(Imgproc.MORPH_DILATE, new Size(3,3), new Point(1,1));
Imgproc.dilate(mIntermediateMat, mIntermediateMat, kernel);
您在坎尼坏阈值。降低他们一点。 – Sam 2012-03-21 14:18:05
我试过了。我应该提到我的上限是300,上面的图像是下限是0,但是我已经将上面的图像逐渐降低到0,并且没有区别 – 2012-03-21 14:36:24
上限应该设置在40左右的某个位置上120,下限为0.4 *上限或上限/ 3。我认为读一点总是很好的。 google上的'wiki canny',以及阅读canny如何工作。这很重要 – Sam 2012-03-21 14:42:34