mesutpiskin / opencv-fisheye-undistortion

OpenCV camera calibration and image undistortion.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how can i use the code on seperate file?

lunknowl opened this issue · comments

hi, after calibration, how can i save the calibration data to a file and load on seperate file?

Hi,
you can save the following variables in the file system (json, xml, npz, etc.). This data will be sufficient for image undistortion.

  • ret
  • mtx
  • dist
  • rvecs
  • tvecs

Example 1:

np.savez('calibrationdata.npz', mtx=mtx, dist=dist, rvecs=rvecs, tvecs=tvecs)

Example 2:

with open("fisheye_calibration_data.json", "w") as f: