How do I translate pixel coordinates to real world coordinates using a calibration target?

조회 수: 6 (최근 30일)
I have a 2xN array of pixel coordinates = A that correspond to the dots on a dotted calibration target (a sheet with dots on it that are a known distance apart).
I have a 2xN array of real-world-unit coordinates = B which contains the positions of the dots on the target.
How do I find a way to smoothly translate any coordinate that falls into the area of the points contained in A onto B, so that I can find a given point in real space for any point on the target, not just the points where the dots are?
A linear translation is not possible as the image contains distortions. I have tried functions like estimateCameraParameters and estimateCameraMatrix, but these apparently either require multiple images or non-coplanar points, both of which I do not have.

답변 (1개)

Image Analyst
Image Analyst 2021년 11월 18일
I think you can use scatteredInterpolant. Given a list of (xp, yp) pixel coordinates, and another separate list of real world (xr, yr) coordinates, you can essentially build a surface with scatteredInterpolant. So once you have that you can simply input the pixel coordinates and out pops the real world coordinates. Attached is a demo of scatteredInterpolant. I'm sure you can easily modify it, but the key is you need to know the real world coordinates for a certain set of image/pixel coordinates, but you said you know those.
  댓글 수: 6
Image Analyst
Image Analyst 2021년 11월 18일
편집: Image Analyst 2021년 11월 18일
This looks like it should be a perfect linear scaling:
s = load('export.mat')
TargetDots = s.TargetDots;
TargetDotsReal = s.TargetDotsReal;
% Show input
subplot(2, 1, 1);
scatter(TargetDots(:, 1), TargetDots(:, 2), 10, 'b', 'filled');
title('Target Dots')
subplot(2, 1, 2);
scatter(TargetDotsReal(:, 1), TargetDotsReal(:, 2), 10, 'r', 'filled');
title('Target Dots Real')
Why can't you simply do
estimatedY = 1 + 9 * (yTest - min(y)) / (max(y) - min(y));
estimatedX = 1 + 9 * (xTest - min(x)) / (max(x) - min(x));
???
_NB_
_NB_ 2021년 11월 19일
I cannot do a linear interpolation because for other images there may be more distortion, which could be along the X-axis, Y-Axis or random in nature.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Camera Calibration에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by