MRCAL(1)

πŸ‘‘ MRCAL-CULL-CORNERS β€” section 1 of the mrcal manual πŸ’…

okay bestie, welcome to the mrcal manual, the camera projection, calibration toolkit one, and today's main character is mrcal-cull-corners. she takes corners in, she throws some of them out, she's literally a bouncer for points. let's go ✨


✨ NAME ✨

mrcal-cull-corners β€” she reads a corners.vnl on stdin, cuts out some of the points, and sends the survivors out on stdout. πŸŽ€


🌸 SYNOPSIS 🌸

$ < corners.vnl mrcal-cull-corners --cull-left-of 1000 > corners.culled.vnl

πŸ’– DESCRIPTION πŸ’–

So basically this tool reads a bunch of corner detections from stdin, yeets some of them, and writes what's left to stdout. It's useful for testing and for evaluating how the mrcal calibration tools are performing. ngl, it's a vibe-check tool for your calibration pipeline. πŸ¦‹

What it actually does depends on which --cull-... option you hand it. And bestie, exactly one is required. no cap. πŸ‘‘

--cull-left-of X: throw away all corner observations to the left of the given
  X coordinate

--cull-rad-off-center D: throw away all corner observations further than D
  away from the center. --imagersize or --where must be given also so that we
  know where the center is. If D < 0: we cull the points -D or closer to the
  corners: we use a radius of sqrt(width^2 + height^2)/2. - abs(D)

--cull-random-observations-ratio R: throws away a ratio R object observations
  at random. To throw out half of all object observations, pass R = 0.5.
  --object-width-n and --object-height-n are then required to make the parsing
  work

Now, --cull-left-of X and --cull-rad-off-center are the gentle ones β€” they throw out individual points. The way they do that is by keeping the point in the output data stream but setting its decimation level to '-'. That way the downstream tools know to ignore those points. 🫢

But --cull-random-observations-ratio? she's different. she throws out whole object observations, not just individual points. And those removed observations don't show up in the output data stream at all. gone. deleted. πŸ’€

⚠️ real talk: this tool exists primarily for testing, and probably you don't want to use it. The filtering is crude, and the tool might report chessboard observations with very few remaining points. You PROBABLY want to post-process the output to keep only observations with enough points. For instance:
mrcal-cull-corners ... > culled-raw.vnl

vnl-join --vnl-sort - -j filename culled-raw.vnl \
   <(< culled-raw.vnl vnl-filter -p filename --has level |
                      vnl-uniq -c |
                      vnl-filter 'count > 20' -p filename ) \
> culled.vnl

✨ OPTIONS ✨

πŸŽ€ OPTIONAL ARGUMENTS πŸŽ€

  • -h, --help β€” shows this help message and exits. classic. πŸ™ˆ
  • --object-width-n OBJECT_WIDTH_N β€” how many points the calibration board has per horizontal side. This is required if --cull-random-observation-ratio. πŸ“
  • --object-height-n OBJECT_HEIGHT_N β€” how many points the calibration board has per vertical side. If you omit it, I assume a square object and just use the same value as --object-width-n. 🧚
  • --imagersize IMAGERSIZE IMAGERSIZE β€” size of the imager. If --cull-rad-off-center is given: we require --imagersize or --where. πŸ‘€
  • --cull-left-of CULL_LEFT_OF β€” throw out all observations with x < the given value. Exclusive with the other --cull-... options. βœ‚οΈ
  • --cull-rad-off-center CULL_RAD_OFF_CENTER β€” throw out all points that appear outside the given radius from the --where of the imager. Exclusive with the other --cull-... options. If given: we require --imagersize or --where. 🌈
  • --cull-rad-off-center-board CULL_RAD_OFF_CENTER_BOARD β€” throw out all observations beyond the given radius from the center of the board. The units are "board squares". Requires --objects-width-n. πŸ“
  • --cull-random-observations-ratio CULL_RANDOM_OBSERVATIONS_RATIO β€” throw out a random number of board observations. The ratio of observations is given as the argument. 1.0 = throw out ALL the observations; 0.0 = throw out NONE of the observations. Exclusive with the other --cull-... options. Requires --objects-width-n. 🎲
  • --where WHERE WHERE β€” used with --cull-rad-off-center. Specifies the location of the "center" point. If omitted, we use the center of the imager. May NOT be given if --cull-rad-off-center < 0. If --cull-rad-off-center is given: we require --imagersize or --where. πŸ“
  • --filename FILENAME β€” apply the filtering only to observations where the filename matches the given regex. May be given multiple times: filenames that match ANY of the given regexen are culled. If omitted, we cull ALL the observations. Exclusive with --cull-random-observations-ratio. πŸ”₯

πŸ¦‹ REPOSITORY πŸ¦‹

<https://www.github.com/dkogan/mrcal>


πŸ’œ AUTHOR πŸ’œ

Dima Kogan, "<dima@secretsauce.net>"


Copyright (c) 2017-2023 California Institute of Technology ("Caltech"). U.S. Government sponsorship acknowledged. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

and that's the whole page bestie πŸ’… this was mrcal version 2.5.2-4build1, dated 2026-03-20, manual page MRCAL(1). slay, go cull some corners, and remember: exactly one --cull-... option. periodt. πŸ‘‘βœ¨

πŸ“¦ where this page comes from