forked from lionfish0/btretrodetect
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
When we get around to making unit tests, this would be one:
from btretrodetect import rescalePatch
def slowRescalePatch(im,x,y,patchSize,blocksize):
a = im.repeat(blocksize,axis=0).repeat(blocksize,axis=1)
return a[y-patchSize:y+patchSize,x-patchSize:x+patchSize]
im = np.random.randn(300,200)
for blocksize in [1,2,4,8]:
for patchSize in [1,2,4,8,16,32]:
for x in [101,160,54]:
for y in [56,61,72]:
im1 = slowRescalePatch(im,x,y,patchSize,blocksize)
im2 = rescalePatch(im,x,y,patchSize,blocksize)
assert np.all(im1==im2)
Metadata
Metadata
Assignees
Labels
No labels