i have stereo camera with two lens, i want to access each single lens of stereo camera one by one, how can i do that in matlab.? For example, i can seprate the image taken by stereocamera , i.e the image of left lens in one window and the image of right lens in other window, i want to achieve the same in live feed from my camera the live feed command preview only gives a combined feed of both cameras , i want feed of each single lens and then use "handshake" command to combine both feeds and get a 3d image
If you can take split images for left and right just do that and add them up to your own video stream.
You can run a loop, with every itteration you take a snapshot from the left and right side and then move them to a video player.
For one camera it would be:
%Assign cam cam = webcam();
% Capture one frame to get its size. videoFrame = snapshot(cam); frameSize = size(videoFrame);
% Create the video player object. videoPlayer = vision.VideoPlayer('Position', [100 100 [frameSize(2), frameSize(1)]+30]);
runLoop = true; FrameCount = 0;
while runLoop && FrameCount < 100
%Increase FrameCount by 1 FrameCount = FrameCount + 1 %Take a snapshot videoFrame = snapshot(cam);
%%%Do something here, like make the picture gray videoFrame = rgb2gray(videoFrame);
%Next frame in the Player step(videoPlayer, videoFrame);
%Check whether the video player window has been closed. runLoop = isOpen(videoPlayer);
If you say you can take images or snapshots from both cameras you can modify the code so you make two snapshots and use them then. Keep in mind to create a camera object and videoPlayer object for each camera.