如下代码,我已经将cv2绘制的轮廓图显示出来了,请问如何将带轮廓的图保存为本地图片?
contours, hierarchy = cv2.findContours(bw_image, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
mark = cv2.drawContours(pri_image, contours, -1, (255, 0, 0), 1)
cv2.imshow('drawimg', mark)
如下代码,我已经将cv2绘制的轮廓图显示出来了,请问如何将带轮廓的图保存为本地图片?
contours, hierarchy = cv2.findContours(bw_image, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
mark = cv2.drawContours(pri_image, contours, -1, (255, 0, 0), 1)
cv2.imshow('drawimg', mark)
用cv2.imwrite('drawimg.png', mark)就能保存图片了,可以参考:
https://blog.csdn.net/qq_28413479/article/details/78088981