示例#1
0
def main():
    parser = argparse.ArgumentParser(description='Deblur image')
    parser.add_argument('-d','--data', help='Input data image')
    parser.add_argument('-o','--output', help='Output image')

    #START: Stage 0 load the image
    args = parser.parse_args()
    input_name = args.data
    img = cv2.imread(input_name)
    fig = plt.figure()
    ax1 = fig.add_subplot(2,2,1)
    ax1.imshow(img)

    #Stage 1 add padding
    img,y,x = add_padding(img)

    #Stage 2 openCV optimization

    #Stage 3 Machine Learning Deblur
    model = NeuralNet()
    img = model.predict(img)

    #Stage 4 More openCV

    #End
    ax2 = fig.add_subplot(2,2,2)
    img = remove_padding(img,x,y)
    ax2.imshow(img)
    plt.show()