美文网首页
11颜色风格(颜色增强)

11颜色风格(颜色增强)

作者: 犬夜叉写作业 | 来源:发表于2019-07-17 15:34 被阅读0次
    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)
    

    相关文章

      网友评论

          本文标题:11颜色风格(颜色增强)

          本文链接:https://www.haomeiwen.com/subject/zmoqlctx.html