coastalimagelib/supportfunctions.py
def loadYamlDLT(file, cams):
    """
    Requires yaml package

    This function reads and formats extrinsics and instrinsics in DLT format
    from .yaml files containing camera data from one or more pre-calibrated
    cameras that are labeled with a camera ID

    Args:
        file: (string) .yaml file path that contains camera data
        cams: (list of strings) camera labels used in .yaml file

    Returns:
        m: array of lists, length is number of cameras, each list contains
            the DLT vector for the corresponding camera
        ex: array of lists, length is number of cameras, each list contains
            the extrinsics for the corresponding camera
    """
    import yaml

    with open(file, "r") as f:
        cameraData = yaml.load(f, Loader=yaml.FullLoader)
    m = np.empty(len(cams), object)
    ex = np.empty(len(cams), object)
    for ind in range(len(cams)):
        camID = cams[ind]
        m[ind] = cameraData[camID]["m"]
        x = cameraData[camID]["x"]
        y = cameraData[camID]["y"]
        z = cameraData[camID]["z"]
        a = cameraData[camID]["azimuth"]
        t = cameraData[camID]["tilt"]
        r = cameraData[camID]["roll"]
        ex[ind] = list([x, y, z, a, t, r])

    return m, ex

    Requires yaml package

    This function reads and formats extrinsics and instrinsics in DLT format
    from .yaml files containing camera data from one or more pre-calibrated
    cameras that are labeled with a camera ID

    Args:
        file: (string) .yaml file path that contains camera data
        cams: (list of strings) camera labels used in .yaml file

    Returns:
        m: array of lists, length is number of cameras, each list contains
            the DLT vector for the corresponding camera
        ex: array of lists, length is number of cameras, each list contains
            the extrinsics for the corresponding camera
    
Requires yaml package
This function reads and formats extrinsics and instrinsics in DLT format
from .yaml files containing camera data from one or more pre-calibrated
cameras that are labeled with a camera ID
Requires yaml package This function reads and formats extrinsics and instrinsics in DLT format from . yaml files containing camera data from one or more pre - calibrated cameras that are labeled with a camera ID
def loadYamlDLT(file, cams):
    import yaml
    with open(file, "r") as f:
        cameraData = yaml.load(f, Loader=yaml.FullLoader)
    m = np.empty(len(cams), object)
    ex = np.empty(len(cams), object)
    for ind in range(len(cams)):
        camID = cams[ind]
        m[ind] = cameraData[camID]["m"]
        x = cameraData[camID]["x"]
        y = cameraData[camID]["y"]
        z = cameraData[camID]["z"]
        a = cameraData[camID]["azimuth"]
        t = cameraData[camID]["tilt"]
        r = cameraData[camID]["roll"]
        ex[ind] = list([x, y, z, a, t, r])
    return m, ex
def loadYamlDLT ( file , cams ) : import yaml with open ( file , "r" ) as f : cameraData = yaml . load ( f , Loader = yaml . FullLoader ) m = np . empty ( len ( cams ) , object ) ex = np . empty ( len ( cams ) , object ) for ind in range ( len ( cams ) ) : camID = cams [ ind ] m [ ind ] = cameraData [ camID ] [ "m" ] x = cameraData [ camID ] [ "x" ] y = cameraData [ camID ] [ "y" ] z = cameraData [ camID ] [ "z" ] a = cameraData [ camID ] [ "azimuth" ] t = cameraData [ camID ] [ "tilt" ] r = cameraData [ camID ] [ "roll" ] ex [ ind ] = list ( [ x , y , z , a , t , r ] ) return m , ex
Requires yaml package
This function reads and formats extrinsics and instrinsics in DLT format
from .yaml files containing camera data from one or more pre-calibrated
cameras that are labeled with a camera ID
Requires yaml package This function reads and formats extrinsics and instrinsics in DLT format from . yaml files containing camera data from one or more pre - calibrated cameras that are labeled with a camera ID
"""
    Requires yaml package

    This function reads and formats extrinsics and instrinsics in DLT format
    from .yaml files containing camera data from one or more pre-calibrated
    cameras that are labeled with a camera ID

    Args:
        file: (string) .yaml file path that contains camera data
        cams: (list of strings) camera labels used in .yaml file

    Returns:
        m: array of lists, length is number of cameras, each list contains
            the DLT vector for the corresponding camera
        ex: array of lists, length is number of cameras, each list contains
            the extrinsics for the corresponding camera
    """
array of lists, length is number of cameras, each list contains
the DLT vector for the corresponding camera
ex: array of lists, length is number of cameras, each list contains
the extrinsics for the corresponding camera
array of lists length is number of cameras each list contains the DLT vector for the corresponding camera ex : array of lists length is number of cameras each list contains the extrinsics for the corresponding camera
m
file
(string) .yaml file path that contains camera data
( string ) . yaml file path that contains camera data
cams
(list of strings) camera labels used in .yaml file
( list of strings ) camera labels used in . yaml file