StereoParams not being recognised

조회 수: 3 (최근 30일)
Sander Veenendaal
Sander Veenendaal 2017년 1월 7일
답변: Jordan Ross 2017년 1월 10일
Hey everyone,
I'm trying to figure out a method to make a simulink model for real-time distance measurement to a specified object by using a stereo camera setup.
I've split the basic example ("Depth Estimation From Stereo Video") up into multiple function blocks. The thing I'm encountering and can't seem to fix is the StereoParams object not being recognised for some reason. I've run the Stereo Camera Calibration app, and I'm getting some good rectified images there, but as soon as my function has to use the StereoParams, it gives an error; "Undefined function or variable 'stereoParams'." I've tried pretty much everything I could think of.
The first bit of code I'm using is really really simple, and it's to rectify the stereo images:
function [Gerectificeerd_L,Gerectificeerd_R] = fcn(Video_In_L,Video_In_R)
coder.extrinsic('rectifyStereoImages');
[Gerectificeerd_L,Gerectificeerd_R] = rectifyStereoImages(Video_In_L,Video_In_R,stereoParams);
And that's actually it. It just doesn't seem to use it, but when I hover over the StereoParams object with my mouse and click on the left mouse button I can open it and look inside it, so it does appear to recognise it, but for some reason it doesn't use the variables in it, I guess.
Can anyone help me?

답변 (1개)

Jordan Ross
Jordan Ross 2017년 1월 10일
Hello Sander,
From the code snippet you provided, "stereoParams" should not be defined since it is not an input argument to your function. To fix this issue have an argument name "stereoParams" and ensure to call the function passes the StereoParams object to this argument.

카테고리

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