Open yesgvinayak opened 2 years ago
Any idea why it is happening. I am using ubuntu 20.04
In step 2 (python calibrate_camera.py
) you should have calibrated your camera, resulting in a calibration_matrix.yaml
file.
The intrinsic camera parameters and the distortion coefficients is different from camera to camera, so you have to adjust it to your specific camera. I implemented the camera calibration based on the example provided by OpenCV.
Without a calibrated camera, solvePnP
cannot be calculated and therefore the distance from the camera to the face cannot be calculated.
To generate your own calibration_matrix.yaml
please follow these steps:
camera_calibration.py
which should create a mp4 file with the current date and time.ffmpeg -i 2021-10-15_10:30:00.mp4 -f image2 frames/video_01-%07d.png
to extract each frame as a png from the video filecalibration
function from camera_calibration.py
which should generate a calibration_matrix.yaml
file for you. You have to adjust the chessboard_grid_size
parameters according to your chessboard.
https://github.com/pperle/gaze-data-collection/blob/0916354fc2d4bbbaacfdf09f92766f9f13636ae2/camera_calibration.py#L29For whatever reason if you are not able to generate calibration_matrix.yaml
file. PFA lines and dump these lines into a calibration_matrix.yaml
file.for at least running the code:
camera_matrix:
- - 891.6279056527413
- 0.0
- 244.78587599613516
- - 0.0
- 888.0080654876305
- 151.0235913286838
- - 0.0
- 0.0
- 1.0
dist_coeff:
- - 0.043441366471979555
- -0.25700965138546256
- -0.00988329500314542
- -0.008061643807825654
- 0.49774485697781073
rms: 0.5923613046263171
hi, When I try to visualise the data , I am getting an error. FileNotFoundError: [Errno 2] No such file or directory: './data/p00/calibration_matrix.yaml'