real time image processing using matlab and stereo camera

조회 수: 9 (최근 30일)
Newman
Newman 2015년 7월 22일
답변: Thomas Dutrannois 2018년 6월 13일
how do i process each frame of a video feed coming from a pair of stereo camera in matlab in real time?
I have written this code
right = videoinput('winvideo', 1, 'MJPG_640x480');
right1 = getselectedsource(right);
right.FramesPerTrigger = 1;
preview(right);
left = videoinput('winvideo', 2, 'MJPG_640x480');
left2 = getselectedsource(left);
left.FramesPerTrigger = 1;
preview(left);
Thsi fucntion creates two new windows and acquires video from a pair of webcam(stereo) 1 frame by frame.Now how do i do image processing on each frame??
How do i extract each frame of the real time video ,process it and then show the out put in real time in an another video?
I basically want to compute the dispairty map in real time using my disparity algorithm.
So i wud be rectifying and calibrating the images first.
this is my fucntion for rectification and disparity map for a static image/frame
% % Read in the stereo pair of images.
% I1 = imread('leftxy.png');
% I2 = imread('rightxy.png');
function [J1,J2]=calibdisp(stereoParams)
% Rectify the images.
I1=imread('leftxy.png');
I2=imread('rightxy.png');
[J1, J2] = rectifyStereoImages(I1, I2, stereoParams);
% Display the images before rectification.
figure;
imshow(stereoAnaglyph(I1, I2), 'InitialMagnification', 50);
title('Before Rectification');
% Display the images after rectification.
figure;
imshow(stereoAnaglyph(J1, J2), 'InitialMagnification', 50);
title('After Rectification');
how do i apply the same code for each frame of the real time video???

답변 (2개)

Dima Lisin
Dima Lisin 2015년 7월 22일
Use the getsnapshot method of videoinput to acquire the frame.
  댓글 수: 3
Dima Lisin
Dima Lisin 2015년 7월 23일
I am not sure exactly what you mean... Are you asking how to display the processed video? For that you should use vision.VideoPlayer or vision.DeployableVideoPlayer.
Newman
Newman 2015년 7월 24일
@dima lisin this is my code it is wrking but i am facing some problems pls see this http://in.mathworks.com/matlabcentral/answers/231004-real-time-disparity-map-in-matlab

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


Thomas Dutrannois
Thomas Dutrannois 2018년 6월 13일
How did you do to acquire both video ? Do they come from external cameras ? I'm trying to do such a thing but i don't know how to import video's in real time from mutiple cameras.

카테고리

Help CenterFile Exchange에서 Camera Calibration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by