OpenCV 边缘增强
我正在执行背景减法,以从视频中获取一辆移动的汽车,如下所示(运行平均背景建模)
我在此之后应用 findContours() 在汽车周围绘制一个多边形。
正如您所看到的,获得的输出的质量并不好。有什么方法可以增强汽车的边缘,使其更加突出,并消除周围的无关噪音。我尝试执行形态闭合(扩张 -> 侵蚀)来填补空白,但输出不符合预期。
I am performing background subtraction to obtain a moving car from a video as below ( Running average background modeling)
I am applying findContours() after this to draw a polygon around the car.
As you can see, the quality of the obtained output is not great. Is there any way I can enhance the edges of the car to make it more prominent and cut out the extraneous noise surrounding it. I tried performing morphological closing(dilate -> erode) to fill the gaps, but the output was not as expected.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这可能有点矫枉过正,远不是一个快速的解决方案,但水平集方法非常适合提取预先分割的汽车。
This might be overkill and far from a quick solution but Level Set Methods would be very suited to extract the presegmented car.
您可以尝试使用
cv2.createBackgroundSubtractorMOG2()
应用背景扣除。代码:
You can try to apply background subtraction by using
cv2.createBackgroundSubtractorMOG2()
.Code: