-
opencv绘制简单图片
import cv2 as cv
import numpy as np
# img = np.zeros((图片高度, 图片宽度, 三维矩阵), np.uint8)
img = np.zeros((512, 512, 3), np.uint8)
"""img类型为<class 'numpy.ndarray'>"""
for x in range(512):
for y in range(512):
if x <= 512//3:
img[x][y] = [0, 0, 255]
elif x <= 2*521//3:
img[x][y] = [0, 255, 0]
elif x <= 521:
img[x][y] = [255, 0, 0]
print(type(img))
cv.imshow("Image", img)
cv.waitKey(0)
cv.destroyAllWindows()
最后
以上就是自然摩托最近收集整理的关于opencv绘制简单图片opencv绘制简单图片的全部内容,更多相关opencv绘制简单图片opencv绘制简单图片内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复