MATLAB: Undefined function or variable ‘worldPoints’

camera-calibrationComputer Vision Toolbox

Hi! I'm using the camera calibration app to calibrate my images. I already generate the cameraParameters from the app, and then I read my image in and tried to calibrate it. But I got some problems.
(1) when I called the function belowed, I got an error: Undefined function or variable 'worldPoints'. I don't understand why. I checked my cameraParameters, the `worldPoints` is there.
[R, t] = extrinsics(imagePoints, worldPoints, cameraParams);
(2) I don't know how to use the R and t to calibrate my connected object properties. I mean I use bwlabel() and regionprops() to find my connected components and then generate the Area and radii. How can I use R and t from the cameraParameter to calibrate it? Should I simply multiply t (the translator I guess is like calibration factor?) for the radii? Can I use the code like belowed? Thanks!!!
KeeperComponentsMeasurement=regionprops(keeperComponents,'Centroid','PixelIdxList','Area');
worldPoints1 = pointsToWorld(cameraParams, R, t, KeeperComponentsMeasurement);

Best Answer

At the time the line
[R, t] = extrinsics(imagePoints, worldPoints, cameraParams);
is executed, you have not assigned any value to the variable 'worldPoints'
See the example https://www.mathworks.com/help/vision/ref/extrinsics.html#bt9eb6w-7 where they show an assignment to worldPoints