3D calibration and undistortion

Hi all,
Here’s what I’m experiencing: I’m running the 3d analysis for the first time and am at the calibration and undistortion stage. Corner detection looks good for all camera-1 and camera-2 calibration images. However, upon running calibrate_cameras and check_undistortion, the undistort files are either completely black or contain odd, extreme crops/warps that do not include the grids. I’ve tried all alpha values (0:.1:1) and nothing seems to return a sensible result. Curious what your diagnosis might be. Attached are the original, checkerboard, and undistorted (.2 and .9 alpha) outs from the check_undistortion step.Thanks!

checkerboard_3d

the 3D plot looks good though; https://forum.image.sc/uploads/short-url/342STkqiC3ITeJwQlWw8R3z4Uw0.png

How does the 3D plotting look after running the rest?
Since you seemingly have a very wide angle lens, this a possible output (I would use alpha=.9 or higher)

1 Like

I had the same issue with all black undistorted files, but the final triangulation/plotting looked reasonable.

1 Like

Thanks for the quick reply! Unfortunately, I’m running into a problem that I ran into on my past attempt. I’m getting a no videos found error at the triangulate step. I’ve double checked the directory parameter, the presence of videos in that directory, and have played with different camera1/camera2 naming conventions, but with only middling success. Upon changing the naming conventions, I found errors that were only solved by altering the camera-1/camera-2-containing headings in the 3d config file to match the new convention. That may be unrelated. But all of this smells like a directory linking/directory contents search problem that I haven’t quite figured out despite some tinkering. Your continued guidance is deeply appreciated. Thanks!

changing the name will cause some issues (i.e. https://github.com/AlexEMG/DeepLabCut/blob/master/docs/Overviewof3D.md -->( CRITICAL! ) Edit the config.yaml file to set the camera names; note that once this is set, do not change the names!)

but without seeing the error, this is hard to diagnosis; can you post the full call and the terminal output?

Yes, I violated your rule. However, I changed the names back to original camera-1/camera-2 convention. This was the result:
In [6]: deeplabcut.triangulate(config_path3d,r’D:\deeplabcut_LHS\dlc_2d_190710_reach_right-Luke-2019-07-12\videos’,filterpredictions=True, filtertype=‘arima’, gputouse=0, save_as_csv=True)

Error: No videos found in the specified video path. D:\deeplabcut_LHS\dlc_2d_190710_reach_right-Luke-2019-07-12\videos Please make sure that the video names are specified with correct camera names as entered in the config file or perhaps the videotype is distinct from the videos in the path, I was looking for: avi. List of pairs:

Seems it doesn’t find pairs per the print statement; your screenshot doesn’t show the other camera file, is it named identically except for camera-2? Also, the file name doesn’t include .avi, so you might try editing the file name to explicitly include .avi

I’ve tried giving the filenames .avi and this folder has a number of video files in it - sorry for not covering my bases there. BUT! I think your reply may have the key. The camera names have different prefix strings, as they came from different cameras. I will try to give them the exact same names (aside from camera-1 and camera-2) and report back. I hoped your code was looking for strings with camera-1 or camera-2 at the end, not that the strings needed to be identical otherwise. Thanks! Will let you know!

It worked! That was the fix. Amazing. Couple thoughts: You and your team are amazing for providing this level of support. Secondly, in the case it was not clear to you from my experience, it was not clear to me that I needed to have my cameras named in this way from your (very helpful and well written) 3D calibration instruction document. Looking forward to diving into deeplabcut more!

1 Like

thanks for the feedback, glad it worked! I edited the docs, hopefully more clear that to find the pairs the videos should match except for camera names (and that can be anywhere in the string): https://github.com/AlexEMG/DeepLabCut/blob/master/docs/Overviewof3D.md