StereoParams not being recognised

4 次查看(过去 30 天)
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