Python opencv飞机冷凝尾迹检测

Python opencv aeroplane condensation trail detection

我的任务是检测飞机在蓝天上的凝结轨迹并删除图片中的其他所有内容,但我必须在轨迹周围留下 10 像素宽的区域。

我已经设法使用遮罩和 cv2.drawContours 根据颜色绘制凝结轨迹的轮廓,但我仍然坚持在它周围创建 10 像素的天蓝色区域 - 基本上我必须缩放上轮廓线。

是否可以放大cv2.drawContours命令绘制的等高线?

由于您已经有了轮廓上的点列表,您可以使用 line function between consecutive points (look at the thickness parameter). To fill the rest of the area inside the contour, look at the fillPoly 函数轻松地在其上绘制一条 10 像素粗的线。