def METHOD_NAME(image, size):
    H, W = image.shape[:2]
    if H >= W:
        nW = size
        nH = int(float(H)/W * size)
    else:
        nH = size
        nW = int(float(W)/H * size)
    #print("nW:nH=",nW,nH)
    return cv2.resize(image,(nW,nH))