Undefined function or variable 'worldPoints'?

조회 수: 18 (최근 30일)
Ziming Zhong
Ziming Zhong 2017년 11월 23일
댓글: Ziming Zhong 2017년 12월 15일
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);
  댓글 수: 2
Walter Roberson
Walter Roberson 2017년 11월 23일
At that point in your code, worldPoints has not been assigned to.
Ziming Zhong
Ziming Zhong 2017년 11월 23일
What do you mean? You mean in the code for generating R and t? But I guess there the world points refer to the world points in the camera parameters. Am I right?

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

채택된 답변

Walter Roberson
Walter Roberson 2017년 11월 23일
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
  댓글 수: 1
Ziming Zhong
Ziming Zhong 2017년 12월 15일
Yeah. I thought the cameraParam already generate it. But yes, I have to run that code again. Thanks!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for USB Webcams에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by