Skip to content

Commit 3a7d6e1

Browse files
Merge pull request #2086 from alicevision/dev/bestCheckerboard
Update distortion calibration to select the best checkerboard as input
2 parents 35ac581 + fb8f3fa commit 3a7d6e1

12 files changed

+107
-15
lines changed

meshroom/aliceVision/DistortionCalibration.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '6.0'
1+
__version__ = '6.1'
22

33
from meshroom.core import desc
44
from meshroom.core.utils import VERBOSE_LEVEL
@@ -31,6 +31,12 @@ class DistortionCalibration(desc.AVCommandLineNode):
3131
value="3deanamorphic4",
3232
values=["3deanamorphic4", "3declassicld", "3deradial4"],
3333
),
34+
desc.BoolParam(
35+
name="bestOnly",
36+
label="Keep best image",
37+
description="All detected checkerboards across images sharing the same intrinsic are used for distortion calibration. Once this option is enabled, only the best image is selected to optimize the intrinsics rather than utilizing all available images.",
38+
value=False,
39+
),
3440
desc.BoolParam(
3541
name="handleSqueeze",
3642
label="Handle Squeeze",

meshroom/cameraTracking.mg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"CopyFiles": "1.3",
1111
"DepthMap": "5.0",
1212
"DepthMapFilter": "4.0",
13-
"DistortionCalibration": "6.0",
13+
"DistortionCalibration": "6.1",
1414
"ExportAlembic": "1.0",
1515
"ExportDistortion": "2.0",
1616
"ExportImages": "1.1",

meshroom/cameraTrackingDepth.mg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"DepthMap": "5.0",
1212
"DepthMapFilter": "4.0",
1313
"DepthMapTracksInjecting": "1.0",
14-
"DistortionCalibration": "6.0",
14+
"DistortionCalibration": "6.1",
1515
"ExportAlembic": "1.0",
1616
"ExportDistortion": "2.0",
1717
"ExportImages": "1.1",

meshroom/cameraTrackingLegacy.mg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"CopyFiles": "1.3",
1111
"DepthMap": "5.0",
1212
"DepthMapFilter": "4.0",
13-
"DistortionCalibration": "6.0",
13+
"DistortionCalibration": "6.1",
1414
"ExportAnimatedCamera": "2.0",
1515
"ExportDistortion": "2.0",
1616
"FeatureExtraction": "1.3",

meshroom/cameraTrackingRoma.mg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"CheckerboardDetection": "2.0",
99
"ConvertSfMFormat": "2.0",
1010
"CopyFiles": "1.3",
11-
"DistortionCalibration": "6.0",
11+
"DistortionCalibration": "6.1",
1212
"ExportAlembic": "1.0",
1313
"ExportDistortion": "2.0",
1414
"ExportImages": "1.1",

meshroom/distortionCalibration.mg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"nodesVersions": {
66
"CameraInit": "12.0",
77
"CheckerboardDetection": "2.0",
8-
"DistortionCalibration": "6.0",
8+
"DistortionCalibration": "6.1",
99
"ExportDistortion": "2.0",
1010
"CopyFiles": "1.3"
1111
},

meshroom/nodalCameraTracking.mg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"CheckerboardDetection": "2.0",
99
"ConvertSfMFormat": "2.0",
1010
"CopyFiles": "1.3",
11-
"DistortionCalibration": "6.0",
11+
"DistortionCalibration": "6.1",
1212
"ExportAlembic": "1.0",
1313
"ExportDistortion": "2.0",
1414
"ExportImages": "1.1",

meshroom/photogrammetryAndCameraTracking.mg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"CopyFiles": "1.3",
1111
"DepthMap": "5.0",
1212
"DepthMapFilter": "4.0",
13-
"DistortionCalibration": "6.0",
13+
"DistortionCalibration": "6.1",
1414
"ExportAlembic": "1.0",
1515
"ExportDistortion": "2.0",
1616
"ExportImages": "1.1",

meshroom/photogrammetryAndCameraTrackingLegacy.mg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"CopyFiles": "1.3",
1111
"DepthMap": "5.0",
1212
"DepthMapFilter": "4.0",
13-
"DistortionCalibration": "6.0",
13+
"DistortionCalibration": "6.1",
1414
"ExportAnimatedCamera": "2.0",
1515
"ExportDistortion": "2.0",
1616
"FeatureExtraction": "1.3",

src/aliceVision/calibration/checkerDetector.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,5 +1946,34 @@ void CheckerDetector::groupNestedCheckerboards(size_t minConsensus)
19461946
_boards[0] = newboard;
19471947
}
19481948

1949+
double CheckerDetector::getScore() const
1950+
{
1951+
double maxScore = 0.0;
1952+
for (const auto & board :_boards)
1953+
{
1954+
size_t countValid = 0;
1955+
double sumScale = 0.0;
1956+
for (const auto & item : board.reshaped())
1957+
{
1958+
if (item == UndefinedIndexT)
1959+
{
1960+
continue;
1961+
}
1962+
1963+
// Scale is between 0 and 1
1964+
sumScale += _corners[item].scale;
1965+
countValid++;
1966+
}
1967+
1968+
// The score is the number of valid points in the checkerboard + the mean scale of the corners to disambiguate.
1969+
double score = (countValid > 0)
1970+
? (double(countValid) + sumScale / double(countValid))
1971+
: 0.0;
1972+
maxScore = std::max(maxScore, score);
1973+
}
1974+
1975+
return maxScore;
1976+
}
1977+
19491978
} // namespace calibration
19501979
} // namespace aliceVision

0 commit comments

Comments
 (0)