![]() |
PhotonVision C++ v2026.2.2
|
Functions | |
| static cv::Mat | Get36h11TagImage (int id) |
| static std::unordered_map< int, cv::Mat > | LoadAprilTagImages () |
| static std::vector< cv::Point2f > | GetImageCorners (const cv::Size &size) |
| Gets the points representing the corners of this image. | |
| static std::vector< cv::Point2f > | Get36h11MarkerPts (int scale) |
| Gets the points representing the marker(black square) corners. | |
| static std::vector< cv::Point2f > | Get36h11MarkerPts () |
| Gets the points representing the marker(black square) corners. | |
| static void | UpdateVideoProp (cs::CvSource &video, const SimCameraProperties &prop) |
| Updates the properties of this cs::CvSource video stream with the given camera properties. | |
| static void | Warp165h5TagImage (int tagId, const std::vector< cv::Point2f > &dstPoints, bool antialiasing, cv::Mat &destination) |
| Warps the image of a specific 36h11 AprilTag onto the destination image at the given points. | |
| static double | GetScaledThickness (double thickness480p, const cv::Mat &destination) |
| Given a line thickness in a 640x480 image, try to scale to the given destination image resolution. | |
| static void | DrawInscribedEllipse (const std::vector< cv::Point2f > &dstPoints, const cv::Scalar &color, cv::Mat &destination) |
| Draw a filled ellipse in the destination image. | |
| static void | DrawPoly (const std::vector< cv::Point2f > &dstPoints, int thickness, const cv::Scalar &color, bool isClosed, cv::Mat &destination) |
| static void | DrawTagDetection (int id, const std::vector< cv::Point2f > &dstPoints, cv::Mat &destination) |
| Draws a contour around the given points and text of the id onto the destination image. | |
| static std::vector< std::vector< frc::Translation3d > > | GetFieldWallLines () |
| The translations used to draw the field side walls and driver station walls. | |
| static std::vector< std::vector< frc::Translation3d > > | GetFieldFloorLines (int subdivisions) |
| The translations used to draw the field floor subdivisions (not the floor outline). | |
| static std::vector< std::vector< cv::Point2f > > | PolyFrom3dLines (const RotTrlTransform3d &camRt, const SimCameraProperties &prop, const std::vector< frc::Translation3d > &trls, double resolution, bool isClosed, cv::Mat &destination) |
| Convert 3D lines represented by the given series of translations into a polygon(s) in the camera's image. | |
| static void | DrawFieldWireFrame (const RotTrlTransform3d &camRt, const SimCameraProperties &prop, double resolution, double wallThickness, const cv::Scalar &wallColor, int floorSubdivisions, double floorThickness, const cv::Scalar &floorColor, cv::Mat &destination) |
| Draw a wireframe of the field to the given image. | |
Variables | |
| static constexpr int | kNumTags36h11 = 40 |
| static constexpr units::meter_t | fieldLength {16.54175_m} |
| static constexpr units::meter_t | fieldWidth {8.0137_m} |
| static const std::unordered_map< int, cv::Mat > | kTag36h11Images |
| static const std::vector< cv::Point2f > | kTag36h11MarkPts = Get36h11MarkerPts() |
|
static |
Draw a wireframe of the field to the given image.
| camRt | The change in basis from world coordinates to camera coordinates. See RotTrlTransform3d#makeRelativeTo(frc::Pose3d). |
| prop | The simulated camera's properties. |
| resolution | Resolution as a fraction(0 - 1) of the video frame's diagonal length in pixels. Line segments will be subdivided if they exceed this resolution. |
| wallThickness | Thickness of the lines used for drawing the field walls in pixels. This is scaled by #getScaledThickness(double, cv::Mat). |
| wallColor | Color of the lines used for drawing the field walls. |
| floorSubdivisions | A NxN "grid" is created from the floor where this parameter is N, which defines the floor lines. |
| floorThickness | Thickness of the lines used for drawing the field floor grid in pixels. This is scaled by #getScaledThickness(double, cv::Mat). |
| floorColor | Color of the lines used for drawing the field floor grid. |
| destination | The destination image to draw to. |
|
static |
Draw a filled ellipse in the destination image.
| dstPoints | The points in the destination image representing the rectangle in which the ellipse is inscribed. |
| color | The color of the ellipse. This is a scalar with BGR values (0-255) |
| destination | The destination image to draw onto. The image should be in the BGR color space. |
|
static |
|
static |
Draws a contour around the given points and text of the id onto the destination image.
| id | Fiducial ID number to draw |
| dstPoints | Points representing the four corners of the tag marker(black square) in the destination image. |
| destination | The destination image to draw onto. The image should be in the BGR color space. |
|
static |
Gets the points representing the marker(black square) corners.
|
static |
Gets the points representing the marker(black square) corners.
| scale | The scale of the tag image (10*scale x 10*scale image) |
|
static |
|
static |
The translations used to draw the field floor subdivisions (not the floor outline).
It is a vector of vectors because the translations are not all connected.
| subdivisions | How many "subdivisions" along the width/length of the floor. E.g. 3 subdivisions would mean 2 lines along the length and 2 lines along the width creating a 3x3 "grid". |
|
static |
The translations used to draw the field side walls and driver station walls.
It is a vector of vectors because the translations are not all connected.
|
static |
Gets the points representing the corners of this image.
Because image pixels are accessed through a cv::Mat, the point (0,0) actually represents the center of the top-left pixel and not the actual top-left corner.
Order of corners returned is: [BL, BR, TR, TL]
| size | Size of image |
|
static |
Given a line thickness in a 640x480 image, try to scale to the given destination image resolution.
| thickness480p | A hypothetical line thickness in a 640x480 image |
| destination | The destination image to scale to |
|
static |
|
static |
Convert 3D lines represented by the given series of translations into a polygon(s) in the camera's image.
| camRt | The change in basis from world coordinates to camera coordinates. See RotTrlTransform3d#makeRelativeTo(Pose3d). |
| prop | The simulated camera's properties. |
| trls | A sequential series of translations defining the polygon to be drawn. |
| resolution | Resolution as a fraction(0 - 1) of the video frame's diagonal length in pixels. Line segments will be subdivided if they exceed this resolution. |
| isClosed | If the final translation should also draw a line to the first translation. |
| destination | The destination image that is being drawn to. |
|
static |
Updates the properties of this cs::CvSource video stream with the given camera properties.
|
static |
Warps the image of a specific 36h11 AprilTag onto the destination image at the given points.
| tagId | The id of the specific tag to warp onto the destination image |
| dstPoints | Points(4) in destination image where the tag marker(black square) corners should be warped onto. |
| antialiasing | If antialiasing should be performed by automatically supersampling/interpolating the warped image. This should be used if better stream quality is desired or target detection is being done on the stream, but can hurt performance. |
| destination | The destination image to place the warped tag image onto. |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
static |
|
static |