From d658c0e5933b17f175ec5c7739c040bd26726ff4 Mon Sep 17 00:00:00 2001 From: uvos Date: Mon, 23 Aug 2021 19:17:48 +0200 Subject: [PATCH] Renove black regidon when a board less than the board size is used (Experiamental) --- src/charuco.cpp | 8 ++++++-- src/main.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/charuco.cpp b/src/charuco.cpp index 8628e0e..c6138f1 100644 --- a/src/charuco.cpp +++ b/src/charuco.cpp @@ -55,11 +55,14 @@ static void seamAjust(std::vector& detections) Log(Log::DEBUG)<<"Image contains seam"; + int rightMostPoint = 0; bool extantCol[X_BOARD_SIZE] = {0}; for(auto& point : detections) { if(!extantCol[point.coordinate.x]) extantCol[point.coordinate.x] = true; + if(point.coordinate.x > rightMostPoint) + rightMostPoint = point.coordinate.x; } int leftCoordinate = 0; @@ -79,12 +82,13 @@ static void seamAjust(std::vector& detections) } } - Log(Log::DEBUG)<<"Left coordinate before seam "<>image; - if(matf.isOpened() && (!image.data || image.type() != CV_32FC1)) + if(matf.isOpened() && !image.data) { Log(Log::WARN)<