Skip to content

Return partial used corners for calibration - #31

Open
thatcomputerguy0101 wants to merge 3 commits into
PhotonVision:mainfrom
thatcomputerguy0101:partial-observations-corners-used
Open

Return partial used corners for calibration#31
thatcomputerguy0101 wants to merge 3 commits into
PhotonVision:mainfrom
thatcomputerguy0101:partial-observations-corners-used

Conversation

@thatcomputerguy0101

@thatcomputerguy0101 thatcomputerguy0101 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Previously, calibrateCamera would return used corner info for all corners of a board, including those that were not part of the observation. This corrects the problem by changing the input to a list to be able to map the skipped corner info back to the same subset and order that was provided in the parameters. AbstractList can be used on the caller's side to perform on the fly conversion if needed.

@thatcomputerguy0101

thatcomputerguy0101 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

I'm not a big fan of the extra int array for storing ids, but I don't see a better option. AbstractList seems like a better option than iterators for the input data.

@thatcomputerguy0101
thatcomputerguy0101 force-pushed the partial-observations-corners-used branch from 5da6576 to 52e591c Compare July 30, 2026 17:23
@thatcomputerguy0101
thatcomputerguy0101 force-pushed the partial-observations-corners-used branch from 52e591c to 14729e6 Compare July 30, 2026 17:38
@thatcomputerguy0101
thatcomputerguy0101 force-pushed the partial-observations-corners-used branch from 14729e6 to 047ddb6 Compare July 30, 2026 18:09
imageHeight,
focalLen);

// Only return corners used for the corners that were provided in the input

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bigger picture, when we're analyzing data, is it more helpful to return this, or to return every corner (even excluded/ignored/not detected ones)? Does mrcal's other utilities prefer one format over the other? Trying to understand why I might want one or the other

@thatcomputerguy0101 thatcomputerguy0101 Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of PV's analysis handles outlier corners separately from unobserved corners, and once the screen to world coordinate mapping is determined, the ID matters less. In short, OpenCV wants only the observed corners, and MrCal wants padding for all corners. I'm putting together some additional code to verify this flow for the uncertainty PR.

  1. ChArUco detection from OpenCV does only observed corners + ids
  2. mrcal calibration wants padding (but OpenCV does not)
  3. SolvePNP wants no padding
  4. Calibration visualization doesn't care about unobserved points.
  5. Uncertainty seems to want padding again. I'm not completely sure that it still cares about the order of points here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. In that case I agree that adding the padding herein mrcal -- the only library who wants it -- makes sense.

Also agree it's worth keeping a distinction between unobserved corners and outlier corners. At some point in the future I'd like to re-run calibration, which would allow a point that was previously an outlier to become an inlier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants