(self, filepath, cid=2)
return proj_c2p, proj_v2c
Read in a calibration file and parse into a dictionary.
Read in a calibration file and parse into a dictionary.
Read in a calibration file and parse into a dictionary .
def read_calib_file(self, filepath, cid=2): # cid=2 and cid=3 has the same intrinsics
        """Read in a calibration file and parse into a dictionary."""
        with open(filepath, 'r') as f:
            C = f.readlines()
        def parseLine(L, shape):
            data = L.split()
            data = np.array(data[1:]).reshape(shape).astype(np.float32)
            return data
        proj_c2p = parseLine(C[cid], shape=(3,4))
        proj_v2c = parseLine(C[-1], shape=(3,4))
        filler = np.array([0, 0, 0, 1]).reshape((1,4))
        proj_v2c = np.concatenate((proj_v2c, filler), axis=0)
        return proj_c2p, proj_v2c
def read_calib_file ( self , filepath , cid = 2 ) : # cid=2 and cid=3 has the same intrinsics with open ( filepath , 'r' ) as f : C = f . readlines ( ) def parseLine ( L , shape ) : data = L . split ( ) data = np . array ( data [ 1 : ] ) . reshape ( shape ) . astype ( np . float32 ) return data proj_c2p = parseLine ( C [ cid ] , shape = ( 3 , 4 ) ) proj_v2c = parseLine ( C [ - 1 ] , shape = ( 3 , 4 ) ) filler = np . array ( [ 0 , 0 , 0 , 1 ] ) . reshape ( ( 1 , 4 ) ) proj_v2c = np . concatenate ( ( proj_v2c , filler ) , axis = 0 ) return proj_c2p , proj_v2c