patchMatch2 au propre

master
Ludovic CASTIGLIA 4 months ago
parent 943101b050
commit 5ed4051a8e

@ -4,7 +4,7 @@ from random import randint
import numpy as np import numpy as np
def doPatchMatch(img,x1,y1,x2,y2,patchSize=129): def doPatchMatch(img,x1,y1,x2,y2,patchSize=65):
def getDist(pValue1, pValue2): def getDist(pValue1, pValue2):
return np.sum((pValue1 - pValue2) ** 2) return np.sum((pValue1 - pValue2) ** 2)
@ -139,7 +139,7 @@ def doPatchMatch(img,x1,y1,x2,y2,patchSize=129):
# img[y, x] = [255, 255, 255] # img[y, x] = [255, 255, 255]
# return img # return img
img = plt.imread('asset/vache.png') img = plt.imread('asset/mur.jpg')
if img.dtype == np.float32: if img.dtype == np.float32:
img = (img * 255).astype(np.uint8) img = (img * 255).astype(np.uint8)
img = img[:,:,0:3] img = img[:,:,0:3]

Loading…
Cancel
Save