# AUTOGENERATED! DO NOT EDIT! File to edit: io.ipynb (unless otherwise specified).

__all__ = ['imread', 'load_pts']

# Cell
import cv2
import numpy as np
import os
def imread(path):
    return cv2.cvtColor(cv2.imread(path), cv2.COLOR_BGR2RGB)

def load_pts(fname):
    if os.path.isfile(fname):
        arr = np.loadtxt(fname)
        assert arr.shape[1] == 4
    elif os.path.isfile(fname.replace('corrs.txt', 'pts.txt')):
        arr = np.loadtxt(fname.replace('corrs.txt', 'pts.txt'))
        assert arr.shape[1] == 4
    else:
        arr = np.empty((0,4))
    return arr