24_#浮雕效果

import cv2
import numpy as np
import math
img = cv2.imread('ruonan.jpg',1)
Info = img.shape
height = Info[0]
width = Info[1]
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
dst = np.zeros((height,width,1),np.uint8)
#newp = gray[i,j]- gray[i,j+1]+150
for i in range(0,height):
    for j in range(0,width-1):
        newp = gray[i,j]-gray[i,j+1]+150
        if newp >=255:
            dst[i,j]=255
        else:
            dst[i,j] = newp
cv2.imshow('Dst',dst)
cv2.waitKey(0)

上一篇:19_毛玻璃效果


下一篇:Opencv透视实现图像部分的旋转