photonvision icon indicating copy to clipboard operation
photonvision copied to clipboard

Add ability to lower filesize and import mrcal cli settings

Open willtoth opened this issue 1 year ago • 3 comments

Photonvision only allows importing calibrations that are within a certain size limit. Currently that is 50000000 bytes, though even when getting close to that limit, the webUI struggles to import the files.

To mitigate this, a function was added to strip out observations from the json to keep the filesize within a specified limit.

A function was added to import mrcal command line intrinsic values from a camera model file into photonvision json. Note its for a workflow where you do the calibration in PV then re-run it in mrcal.

Marked as a draft for now, I threw this together quick to simplify shrinking file sizes and importing data, but perhaps the CLI or other aspects could be improved here. Figured I'd share either way.

willtoth avatar Feb 19 '24 06:02 willtoth

Stripping observations could happen in the frontend as well, for files larger than X MB, if that's easier?

mcm001 avatar Feb 19 '24 17:02 mcm001

That's not a bad idea. Just set to to the 50000000 bytes or so max that is imposed on import, so your exports are always importable.

On an aside, I know you really want to keep observation data with the calibration, but this also becomes clunky to check into version control. Would you be open to opting in to an option that strips all observations?

willtoth avatar Feb 20 '24 00:02 willtoth

That was my grand vision, but if there's a workflow that doesn't require that, then I'm open to it. It for sure seems like storing images is problematic -- keeping the corner detections but stripping images might be a middle ground? I think that a design conversation about what teams actually need is in order post champs

mcm001 avatar Feb 20 '24 02:02 mcm001

Closing as stale, since calibrations don’t contain images anymore and because the script has changed. It would be cool though to have stronger type validation and be able to use real wpimath types, as well as being able to integrate with mrcal’s CLI.

Gold856 avatar Aug 20 '25 17:08 Gold856