Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
depthobject Namespace Reference

Namespace containing functions related to object detection operations using depth measures and images. More...

Classes

struct  DepthObject
 Represents a single depth object detection. Stores all information about a specific object detection. More...
 

Functions

cv::Point2f FindObjectCenter (const DepthObject &stObject)
 Given an DepthObject struct find the center point of the corners.
 

Detailed Description

Namespace containing functions related to object detection operations using depth measures and images.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2023-10-07

Function Documentation

◆ FindObjectCenter()

cv::Point2f depthobject::FindObjectCenter ( const DepthObject stObject)
inline

Given an DepthObject struct find the center point of the corners.

Parameters
stObject- The object to find the center of.
Returns
cv::Point2f - The resultant center point within the image.
Author
jspencerpittman (jspen.nosp@m.cerp.nosp@m.ittma.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2023-10-20
68 {
69 // Average of the four corners.
70 cv::Point2f cvCenter(0, 0);
71
72 // Loop through each corner of the object.
73 for (cv::Point2f* cvCorner : stObject.vCorners)
74 {
75 // Add each object x, y to the center x, y.
76 cvCenter.x += cvCorner->x;
77 cvCenter.y += cvCorner->y;
78 }
79 // Divide by number of corners.
80 cvCenter.x /= 4;
81 cvCenter.y /= 4;
82
83 // Return a copy of the center point of the object.
84 return cvCenter;
85 }