首页 > 编程知识 正文

ppt片镜像,手机片镜像翻转软件

时间:2023-05-05 04:32:16 阅读:270650 作者:2394

import cv2import numpy as npimg = cv2.imread('test0.png',1)cv2.imshow('src', img)imgInfo = img.shapeheight = imgInfo[0]width = imgInfo[1]deep = imgInfo[2]newImgInfo = (height*2,width,deep)dst = np.zeros(newImgInfo, np.uint8)for i in range(height): for j in range(width): dst[i,j] = img[i,j] # 绘制上半部分 dst[height*2-i-1,j] = img[i,j] # 绘制镜像部分for i in range(width): # 绘制中间红线 dst[height,i] = (0,0,255) # Redcv2.imshow('image',dst)cv2.waitKey(0)

效果如下:

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。