我想用不同的方法来检测车牌候选人,但是在尝试了几次之后,我还是被困住了。我不知道我的方法是否正确。
我正在处理HSV图像模型.
到目前为止我对已知方法的看法。
我不想把注意力集中在方法3上,因为其他人正在研究它。我应该在某个地方使用连接组件分析吗?
我使用高斯模糊和自适应阈值的BlackHat和TopHat操作来进行图像预处理。这是我的代码:
imgHSV = np.zeros((self.height, self.width, 3), np.uint8)
imgHSV = cv.cvtColor(self.image, cv.COLOR_BGR2HSV)
_, _, self.imgValue = cv.split(imgHSV)
imgTopHat = np.zeros((self.height, self.width, 1), np.uint8)
imgBlackHat = np.zeros((self.height, self.width, 1), np.uint8)
structuringElement = cv.getStructuringElement(cv.MORPH_RECT, (3, 3))
imgTopHat = cv.morphologyEx(self.imgValue, cv.MORPH_TOPHAT, structuringElement)
imgBlackHat = cv.morphologyEx(self.imgValue, cv.MORPH_BLACKHAT, structuringElement)
imgGrayscalePlusTopHat = cv.add(self.imgValue, imgTopHat)
imgGrayscaleHSV = cv.subtract(imgGrayscalePlusTopHat, imgBlackHat)
imgBlurred = np.zeros((self.height, self.width, 1), np.uint8)
imgBlurred = cv.GaussianBlur(imgGrayscaleHSV, GAUSSIAN_SMOOTH_FILTER_SIZE, 0)
thresholdedImage = cv.adaptiveThreshold(imgBlurred, 255.0, cv.ADAPTIVE_THRESH_GAUSSIAN_C, cv.THRESH_BINARY_INV, ADAPTIVE_THRESH_BLOCK_SIZE, ADAPTIVE_THRESH_WEIGHT)
通过对图像进行预处理,即对图像进行提取后,进行TopHat和BlackHat运算,进行高斯模糊和自适应阈值处理。我试着用simpleBlob来查找openCV,但是它不能很好地处理预先准备好的图像。在边缘检测方面,我采用了精明的边缘检测方法,并实现了sobel边缘检测。
示例处理的图像(我还没有足够的声誉发布图像.)
我希望输出的图像与潜在的板块候选人的轮廓,但我不能得到适当的转换图像与工作。我该怎么办?如何应用转换(以及类型)。
https://stackoverflow.com/questions/54329089
复制相似问题