1、扩图

import cv2
import numpy as np
img=cv2.imread('Test2.jpg',1)
width=img.shape[0]
height=img.shape[1]
dst=np.zeros((200,200,3),np.uint8)
for i in range(200):
    for j in range(200):
        if i>30 and j>30 and i<190 and j<120:
            print(i,j)
            dst[i,j]=img[i-30,j-30]
        else:
            dst[i,j]=(111,111,111)

cv2.imshow('dst',dst)
cv2.imshow('src',img)
redst=cv2.resize(dst,(64,128))
cv2.imwrite('34.jpg',redst,[cv2.IMWRITE_JPEG_QUALITY,100])
cv2.waitKey(0)

 

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄