Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

calibrate_camera is saving distortion coefficients improperly #5

@fovea1959

Description

@fovea1959

The JSON being put out for distortion coefficients is not formatted correctly (missing commas):

  "dist": [[ 2.96051672e+01 -1.15858321e+04 -1.79874268e+00 -1.79700977e+00
  4.78984685e+05]]

Looks like some of the sample files have been corrected, but incorrectly; they were changed from a (1, 5) matrix to a (5, 0) matrix (caused by dropping the outer brackets).

Logitech Webcam file:

{
    "fx": 676.6192195641298,
    "fy": 676.8359339562655,
    "cx": 385.1137834870396,
    "cy": 201.81402152233636,
    "dist": [ 0.01632932, -0.36390723, -0.01638719,  0.02577886,  0.93133364]
  }

should be "dist": [[ 0.01632932, -0.36390723, -0.01638719, 0.02577886, 0.93133364]]

Suggest fixing calibrate_camera as:

        print('  "dist": {}'.format(dcoeffs.tolist()))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions