Workspace IndexKnowledge Notes › Pixels to millimetres — the step before the arm moves

#188PoC

Pixels to millimetres — the step before the arm moves

Camera calibration, ArUco pose and hand-eye alignment on a built-in webcam and a sheet of A4. The output is not a demo but two error numbers.

Not yet scoped — pip install opencv-python opencv-contrib-python, print one DICT_4X4_50 marker from chev.me/arucogen, and check that the axes render on a webcam with rough intrinsics (fx=fy=image width, cx/cy=centre). Real calibration second. docs.opencv.org

Why

The LeRobot card is about moving the arm; this is the step in front of it, and skipping it is why a cheap arm grabs at empty air. A policy trained on demonstrations learns actions in the robot's own coordinate frame, but everything the camera reports is in pixels, and nothing in the imitation-learning loop converts between them for you. So the question this card answers is the plainest one in robotics vision — two hundred pixels on screen is how many millimetres in the world? — and the reason it belongs in this catalogue rather than in a bookmark folder is that the honest answer is a measurement, not a pipeline. It also happens to be free: a built-in webcam and a sheet of A4 are the entire bill of materials, which makes it the cheapest way to find out where the ceiling actually is before spending anything on hardware. The V in VLA starts here.

How it works

Four steps, and only the last two are optional. Intrinsics: fifteen to twenty chessboard or ChArUco shots through cv2.calibrateCamera yield the matrix K (fx, fy, cx, cy) and the distortion coefficients, and reprojection RMS is the first of the two numbers this card exists to produce — under one pixel is the pass mark. Pose: an ArUco marker on the object or the gripper gives full 6-DOF position and rotation relative to the camera, and there is one version trap worth knowing before it costs half an hour — cv2.aruco.estimatePoseSingleMarkers was deprecated in OpenCV 4.7, so the current path is cv2.aruco.ArucoDetector for corners followed by cv2.solvePnP with SOLVEPNP_IPPE_SQUARE, which is why a large share of the tutorials online no longer run as written. Hand-eye: cv2.calibrateHandEye aligns the camera frame with the robot base frame, and the classic first mistake is not the algorithm choice (Tsai, Park, Horaud) but the setup — a camera mounted on the arm is eye-in-hand, a camera on a tripod is eye-to-hand, and getting that backwards produces a transform that is wrong in a way that still looks plausible. Inference: cv2.dnn runs an ONNX detector with no second framework, which is the natural lightweight pairing for an edge board like the Jetson Orin Nano Super and the reason that item sits next in the queue. The second number is the one that actually settles what this camera can do: put the marker at a distance measured with a ruler, compare it to tvec, and record the error as a percentage. Everything above is setup for those two figures — RMS and range error — and a card that reports them is worth more than one that reports that the axes rendered.

Where it lands in Jayverse

  • Auditor: adopt the "two numbers, not a demo" standard. Any PoC or feature claim in the Jayverse catalogue should report a measured error, like this card's RMS reprojection and range error, rather than a screenshot, before Auditor accepts it as checked.
  • Number: publish the error alongside the reading, not just the value. Apply the same reprojection-then-range-check pattern here: any distributed indicator should carry its own precision or error figure so a consumer can judge it the way this card judges millimetres per pixel.
  • CI: reject a PoC script that only prints success. Require the numeric error or latency figure the way this card requires RMS and range error before a calibration step, or any PoC, counts as done.

Key expressions

Words and phrases from this page worth keeping, with the Korean meaning and the sentence they come from.

Expression뜻 · 쓰이는 자리
bill of materials필요한 재료 목록, 준비물 전체 · 실험에 드는 비용이 얼마 안 됨을 강조할 때. "the entire bill of materials"
pass mark합격 기준선 · 어느 수치 이하면 통과로 볼지 정할 때. "under one pixel is the pass mark"
version trap버전 함정 · 구버전 예제 코드가 최신 버전에서 안 통하는 문제. "a version trap worth knowing"
deprecated(기능이) 더 이상 지원되지 않는, 폐기 예정인 · 옛날 API를 쓰면 안 되는 이유. "was deprecated in OpenCV 4.7"
eye-in-hand / eye-to-hand카메라가 팔에 달림 / 카메라가 고정됨 · 캘리브레이션 설정을 헷갈리면 안 되는 두 방식. "a camera mounted on the arm is eye-in-hand"
settle (decide)결정적으로 판가름하다 · 최종적으로 성능을 확정 짓는 수치를 말할 때. "actually settles what this camera can do"
look plausible그럴듯해 보이다(실제론 틀림) · 오차가 있어도 결과가 자연스러워 보일 때. "a transform that is wrong in a way that still looks plausible"
ceiling상한선, 한계치(비유) · 하드웨어에 투자하기 전에 알아둘 성능 한계. "find out where the ceiling actually is"
natural pairing자연스럽게 잘 맞는 조합 · 두 기술이 특히 궁합이 좋을 때. "the natural lightweight pairing for an edge board"
ArUco증강현실 마커 시스템(ArUco marker) · 카메라 포즈 추정을 위해 인쇄해 붙이는 정사각형 코드 마커. "print one DICT_4X4_50 marker from chev.me/arucogen"
ChArUco체스보드와 ArUco를 결합한 보정용 패턴(ChArUco board) · 카메라 내부 파라미터를 보정할 때 쓰는 표준 패턴. "fifteen to twenty chessboard or ChArUco shots"
DOF자유도(Degrees of Freedom) · 물체의 위치·회전을 나타내는 축의 개수, 여기선 6축 포즈. "full 6-DOF position and rotation relative to"
LeRobot허깅페이스의 로봇 학습 프레임워크 · 팔을 움직이는 정책을 다루는 다른 카드가 참조하는 프로젝트. "The LeRobot card is about moving the arm"
ONNX신경망 교환 포맷(Open Neural Network Exchange) · 프레임워크 간 호환되는 모델 포맷, 엣지 보드 추론에 사용. "cv2.dnn runs an ONNX detector with no second"
RMS평균제곱근 오차(Root Mean Square error) · 카메라 보정의 정확도를 나타내는 첫 번째 지표. "reprojection RMS is the first of the two"
VLA시각-언어-행동 모델(Vision-Language-Action) · 로봇이 보고 이해하고 행동하는 모델 계열, 이 카드는 그 '시각' 부분. "The V in VLA starts here."

← All Knowledge Notes · Workspace Index · Top ↑

픽셀에서 밀리미터로 — 팔이 움직이기 전 단계

노트북 웹캠과 A4 한 장으로 하는 카메라 캘리브레이션·ArUco 자세추정·hand-eye 정렬. 산출물은 데모가 아니라 오차 숫자 두 개입니다.

아직 범위 미정 — pip install opencv-python opencv-contrib-python, chev.me/arucogen에서 DICT_4X4_50 마커 하나 인쇄, 대략값 내부 파라미터(fx=fy=이미지 폭, cx·cy=중심)로 웹캠에 축이 그려지는지부터 확인. 제대로 된 캘리브레이션은 그다음. docs.opencv.org

LeRobot 카드가 "팔을 어떻게 움직이는가"라면 이 카드는 그 앞 단계이고, 이걸 건너뛰는 것이 저가 로봇팔이 허공을 집는 이유입니다. 시연으로 학습된 정책은 로봇 자신의 좌표계에서 행동을 배우는데 카메라가 보고하는 것은 전부 픽셀이고, 모방학습 루프 안 어디에도 그 둘을 변환해 주는 단계는 없습니다. 그래서 이 카드가 답하는 질문은 로보틱스 비전에서 가장 단순한 것입니다 — 화면의 200픽셀은 실제로 몇 밀리미터인가? 그리고 이것이 북마크 폴더가 아니라 이 카탈로그에 들어가는 이유는, 정직한 답이 파이프라인이 아니라 측정값이기 때문입니다. 게다가 비용이 0원입니다 — 노트북 내장 웹캠과 A4 한 장이 자재 명세의 전부라, 하드웨어에 돈을 쓰기 전에 천장이 어디인지 알아내는 가장 싼 방법이기도 합니다. VLA의 V가 여기서 시작합니다.

동작 방식

단계는 넷이고 뒤의 둘만 선택입니다. 내부 파라미터: 체스보드나 ChArUco 보드를 15~20장 찍어 cv2.calibrateCamera에 넣으면 행렬 K(fx·fy·cx·cy)와 왜곡계수가 나오고, 재투영 RMS가 이 카드가 만들려는 두 숫자 중 첫 번째입니다 — 1픽셀 미만이 합격선. 자세추정: 물체나 그리퍼에 붙인 ArUco 마커가 카메라 기준 6DOF 위치와 회전을 바로 줍니다. 여기 30분을 잡아먹기 전에 알아둘 버전 함정이 하나 있습니다 — cv2.aruco.estimatePoseSingleMarkers는 OpenCV 4.7에서 폐기됐으므로, 현행 경로는 cv2.aruco.ArucoDetector로 코너를 검출하고 cv2.solvePnP(플래그 SOLVEPNP_IPPE_SQUARE)로 자세를 푸는 것입니다. 인터넷 예제 상당수가 적힌 대로 돌지 않는 이유가 이것입니다. hand-eye: cv2.calibrateHandEye가 카메라 좌표계와 로봇 베이스 좌표계를 정렬하는데, 초보의 첫 실수는 알고리즘 선택(Tsai·Park·Horaud)이 아니라 설정입니다 — 카메라가 팔에 붙어 있으면 eye-in-hand, 삼각대에 있으면 eye-to-hand이고, 이걸 반대로 잡으면 그럴듯해 보이면서 틀린 변환이 나옵니다. 추론: cv2.dnn은 별도 프레임워크 없이 ONNX 검출 모델을 돌리는데, Jetson Orin Nano Super 같은 엣지 보드와 짝지을 때의 자연스러운 경량 조합이고 그 항목이 큐에서 다음 순서인 이유이기도 합니다. 이 카메라로 어디까지 할 수 있는지를 실제로 결정하는 것은 두 번째 숫자입니다: 마커를 자로 잰 거리에 놓고 tvec과 비교해 오차를 퍼센트로 기록합니다. 위의 전부는 그 두 수치 — RMS와 거리 오차율 — 를 위한 준비이고, 그것을 보고하는 카드가 "축이 그려졌다"고 보고하는 카드보다 값어치가 큽니다.

Jayverse에서의 위치

  • Auditor: "숫자 두 개, 데모 아님" 기준을 채택한다. Jayverse 카탈로그의 모든 PoC나 기능 주장은 스크린샷이 아니라 이 카드의 RMS 재투영 오차와 거리 오차 같은 측정된 오차를 보고해야 Auditor가 확인됐다고 인정한다.
  • Number: 값뿐 아니라 오차도 함께 공개한다. 같은 재투영 후 거리 확인 패턴을 적용한다. 배포되는 모든 지표는 자체 정밀도/오차 수치를 함께 담아, 이 카드가 픽셀당 밀리미터를 판단하듯 소비자가 판단할 수 있게 한다.
  • CI: "성공"만 출력하는 PoC 스크립트는 통과시키지 않는다. 이 카드가 캘리브레이션 단계에 RMS와 거리 오차를 요구하듯, 어떤 PoC든 완료로 치기 전에 숫자로 된 오차나 지연 수치를 요구한다.

핵심 표현

이 페이지의 영어 본문에서 배울 만한 단어와 표현, 뜻과 나온 자리.

Expression뜻 · 쓰이는 자리
bill of materials필요한 재료 목록, 준비물 전체 · 실험에 드는 비용이 얼마 안 됨을 강조할 때. "the entire bill of materials"
pass mark합격 기준선 · 어느 수치 이하면 통과로 볼지 정할 때. "under one pixel is the pass mark"
version trap버전 함정 · 구버전 예제 코드가 최신 버전에서 안 통하는 문제. "a version trap worth knowing"
deprecated(기능이) 더 이상 지원되지 않는, 폐기 예정인 · 옛날 API를 쓰면 안 되는 이유. "was deprecated in OpenCV 4.7"
eye-in-hand / eye-to-hand카메라가 팔에 달림 / 카메라가 고정됨 · 캘리브레이션 설정을 헷갈리면 안 되는 두 방식. "a camera mounted on the arm is eye-in-hand"
settle (decide)결정적으로 판가름하다 · 최종적으로 성능을 확정 짓는 수치를 말할 때. "actually settles what this camera can do"
look plausible그럴듯해 보이다(실제론 틀림) · 오차가 있어도 결과가 자연스러워 보일 때. "a transform that is wrong in a way that still looks plausible"
ceiling상한선, 한계치(비유) · 하드웨어에 투자하기 전에 알아둘 성능 한계. "find out where the ceiling actually is"
natural pairing자연스럽게 잘 맞는 조합 · 두 기술이 특히 궁합이 좋을 때. "the natural lightweight pairing for an edge board"
ArUco증강현실 마커 시스템(ArUco marker) · 카메라 포즈 추정을 위해 인쇄해 붙이는 정사각형 코드 마커. "print one DICT_4X4_50 marker from chev.me/arucogen"
ChArUco체스보드와 ArUco를 결합한 보정용 패턴(ChArUco board) · 카메라 내부 파라미터를 보정할 때 쓰는 표준 패턴. "fifteen to twenty chessboard or ChArUco shots"
DOF자유도(Degrees of Freedom) · 물체의 위치·회전을 나타내는 축의 개수, 여기선 6축 포즈. "full 6-DOF position and rotation relative to"
LeRobot허깅페이스의 로봇 학습 프레임워크 · 팔을 움직이는 정책을 다루는 다른 카드가 참조하는 프로젝트. "The LeRobot card is about moving the arm"
ONNX신경망 교환 포맷(Open Neural Network Exchange) · 프레임워크 간 호환되는 모델 포맷, 엣지 보드 추론에 사용. "cv2.dnn runs an ONNX detector with no second"
RMS평균제곱근 오차(Root Mean Square error) · 카메라 보정의 정확도를 나타내는 첫 번째 지표. "reprojection RMS is the first of the two"
VLA시각-언어-행동 모델(Vision-Language-Action) · 로봇이 보고 이해하고 행동하는 모델 계열, 이 카드는 그 '시각' 부분. "The V in VLA starts here."

← 전체 기술 노트 · 워크스페이스 인덱스 · 맨 위 ↑