def guess_acceleration_from_orientation_tag()

in opensfm/reconstruction_helpers.py [0:0]


def guess_acceleration_from_orientation_tag(orientation: int) -> List[float]:
    """Guess upward vector in camera coordinates given the orientation tag.

    Assumes camera is looking towards the horizon and horizon is horizontal
    on the image when taking in to account the orientation tag.
    """
    # See http://sylvana.net/jpegcrop/exif_orientation.html
    if orientation == 1:
        return [0, -1, 0]
    if orientation == 2:
        return [0, -1, 0]
    if orientation == 3:
        return [0, 1, 0]
    if orientation == 4:
        return [0, 1, 0]
    if orientation == 5:
        return [-1, 0, 0]
    if orientation == 6:
        return [-1, 0, 0]
    if orientation == 7:
        return [1, 0, 0]
    if orientation == 8:
        return [1, 0, 0]
    raise RuntimeError(f"Error: Unknown orientation tag: {orientation}")