PhotonVision C++ dev-v2025.0.0-beta-8-2-gbd1c5c03
Loading...
Searching...
No Matches
photon::OpenCVHelp Namespace Reference

Functions

static std::vector< cv::Point2f > GetConvexHull (const std::vector< cv::Point2f > &points)
 
static cv::RotatedRect GetMinAreaRect (const std::vector< cv::Point2f > &points)
 
static frc::Translation3d TranslationNWUtoEDN (const frc::Translation3d &trl)
 
static frc::Rotation3d RotationNWUtoEDN (const frc::Rotation3d &rot)
 
static std::vector< cv::Point3f > TranslationToTVec (const std::vector< frc::Translation3d > &translations)
 
static std::vector< cv::Point3f > RotationToRVec (const frc::Rotation3d &rotation)
 
static cv::Point2f AvgPoint (std::vector< cv::Point2f > points)
 
static std::vector< photon::TargetCornerPointsToTargetCorners (const std::vector< cv::Point2f > &points)
 
static std::vector< std::pair< float, float > > PointsToCorners (const std::vector< cv::Point2f > &points)
 
static std::vector< cv::Point2f > CornersToPoints (const std::vector< std::pair< float, float > > &corners)
 
static std::vector< cv::Point2f > CornersToPoints (const std::vector< photon::TargetCorner > &corners)
 
static cv::Rect GetBoundingRect (const std::vector< cv::Point2f > &points)
 
static std::vector< cv::Point2f > ProjectPoints (const Eigen::Matrix< double, 3, 3 > &cameraMatrix, const Eigen::Matrix< double, 8, 1 > &distCoeffs, const RotTrlTransform3d &camRt, const std::vector< frc::Translation3d > &objectTranslations)
 
template<typename T >
static std::vector< T > ReorderCircular (const std::vector< T > elements, bool backwards, int shiftStart)
 
static frc::Translation3d TranslationEDNToNWU (const frc::Translation3d &trl)
 
static frc::Rotation3d RotationEDNToNWU (const frc::Rotation3d &rot)
 
static frc::Translation3d TVecToTranslation (const cv::Mat &tvecInput)
 
static frc::Rotation3d RVecToRotation (const cv::Mat &rvecInput)
 
static std::optional< photon::PnpResultSolvePNP_Square (const Eigen::Matrix< double, 3, 3 > &cameraMatrix, const Eigen::Matrix< double, 8, 1 > &distCoeffs, std::vector< frc::Translation3d > modelTrls, std::vector< cv::Point2f > imagePoints)
 
static std::optional< photon::PnpResultSolvePNP_SQPNP (const Eigen::Matrix< double, 3, 3 > &cameraMatrix, const Eigen::Matrix< double, 8, 1 > &distCoeffs, std::vector< frc::Translation3d > modelTrls, std::vector< cv::Point2f > imagePoints)
 

Variables

static frc::Rotation3d NWU_TO_EDN
 
static frc::Rotation3d EDN_TO_NWU
 

Function Documentation

◆ AvgPoint()

static cv::Point2f photon::OpenCVHelp::AvgPoint ( std::vector< cv::Point2f > points)
static

◆ CornersToPoints() [1/2]

static std::vector< cv::Point2f > photon::OpenCVHelp::CornersToPoints ( const std::vector< photon::TargetCorner > & corners)
static

◆ CornersToPoints() [2/2]

static std::vector< cv::Point2f > photon::OpenCVHelp::CornersToPoints ( const std::vector< std::pair< float, float > > & corners)
static

◆ GetBoundingRect()

static cv::Rect photon::OpenCVHelp::GetBoundingRect ( const std::vector< cv::Point2f > & points)
static

◆ GetConvexHull()

static std::vector< cv::Point2f > photon::OpenCVHelp::GetConvexHull ( const std::vector< cv::Point2f > & points)
static

◆ GetMinAreaRect()

static cv::RotatedRect photon::OpenCVHelp::GetMinAreaRect ( const std::vector< cv::Point2f > & points)
static

◆ PointsToCorners()

static std::vector< std::pair< float, float > > photon::OpenCVHelp::PointsToCorners ( const std::vector< cv::Point2f > & points)
static

◆ PointsToTargetCorners()

static std::vector< photon::TargetCorner > photon::OpenCVHelp::PointsToTargetCorners ( const std::vector< cv::Point2f > & points)
static

◆ ProjectPoints()

static std::vector< cv::Point2f > photon::OpenCVHelp::ProjectPoints ( const Eigen::Matrix< double, 3, 3 > & cameraMatrix,
const Eigen::Matrix< double, 8, 1 > & distCoeffs,
const RotTrlTransform3d & camRt,
const std::vector< frc::Translation3d > & objectTranslations )
static

◆ ReorderCircular()

template<typename T >
static std::vector< T > photon::OpenCVHelp::ReorderCircular ( const std::vector< T > elements,
bool backwards,
int shiftStart )
static

◆ RotationEDNToNWU()

static frc::Rotation3d photon::OpenCVHelp::RotationEDNToNWU ( const frc::Rotation3d & rot)
static

◆ RotationNWUtoEDN()

static frc::Rotation3d photon::OpenCVHelp::RotationNWUtoEDN ( const frc::Rotation3d & rot)
static

◆ RotationToRVec()

static std::vector< cv::Point3f > photon::OpenCVHelp::RotationToRVec ( const frc::Rotation3d & rotation)
static

◆ RVecToRotation()

static frc::Rotation3d photon::OpenCVHelp::RVecToRotation ( const cv::Mat & rvecInput)
static

◆ SolvePNP_SQPNP()

static std::optional< photon::PnpResult > photon::OpenCVHelp::SolvePNP_SQPNP ( const Eigen::Matrix< double, 3, 3 > & cameraMatrix,
const Eigen::Matrix< double, 8, 1 > & distCoeffs,
std::vector< frc::Translation3d > modelTrls,
std::vector< cv::Point2f > imagePoints )
static

◆ SolvePNP_Square()

static std::optional< photon::PnpResult > photon::OpenCVHelp::SolvePNP_Square ( const Eigen::Matrix< double, 3, 3 > & cameraMatrix,
const Eigen::Matrix< double, 8, 1 > & distCoeffs,
std::vector< frc::Translation3d > modelTrls,
std::vector< cv::Point2f > imagePoints )
static

◆ TranslationEDNToNWU()

static frc::Translation3d photon::OpenCVHelp::TranslationEDNToNWU ( const frc::Translation3d & trl)
static

◆ TranslationNWUtoEDN()

static frc::Translation3d photon::OpenCVHelp::TranslationNWUtoEDN ( const frc::Translation3d & trl)
static

◆ TranslationToTVec()

static std::vector< cv::Point3f > photon::OpenCVHelp::TranslationToTVec ( const std::vector< frc::Translation3d > & translations)
static

◆ TVecToTranslation()

static frc::Translation3d photon::OpenCVHelp::TVecToTranslation ( const cv::Mat & tvecInput)
static

Variable Documentation

◆ EDN_TO_NWU

frc::Rotation3d photon::OpenCVHelp::EDN_TO_NWU
static
Initial value:
{
(Eigen::Matrix3d() << 0, 0, 1, -1, 0, 0, 0, -1, 0).finished()}

◆ NWU_TO_EDN

frc::Rotation3d photon::OpenCVHelp::NWU_TO_EDN
static
Initial value:
{
(Eigen::Matrix3d() << 0, -1, 0, 0, 0, -1, 1, 0, 0).finished()}