3D Photography

3D Girls and Guns

Wednesday, January 23, 2008

RealTime 3D in MatLab

I messed around in MatLab today to discover it has a fairly simple video capturing API. So, I hooked up two webcams and wrote a quick little program to merge the two video streams in realtime into a single anaglyph video steam. The result: A realtime 3D video stream. Here’s a screenshot (yes, my webcams suck):


I’m thinking it would be neat to put the cameras in a plastic face at the show and let people look at themselves in 3D…

posted by asm at 3:48 pm  

2 Comments »

  1. 1.hello !!
    though this post is really old

    but its amazing that i found it

    i wanna do the same thing

    i wrote a coede but it seems it has problems if you would please send me your code or have a look on my code and tell me what’s the mistake with it

    this is my code ::::

    clear all
    close all
    clc;
    vid = videoinput(‘winvideo’,1, ‘YUY2_640×480′);
    vid1 = videoinput(‘winvideo’,2, ‘YUY2_640×480′);
    % to convert to rgb colors
    vid.ReturnedColorSpace = ‘rgb’;
    vid1.ReturnedColorSpace = ‘rgb’;
    set(vid,’FramesPerTrigger’,1);
    set(vid1,’FramesPerTrigger’,1);

    while (1)
    start(vid);
    start(vid1);

    %retrieves all the frames acquired at the last trigger
    data = getdata(vid);
    data1 = getdata(vid1);
    %processes the color channels of the videos
    data(:,:,1)=0;
    data1(:,:,2:3)=0;
    %to display them in one video
    result=data+data1
    imshow(result);
    drawnow;
    end
    stop(vid),delete(vid),clear vid;
    ::::
    hope you can help me

    Comment by zia — December 14, 2010 @ 6:10 am

  2. hi tnx very much!good luck

    Comment by mostafa — April 18, 2011 @ 12:06 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment

Powered by Hamsters - All work © 2009