real time image processing using matlab and stereo camera

9 visualizaciones (últimos 30 días)
Newman
Newman el 22 de Jul. de 2015
Respondida: Thomas Dutrannois el 13 de Jun. de 2018
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???

Respuestas (2)

Dima Lisin
Dima Lisin el 22 de Jul. de 2015
Use the getsnapshot method of videoinput to acquire the frame.
  3 comentarios
Dima Lisin
Dima Lisin el 23 de Jul. de 2015
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 el 24 de Jul. de 2015
@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

Iniciar sesión para comentar.


Thomas Dutrannois
Thomas Dutrannois el 13 de Jun. de 2018
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.

Community Treasure Hunt

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

Start Hunting!

Translated by