Skip to content

Commit 14fefd8

Browse files
committed
Fix MIN_CORNER threshold for asymmetric circlegrids
1 parent 83f04c2 commit 14fefd8

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

aslam_cv/aslam_cameras/include/aslam/cameras/GridCalibrationTargetCirclegrid.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ class GridCalibrationTargetCirclegrid : public GridCalibrationTargetBase {
5959
bool computeObservation(const cv::Mat &image, Eigen::MatrixXd &outImagePoints,
6060
std::vector<bool> &outCornerObserved) const;
6161

62+
/// \brief receive the circlegrid options
63+
const CirclegridOptions options() const {return _options;}
64+
6265
private:
6366
/// \brief initialize the object
6467
void initialize();

aslam_cv/aslam_cameras/include/aslam/cameras/implementation/OmniProjection.hpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <aslam/cameras/GridCalibrationTargetCirclegrid.hpp>
2+
13
namespace aslam {
24

35
namespace cameras {
@@ -773,7 +775,15 @@ bool OmniProjection<DISTORTION_T>::initializeIntrinsics(const std::vector<GridCa
773775
}
774776

775777
// MIN_CORNERS is an arbitrary threshold for the number of corners
776-
const size_t MIN_CORNERS = 4;
778+
size_t MIN_CORNERS = 4;
779+
780+
// allow asymmetric circle grids with half of the minimum corners as 2 asymmetric columns are treated a 1
781+
if (const aslam::cameras::GridCalibrationTargetCirclegrid* circleGrid = dynamic_cast<const aslam::cameras::GridCalibrationTargetCirclegrid*>(&target)){
782+
if (circleGrid->options().useAsymmetricCirclegrid){
783+
MIN_CORNERS = MIN_CORNERS / 2;
784+
}
785+
}
786+
777787
if (count > MIN_CORNERS)
778788
{
779789
// Resize P to fit with the count of valid points.

aslam_cv/aslam_cameras/src/OmniCameraGeometry.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,15 @@ bool OmniProjection::initializeIntrinsics(
523523
}
524524
}
525525

526-
const int MIN_CORNERS = 8;
526+
int MIN_CORNERS = 8;
527+
528+
// allow asymmetric circle grids with half of the minimum corners as 2 asymmetric columns are treated a 1
529+
if (const aslam::cameras::GridCalibrationTargetCirclegrid* circleGrid = dynamic_cast<const aslam::cameras::GridCalibrationTargetCirclegrid*>(&target)){
530+
if (circleGrid->options().useAsymmetricCirclegrid){
531+
MIN_CORNERS = MIN_CORNERS / 2;
532+
}
533+
}
534+
527535
// MIN_CORNERS is an arbitrary threshold for the number of corners
528536
if (count > MIN_CORNERS) {
529537
// Resize P to fit with the count of valid points.

0 commit comments

Comments
 (0)