Skip to content

Commit

Permalink
ChArUco: adjust detector params, hide unused (#1463)
Browse files Browse the repository at this point in the history
  • Loading branch information
Juniormunk authored Oct 13, 2024
1 parent 30ee913 commit 48fc88c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ protected Void process(Pair<Mat, List<TrackedTarget>> in) {
int i = 0;
for (var target : in.getRight()) {
for (var c : target.getTargetCorners()) {
if (c.x < 0 || c.y < 0) {
// Skip if the corner is less than zero
continue;
}

c =
new Point(
c.x / params.divisor.value.doubleValue(), c.y / params.divisor.value.doubleValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ public void createObjectPoints() {
Objdetect.getPredefinedDictionary(params.tagFamily.getValue()));
board.setLegacyPattern(params.useOldPattern);
detector = new CharucoDetector(board);
detector.getDetectorParameters().set_adaptiveThreshConstant(10);
detector.getDetectorParameters().set_adaptiveThreshWinSizeMin(11);
detector.getDetectorParameters().set_adaptiveThreshWinSizeStep(40);
detector.getDetectorParameters().set_adaptiveThreshWinSizeMax(91);

} else {
logger.error("Can't create pattern for unknown board type " + params.type);
}
Expand Down

0 comments on commit 48fc88c

Please sign in to comment.