HRS10Notes
Search:
Syllabus / HRS10Notes

http://itp.nyu.edu/varwiki/Syllabus/Computational-Cameras-S09

>http://codelaboratories.com/about/product/eye

  • Nui Group:

> http://nuigroup.com/ >

  • Nui Group's Community Core Vision:

> http://nuicode.com/projects/tbeta/files >

  • Tuio protocol, that they use with CCV:

> http://www.tuio.org/ >

  • A flash Tracking algorithm (one that helped me a lot for my final last year):

> http://www.urdalen.com/blog/?p=214 >

  • A good flash camera tracking library:

> http://blog.soulwire.co.uk/flash/actionscript-3/webcam-motion-detection-tracking/

<pre> If you don't already have this:

package {

    import flash.display.Sprite;
    import flash.media.Camera;
    import flash.media.Video;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.utils.ByteArray;
      import flash.events.Event;
    import flash.utils.Timer;
    import flash.events.TimerEvent;

    public class VideoProcessing extends Sprite
    {
        // Camera
        private var camera:Camera;

        // My Video
        private var videoOut:Video;

        // My Bitmapdata
        private var bmpd:BitmapData;

        // Bitmap
        private var bmp:Bitmap;

        private var timer:Timer;

        public function VideoProcessing()
        {
            trace("Starting");

            // Setup the camera
            camera = Camera.getCamera();

            // Video components
            videoOut = new Video();

            // Set positions
            videoOut.x = 0;
            videoOut.y = 0;

            // Attach camera to our video
            videoOut.attachCamera(camera);
            addChild(videoOut);

            // Create the bitmapdata object
            bmpd = new BitmapData(320,240);

               // Create the bitmap image
            bmp = new Bitmap(bmpd);

               // Add it to the stage
               bmp.x = 0;
               bmp.y = 240;
               addChild(bmp);           

            // Create timer
            timer = new Timer(10,0);
            timer.addEventListener(TimerEvent.TIMER, grabFrame);
            timer.start();

            trace("done starting");

        }


        private function grabFrame(e:TimerEvent):void
        {
            //trace("timer");

            // Save the frame to the bitmapdata object
            bmpd.draw(videoOut);

            // Modify the bmpd
            //http://itp.nyu.edu/~dbo3/cgi-bin/ClassWiki.cgi?ICMVideo#removeStillBg           
            for (var row:int=0; row<bmpd.height; row=row+1) { //for each row
                for(var col:int=0; col<bmpd.width; col=col+1) { //for each column
                      //get the color of this pixels
                      var pix:uint = bmpd.getPixel(col,row);

                    var red:int = pix >> 16;
                    var green:int = pix >> 8 & 0xff;
                    var blue:int = pix & 0xff

                    if (red > 50 && green > 50 && blue > 50)
                    {
                        bmpd.setPixel(col,row,0);
                    }
                }
            }

        }
    }

}

</pre>

Search
  Page last modified on January 05, 2010, at 03:51 PM