diff --git a/photon-lib/src/main/java/org/photonvision/simulation/VideoSimUtil.java b/photon-lib/src/main/java/org/photonvision/simulation/VideoSimUtil.java index 89face676..038d1f89e 100644 --- a/photon-lib/src/main/java/org/photonvision/simulation/VideoSimUtil.java +++ b/photon-lib/src/main/java/org/photonvision/simulation/VideoSimUtil.java @@ -84,14 +84,16 @@ public class VideoSimUtil { * through a 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] + * * @param size Size of image */ public static Point[] getImageCorners(Size size) { return new Point[] { - new Point(-0.5, -0.5), - new Point(size.width - 0.5, -0.5), + new Point(-0.5, size.height - 0.5), new Point(size.width - 0.5, size.height - 0.5), - new Point(-0.5, size.height - 0.5) + new Point(size.width - 0.5, -0.5), + new Point(-0.5, -0.5) }; } diff --git a/photon-lib/src/main/native/include/photon/simulation/VideoSimUtil.h b/photon-lib/src/main/native/include/photon/simulation/VideoSimUtil.h index 9f86e1ca7..618f36e1b 100644 --- a/photon-lib/src/main/native/include/photon/simulation/VideoSimUtil.h +++ b/photon-lib/src/main/native/include/photon/simulation/VideoSimUtil.h @@ -76,10 +76,10 @@ static std::unordered_map LoadAprilTagImages() { static std::vector GetImageCorners(const cv::Size& size) { std::vector retVal{}; - retVal.emplace_back(cv::Point2f{-0.5f, -0.5f}); - retVal.emplace_back(cv::Point2f{size.width - 0.5f, -0.5f}); - retVal.emplace_back(cv::Point2f{size.width - 0.5f, size.height - 0.5f}); retVal.emplace_back(cv::Point2f{-0.5f, size.height - 0.5f}); + retVal.emplace_back(cv::Point2f{size.width - 0.5f, size.height - 0.5f}); + retVal.emplace_back(cv::Point2f{size.width - 0.5f, -0.5f}); + retVal.emplace_back(cv::Point2f{-0.5f, -0.5f}); return retVal; }