Depth estimation from live video stream

6 次查看(过去 30 天)
I have two calibrated cameras and webcam support package and image acquisition toolbox. in this post depth is estimated from two recorded videos but my application is real-time and I want to estimate depth from live video stream. how can I do this ?
  3 个评论
john john
john john 2016-2-9
@Vegard Brattland : thanks for your help. in this case it should estimate depth from live video stream .is snapshot() works for this case?
Brattv
Brattv 2016-2-9
编辑:Brattv 2016-2-9
The snapshot function should return images from both of your cameras. I have no idea if this will work but try
frameLeft = imageLeft;
frameRight = imageRight;
[frameLeftRect, frameRightRect] = ...
rectifyStereoImages(frameLeft, frameRight, stereoParams);
figure;
imshow(stereoAnaglyph(frameLeftRect, frameRightRect));
title('Rectified Video Frames');

请先登录,再进行评论。

回答(1 个)

Brattv
Brattv 2016-2-9
Posting the discussion in the comment as answer. Feel free to chose it if it solved the problem
1. Call the function "gigecamlist" from the command window. This should return a model if your camera is GigE Vision compliant.
2. Create two camera objects with the "gigecam" function. Use the serial number that was found with the gigecamlist command to seperate them. The call should be something like
cameraLeft = gigecam('serialnumber')
cameraRight = gigecam('serialnumber')
3. Use the "snapshot" function to get the images.
[imageLeft tsLeft] = snapshot(cameraLeft)
[imageRight tsRight] = snapshot(cameraRight)
The snapshot function should return images from both of your cameras. I have no idea if this will work but try
frameLeft = imageLeft;
frameRight = imageRight;
[frameLeftRect, frameRightRect] = ...
rectifyStereoImages(frameLeft, frameRight, stereoParams);
figure;
imshow(stereoAnaglyph(frameLeftRect, frameRightRect));
title('Rectified Video Frames');

Community Treasure Hunt

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

Start Hunting!

Translated by