From d365119d747a27ca23e2180c5c2f3ecf16c3017c Mon Sep 17 00:00:00 2001 From: komma zwei <> Date: Thu, 10 Dec 2020 19:27:45 -0800 Subject: [PATCH] rhd dm AE sign flip old-commit-hash: fef8d4093f1ebf6ad91c6bac95c465c83ee7e396 --- selfdrive/camerad/cameras/camera_common.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/camerad/cameras/camera_common.cc b/selfdrive/camerad/cameras/camera_common.cc index 1a5a64bddd..290a5d76e8 100644 --- a/selfdrive/camerad/cameras/camera_common.cc +++ b/selfdrive/camerad/cameras/camera_common.cc @@ -381,7 +381,7 @@ void common_camera_process_front(SubMaster *sm, PubMaster *pm, CameraState *c, i if (state.getFaceProb() > 0.4) { auto face_position = state.getFacePosition(); int x_offset = rhd_front ? 0 : b->rgb_width - (0.5 * b->rgb_height); - x_offset += (face_position[0] + 0.5) * (0.5 * b->rgb_height); + x_offset += (face_position[0] * (rhd_front ? -1.0 : 1.0) + 0.5) * (0.5 * b->rgb_height); const int y_offset = (face_position[1] + 0.5) * b->rgb_height; x_min = std::max(0, x_offset - 72);