(self, a, aa, b, bb, patch_size)
Initialize Patchmatch Object.
        This method also randomizes the nnf , which will eventually
        be optimized.
Initialize Patchmatch Object.
        This method also randomizes the nnf , which will eventually
        be optimized.
Initialize Patchmatch Object . This method also randomizes the nnf which will eventually be optimized .
def __init__(self, a, aa, b, bb, patch_size):
        """
        Initialize Patchmatch Object.
        This method also randomizes the nnf , which will eventually
        be optimized.
        """
        assert a.shape == b.shape == aa.shape == bb.shape, "Dimensions were unequal for patch-matching input"
        print("called")
        self.A = a.copy(order='C')
        self.B = b.copy(order='C')
        self.AA = aa.copy(order='C')
        self.BB = bb.copy(order='C')
        self.patch_size = patch_size
        self.nnf = np.zeros(shape=(self.A.shape[0], self.A.shape[1],2)).astype(np.int32)  # the nearest neighbour field
        self.nnd = np.random.rand(self.A.shape[0], self.A.shape[1]).astype(np.float32)   # the distance map for the nnf
        self.initialise_nnf()
def __init__ ( self , a , aa , b , bb , patch_size ) : assert a . shape == b . shape == aa . shape == bb . shape , "Dimensions were unequal for patch-matching input" print ( "called" ) self . A = a . copy ( order = 'C' ) self . B = b . copy ( order = 'C' ) self . AA = aa . copy ( order = 'C' ) self . BB = bb . copy ( order = 'C' ) self . patch_size = patch_size self . nnf = np . zeros ( shape = ( self . A . shape [ 0 ] , self . A . shape [ 1 ] , 2 ) ) . astype ( np . int32 ) # the nearest neighbour field self . nnd = np . random . rand ( self . A . shape [ 0 ] , self . A . shape [ 1 ] ) . astype ( np . float32 ) # the distance map for the nnf self . initialise_nnf ( )