fin des test

test
ludovic.castglia 4 months ago
parent 47e1fe1f1e
commit dfeb21d5a4

@ -79,16 +79,19 @@ def doPatchMatch(img,x1,y1,x2,y2,patchSize=17,nbRadomPatch=10):
ogDist = dists[minIdx]
foundNew = True
step = patchSize*5
step = 5
addr = addr[0]
while foundNew:
foundNew, tpatch, tpatchValue, tdist = getBestNeigbourPatch(addr[0],ogValue,ogDist,step)
foundNew, tpatch, tpatchValue, tdist = getBestNeigbourPatch(addr,ogValue,ogDist,step)
if (foundNew):
addr = tpatch[patchSize//2]
patch = tpatch
patchValue = tpatchValue
ogDist = tdist
step = 5
else:
step = int(step/2)
foundNew = step > 0
step = step*1.25
foundNew = step < min(width, height)/2
return patch, patchValue
@ -182,11 +185,6 @@ def doPatchMatch(img,x1,y1,x2,y2,patchSize=17,nbRadomPatch=10):
img = plt.imread('boat.png')
if len(img.shape) == 2:
@ -198,7 +196,7 @@ def onselect(eclick, erelease):
print("drawing")
img_copy = np.copy(img)
res = doPatchMatch(img_copy,int(x1),int(y1),int(x2),int(y2))
res = doPatchMatch(img_copy,int(x1),int(y1),int(x2),int(y2),33)
ax.imshow(res)
plt.draw()
print("drawed")

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Loading…
Cancel
Save