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
objectdetectutils Namespace Reference

Namespace containing functions to assist in object detection. More...

Classes

struct  Object
 Represents a single detected object. Combines attributes from TorchObject and TensorflowObject structs. More...
 

Enumerations

enum class  ObjectDetectionMethod { eUnknown , eTorch }
 Enum class to define the different object detection methods available. More...
 
enum class  ObjectDetectionType { eUnknown , eMallet , eWaterBottle }
 Enum class to define the different object detection types available. More...
 

Functions

cv::Point2f FindObjectCenter (const Object &stObject)
 Find the center of an object.
 
void EstimatePoseFromCameraFrame (Object &stTag)
 
  • Estimate the pose of a tag from a camera frame.

 

Detailed Description

Namespace containing functions to assist in object detection.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-05-05

Enumeration Type Documentation

◆ ObjectDetectionMethod

Enum class to define the different object detection methods available.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-05-05
45 {
46 eUnknown, // Unknown detection method.
47 eTorch, // Torch detection using a YOLO model.
48 };

◆ ObjectDetectionType

Enum class to define the different object detection types available.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-05-13
58 {
59 eUnknown, // Unknown detection type.
60 eMallet, // Detection is a mallet.
61 eWaterBottle // Detection is a water bottle.
62 };

Function Documentation

◆ FindObjectCenter()

cv::Point2f objectdetectutils::FindObjectCenter ( const Object stObject)
inline

Find the center of an object.

Parameters
stObject- The object to find the center of.
Returns
cv::Point2f - The center of the object.
Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-05-05
161 {
162 // Find the center of the object.
163 return cv::Point2f(stObject.pBoundingBox->x + stObject.pBoundingBox->width / 2, stObject.pBoundingBox->y + stObject.pBoundingBox->height / 2);
164 }
Point_< float > Point2f

◆ EstimatePoseFromCameraFrame()

void objectdetectutils::EstimatePoseFromCameraFrame ( Object stTag)
inline

  • Estimate the pose of a tag from a camera frame.

Parameters
stTag- The tag to estimate the pose of.
Note
In order for this to be accurate, the camera's horizontal field of view (HFOV) and the camera frame size must be known.
Author
sam_hajdukiewicz (saman.nosp@m.thah.nosp@m.ajduk.nosp@m.iewi.nosp@m.cz@gm.nosp@m.ail..nosp@m.com) :3
Date
2025-04-04
177 {
178 // Use camera field of view and camera frame size to determine tag angle in degrees from center of camera.
179 double dDegreesPerPixel = stTag.dHorizontalFOV / stTag.cvImageResolution.width;
180 // Find tag error in pixels from center of image.
181 double dTagErrorX = (stTag.pBoundingBox->x + stTag.pBoundingBox->width / 2) - (stTag.cvImageResolution.width / 2);
182 // Find angle error.
183 double dTagAngleX = dTagErrorX * dDegreesPerPixel;
184 // Reassign yaw and distance to tag.
185 stTag.dYawAngle = dTagAngleX;
186
187 // For the distance, we'll just use the screen percentage of the tag.
188 stTag.dStraightLineDistance = (stTag.pBoundingBox->area() / (stTag.cvImageResolution.width * stTag.cvImageResolution.height)) * 100.0;
189 }
Here is the caller graph for this function: