Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError when reshaping array with calibrationUtils.py #1656

Open
PureRandomGit opened this issue Dec 23, 2024 · 2 comments
Open

ValueError when reshaping array with calibrationUtils.py #1656

PureRandomGit opened this issue Dec 23, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@PureRandomGit
Copy link

PureRandomGit commented Dec 23, 2024

I get this error when running the updated script for the mrcal calibrationUtils.py:

$ python3 calibrationUtils.py calibration2.json ./img
Traceback (most recent call last):
  File "calibrationUtils.py", line 237, in <module>
    main()
  File "calibrationUtils.py", line 233, in main
    convert_photon_to_mrcal(args.input, args.output_folder)
  File "calibrationUtils.py", line 210, in convert_photon_to_mrcal
    mrcal_model = __convert_cal_to_mrcal_cameramodel(camera_cal_data)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "calibrationUtils.py", line 129, in __convert_cal_to_mrcal_cameramodel
    ).reshape((cal.calobjectSize.width, cal.calobjectSize.height, 3))
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: cannot reshape array of size 135 into shape (7,7,3)

I believe its caused by images that do not have all the points of the checkerboard being detected/in frame as when I run it with a calibration that has everything in frame and detected it appears to work fine and generates the cameramodel.

broken calibration file:
calibration2.json
working calibration file:
calibration3.json

Platform:

  • Hardware Platform: Orange Pi 5
  • PhotonVision Version: v2025.0.0-beta-8
  • Camera(s) Used: OV9281
@PureRandomGit PureRandomGit added the bug Something isn't working label Dec 23, 2024
@Juniormunk
Copy link
Contributor

Is this using charuco calibration? I wonder if we are exporting all "fake" points as well.

@PureRandomGit
Copy link
Author

Yes, this is with charuco cal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants