猫史档案馆


【Python作品分享】eeeee

用户:AngelaPeffiroAngelaPeffiro查看:0 回复:0 评论:0 创建时间:2021-06-12T20:48:50


【作品展示】

center_image

 

【作品介绍】

nive

 

【作品源代码】

import cv2 as cv
import numpy as np
image=cv.imread("rainbow.jpg")
w,h=image.shape[:2]
#建立新图像的大小
map1=np.zeros((w,h),np.float32)
map2 = np.zeros((w, h), np.float32)
#实现新图像的访问操作
for i in range(w):
    for j in range(h):
#访问图像
        map1.itemset((i,j),j)
        map2.itemset((i,j),w-1-i)
rst=cv.remap(image,map1,map2,cv.INTER_LINEAR)
#实现图像绕x轴反转
cv.imshow("image",image)
cv.imshow("rst",rst)
cv.waitKey()
cv.destroyAllWindows()

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页