How to use camera calibration tool in driveworks-1.2

Hi!
I’ve updated driveworks-1.2
And I tried to calibrate the camera by referring to the following document doc/nvdwx_html/dwx_camera_calibration.html
But I got an error like the following and I could not go any further

I did the following:
Look at that.

  1. I used ID 98 AprilTag
  2. I wrote Bar Length
  3. I created an h264 movie using sample_camera_gmsl
  4. I used calibration-intrinsics-constraints and got the camera-0.json file
  5. I created a folder structure for use with calibration-graph-cli and copied the files to each folder
  6. And the following error occurred.

I hope to have a quick solution

nvidia@tegra-ubuntu:/usr/local/driveworks-1.2/tools/calibration$ sudo ./calibration-graph-cli --dir=/media/nvidia/Record/driveworks_data/calibration_ws/calib-data3
Arguments:
–data=
–dir=/media/nvidia/Record/driveworks_data/calibration_ws/calib-data3
–graph=
–offscreen=1
–showDebug=1
–targetDB=
WindowEGL: find EGL devices
WindowEGL: found 2 EGL devices
WindowEGL: init EGL with GLES3 context
WindowEGL: bind OpenGLES3 API
WindowEGL: offscreen mode → use EGL PBuffer surface 1280x800
WindowEGL: create EGL context
WindowEGL: assign EGL context to current thread
[13-11-2018 15:22:9] Initialize DriveWorks SDK v1.2.400
[13-11-2018 15:22:9] Release build with GNU 4.9.4 from v1.2.0-rc11-0-ga7f5475 against Vibrante PDK v5.0.10.3
[13-11-2018 15:22:9] Platform: Detected Drive PX2 - Tegra B
[13-11-2018 15:22:9] TimeSource: monotonic epoch time offset is 1542083523481645
[13-11-2018 15:22:9] TimeSource: PTP ioctl returned error. Synchronized time will not be available.
[13-11-2018 15:22:9] TimeSource: Could not detect valid PTP time source at ‘eth0’. Fallback to CLOCK_MONOTONIC.
[13-11-2018 15:22:9] Platform: number of GPU devices detected 2
[13-11-2018 15:22:9] Platform: currently selected GPU device discrete ID 0
[13-11-2018 15:22:9] SDK: Resources mounted from …/…/data/resources
[13-11-2018 15:22:9] SDK: Create NvMediaDevice
[13-11-2018 15:22:9] SDK: Create NvMediaIPPManager
[13-11-2018 15:22:9] SDK: use EGL display as provided
[13-11-2018 15:22:9] Loading calibration data from directory structure, dir=/media/nvidia/Record/driveworks_data/calibration_ws/calib-data3
[13-11-2018 15:22:9] Target database loaded
No files in external directory. Skipping external camera.
Cameras found: camera-0
[13-11-2018 15:22:9] Saving calibration data description to /media/nvidia/Record/driveworks_data/calibration_ws/calib-data3/calib-data.json
Parsing intrinsics
Camera camera-0
Parsing extrinsics’ constraints
New pose for camera camera-0
Found constraint between [camera-0, target-98]: 140 points
No car wheel targets declared, using camera camera-0 as world reference
[13-11-2018 15:22:10] Saved graph to /media/nvidia/Record/driveworks_data/calibration_ws/calib-data3/graph.json
Initializing camera intrinsics
Initializing intrinsics for camera camera-0
OcamCalib: initial calib
Closed form result: 960,604,964.321,0,0.00042929,-6.85958e-08,5.95977e-11, error: 5.67368e+08
OcamCalib: refine center
OcamCalib: new calib
OcamCalib: non-linear
OcamCalib: find inv poly
Final result: 819.874,874.086,1.01114,-0.0182765,0.00184451
: ,1443.1,0,-0.000203086,-8.42915e-08,-5.4629e-11
: ,-2489.41,27848.9,-84309.2,140311,-144026,92635.4,-36444.8,8038.65,-763.659
Closed-form camera initialization:
center=819.874,874.086
affine=1.01114,-0.0182765,0.00184451
poly=[1443.1,0,-0.000203086,-8.42915e-08,-5.4629e-11,]
inv poly=-2489.41,27848.9,-84309.2,140311,-144026,92635.4,-36444.8,8038.65,-763.659,]
reprojection error (libintrcalib)=6.2137
FOV: 111.192
Initializing poses for intrinsic constraints for camera camera-0
Stats: Median=nan, mean=4.18323, var=12.6872, std dev=3.56191, sample count=37812, min=0.0112821, max=43.4986
Refining camera intrinsics

Refining intriniscs for camera camera-0
Error before: Median=nan, mean=4.18323, var=12.6872, std dev=3.56191, sample count=37812, min=0.0112821, max=43.4986
Note: fixing principal point, D, and E for ocam camera
[13-11-2018 15:24:46] SDK: Release NvMediaDevice
[13-11-2018 15:24:46] Driveworks SDK released
[13-11-2018 15:24:46] SDK: Release NvMedia2D
[13-11-2018 15:24:46] Terminating app due to unexpected exception:
std::bad_alloc

Dear bcchoi,

The error seems like some sort of running out of memory issue. Could you check if the memory consumption grows too large and is not enough in this case.
Maybe it would help to reduce number of images in use.
Can we get the test data you are using? If yes, please upload the test data. Thanks.

Dear SteveNV

I reduced the number of images as you said and taken again.
But the result was the same.
So I attach the contents of my work.

Thanks
SteveNV

[url]https://bitbucket.org/bcchoi/calibration/downloads/calib-data5.zip[/url]

Dear bcchoi,

Sorry for late update.
Could you let me know if you want to calibrate the camera intrinsicaly or calibrate the position/orientation of the camera relative to the car.
The latter one is not possible given the data attached, as one need also markers on the floor and on the wheels.