Depth estimation from live video stream

조회 수: 3 (최근 30일)
john john
john john 2016년 2월 9일
답변: Brattv 2016년 2월 9일
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