vlm_agent/calibrate_camera.ipynb

34 lines
846 B
Plaintext
Raw Normal View History

2025-05-18 20:56:32 +08:00
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "plaintext"
}
},
"outputs": [],
"source": [
"import numpy as np\n",
"\n",
"# 假设棋盘格尺寸为8x6方格尺寸为25mm0.025m\n",
"chessboard_size = (8, 6)\n",
"square_size = 0.025 # 25mm = 0.025m\n",
"\n",
"# 生成棋盘格每个角点的世界坐标二维坐标Z坐标设为0\n",
"objp = np.zeros((chessboard_size[0] * chessboard_size[1], 3), np.float32)\n",
"objp[:, :2] = np.mgrid[0:chessboard_size[0], 0:chessboard_size[1]].T.reshape(-1, 2) * square_size\n",
"objp = objp[:, :2] # 只保留 X 和 Y 坐标,忽略 Z 坐标"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2
}