1mod localize;
4use types::cv::{BoxDetection, Gps, Object};
5
6pub fn localize(gps: Gps, detection: &BoxDetection) -> Object {
9 let camera_coords = (gps.lat, gps.long);
10 let centerx = (detection.x2 + detection.x1) / 2.0;
11 let centery = (detection.y2 + detection.y1) / 2.0;
12 let (lat, long) = localize::resolve_gps_location(
13 camera_coords,
14 gps.alt,
15 gps.heading,
16 (centerx as i32, centery as i32),
17 );
18
19 Object {
20 lat,
21 long,
22 class: detection.class_index,
23 confidence: detection.conf,
24 }
25}