modules/utils.py
def embed(im, embedsize):
    '''
        Embed a small image centrally into a larger window.

        Inputs:
            im: Image to embed
            embedsize: 2-tuple of window size

        Outputs:
            imembed: Embedded image
    '''

    Hi, Wi = im.shape
    He, We = embedsize

    dH = (He - Hi)//2
    dW = (We - Wi)//2

    imembed = np.zeros((He, We), dtype=im.dtype)
    imembed[dH:Hi+dH, dW:Wi+dW] = im

    return imembed

        Embed a small image centrally into a larger window.

        Inputs:
            im: Image to embed
            embedsize: 2-tuple of window size

        Outputs:
            imembed: Embedded image
    
Embed a small image centrally into a larger window.
Inputs:
im: Image to embed
embedsize: 2-tuple of window size

Embedded image
Embed a small image centrally into a larger window . Inputs : im : Image to embed embedsize : 2 - tuple of window size Embedded image
def embed(im, embedsize):
    Hi, Wi = im.shape
    He, We = embedsize
    dH = (He - Hi)//2
    dW = (We - Wi)//2
    imembed = np.zeros((He, We), dtype=im.dtype)
    imembed[dH:Hi+dH, dW:Wi+dW] = im
    return imembed
def embed ( im , embedsize ) : Hi , Wi = im . shape He , We = embedsize dH = ( He - Hi ) // 2 dW = ( We - Wi ) // 2 imembed = np . zeros ( ( He , We ) , dtype = im . dtype ) imembed [ dH : Hi + dH , dW : Wi + dW ] = im return imembed
Embed a small image centrally into a larger window.
Embed a small image centrally into a larger window .
'''
        Embed a small image centrally into a larger window.

        Inputs:
            im: Image to embed
            embedsize: 2-tuple of window size

        Outputs:
            imembed: Embedded image
    '''
im
embedsize