mirror of
https://github.com/opencv/opencv.git
synced 2026-12-02 21:22:43 -06:00
Fix 3D axes creation in the camera extrinsics sample (#31175)
Running camera_calibration_show_extrinsics.py with the bundled left_intrinsics.yml fails before plotting on Matplotlib 3.11.2. Figure.gca() rejects the projection keyword. Use Figure.add_subplot(111, projection='3d') to create the axes. Verified with Python 3.12, OpenCV 4.14.0 and the Agg backend. Both the default view and the --patternCentric view completed with samples/data/left_intrinsics.yml.
This commit is contained in:
@@ -200,7 +200,7 @@ def main():
|
||||
from mpl_toolkits.mplot3d import Axes3D # pylint: disable=unused-variable
|
||||
|
||||
fig = plt.figure()
|
||||
ax = fig.gca(projection='3d')
|
||||
ax = fig.add_subplot(1, 1, 1, projection='3d')
|
||||
ax.set_aspect("auto")
|
||||
|
||||
cam_width = args.cam_width
|
||||
|
||||
Reference in New Issue
Block a user