Skip to content

Commit fcdf679

Browse files
committed
error with labels and angle
1 parent 49b7f98 commit fcdf679

2 files changed

Lines changed: 1 addition & 12 deletions

File tree

src/main.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,19 +179,10 @@ ObjectPosition calculate_position(float bottom_center_x, float bottom_y,
179179

180180
// 2. Apply Pitch Rotation (Rotation around X-axis)
181181
// Positive pitch = camera tilting down
182-
float theta = camera_pitch_deg * (M_PI / 180.0f);
182+
float theta = -camera_pitch_deg * (M_PI / 180.0f); // note the minus
183183
float cos_t = std::cos(theta);
184184
float sin_t = std::sin(theta);
185185

186-
// Rotate the vector [u, v, 1]
187-
// The standard rotation matrix for X-axis tilt:
188-
// [1 0 0 ]
189-
// [0 cos(t) -sin(t)]
190-
// [0 sin(t) cos(t)]
191-
//
192-
// Note: In OpenCV convention (Y-down), a positive pitch (looking down)
193-
// actually rotates Y toward Z.
194-
195186
float ray_x = u_norm;
196187
float ray_y = v_norm * cos_t - 1.0f * sin_t;
197188
float ray_z = v_norm * sin_t + 1.0f * cos_t;
@@ -215,7 +206,6 @@ ObjectPosition calculate_position(float bottom_center_x, float bottom_y,
215206

216207
// Scale factor to reach the ground
217208
float t = camera_height_m / ray_y;
218-
219209
float ground_x = ray_x * t;
220210
float ground_z = ray_z * t;
221211

src/rfdetr_inference.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ class RFDETRInference {
9191
// Getters for testing
9292
const std::vector<std::string>& get_coco_labels() const noexcept { return coco_labels_; }
9393
int get_resolution() const noexcept { return config_.resolution; }
94-
std::vector<std::string> coco_labels_;
9594

9695
private:
9796
// Load COCO labels from file

0 commit comments

Comments
 (0)