Files
autopilot/constants.py

33 lines
717 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import numpy as np
# Ширина 1 пикселя в метрах
YANDEX_PIXEL_RATIO = {
15: 2830 / 1049,
18: 350 / 1049,
}
GOOGLE_PIXEL_RATIO = {
15: 2766 / 1031,
18: 346 / 1031,
}
WINDOW_HEIGHT = 1031
# Ширина и высота снимка в пикселях
CHUNK_WIDTH = 700
# Высота, с которой произведен снимок (в метрах)
CAMERA_HEIGHT = 150
# Угол обзора
CAMERA_FOV = np.radians(90)
# Матрица параметров камеры
_K_FOCUS_DISTANCE = np.tan(CAMERA_FOV / 2) * CHUNK_WIDTH / 2
_K_CENTER = CHUNK_WIDTH / 2
K = np.array([
[_K_FOCUS_DISTANCE, 0, _K_CENTER],
[0, _K_FOCUS_DISTANCE, _K_CENTER],
[0, 0, 1]
])