滤镜竟然这么容易

import cv2
import numpy as np
img = cv2.imread('image0.jpg',1)
cv2.imshow('src',img)
imgInfo = img.shape
height = imgInfo[0]
width = imgInfo[1]
#rgb -》RGB new “蓝色”
# b=b*1.5
# g = g*1.3
dst = np.zeros((height,width,3),np.uint8)
for i in range(0,height):
    for j in range(0,width):
        (b,g,r) = img[i,j]
        b = b*1.5
        g = g*1.3
        if b>255:
            b = 255
        if g>255:
            g = 255
        dst[i,j]=(b,g,r)
cv2.imshow('dst',dst)
cv2.waitKey(0)

猜你喜欢

转载自blog.csdn.net/qq_30339595/article/details/86631122