A REPORT ON FRAME GRABER CARD
SUBMITTED TO AKASH MECWAN
PREPARED BY NIKHILESH KHATRA (08BEC039) PRATIK PANCHAL (08BEC054) JAYSHIL PAREKH (08BEC056)
CERTIFICATE
This to certify that the report entitled FRAME GRABER CARD submitted by Nikhilesh khatra (08BEC039), Pratik Panchal (08BEC054) and Jayshil Parekh(08BEC056) as the partial fulfillment of the requirements for the award of the degree of Bachelor of Technology in Electronics & Communication of Institute of Technology Nirma University is the record of work carried out by his under my supervision and guidance. The work submitted has in our opinion reached a level required for being accepted for the examination. The results embodied in this work to the best of our knowledge have not been submitted to any other University or Institution for award of any degree or diploma.
Date: GUIDE Akash Macwan Prof.A.S.Ranade H.O.D(EE) Nirma University
INTRODUCTION
A frame grabber is an electronic device that captures individual, digital still frames from an analog video signal or a digital video stream. It is usually employed as a component of a computer vision system, in which video frames are captured in digital form and then displayed, stored or transmitted in raw or compressed digital form. Historically, frame grabbers were the predominant way to interface cameras to PC's. This has substantially changed in recent years as direct camera connections via USB, Ethernet and IEEE 1394 ("FireWire") interfaces have become prevalent. Early frame grabbers had only enough memory to acquire (i.e., "grab") and store a single digitized video frame, hence the name. Modern frame grabbers typically can store multiple frames and compress them in real time using algorithms such as MPEG2 and JPEG. Frame grabbers that perform compression on the video frames are referred to as "Active Frame Grabbers," while frame grabbers that simply capture raw video data are called "Passive Frame Grabbers." Technological demands in fields such as radar acquisition, manufacturing and remote guidance have led to the development of frame grabbers with the ability to capture images at high frame rates and resolutions.
TYPES OF FRAME GRABBERS
Active and Passive frame grabbers: Frame grabbers that compress the frames, as they are produced, with some algorithm like JPEG, are called active frame grabbers whereas those which do not do so are called passive frame grabbers Analog and Digital frame grabbers: Frame grabbers that produce frames from an input of analog composite video signal are called analog frame grabbers. Those which produce frames from a digital video source are called digital frame grabbers. Block Diagram Analog frame grabbers:
Digital frame grabbers:
The process of frame grabbing is self-evident from the above block diagrams. The processor here is used for image compression by running an algorithm (for example, JPEG) and also for storing the frames to memory. Besides these blocks, all frame grabbers include one or more general purpose I/O ports, which can be used to trigger frame grabbing externally or to trigger other devices when a frame is grabbed.
APPLICATION
Manufacturing "Pick and place" machines are often used to mount electronic components on circuit boards during the circuit board assembly process. Such machines use one or more cameras to monitor the robotics that places the components. Each camera is paired with a frame grabber that digitizes the analog video, thus converting the video to a form that can be processed by the machine software. Healthcare Frame grabbers are used in medicine for many applications including telenursing and remote guidance. In situations where an expert at another location needs to be consulted, frame grabbers capture the image or video from the appropriate medical equipment so it can be sent digitally to the distant expert. Network Security Frame grabbers may be used in security applications. For example, when a potential breach of security is detected, a frame grabber captures an image or a sequence of images, and then the images are transmitted across a digital network where they are recorded and viewed by security personnel. Personal Use In recent years with the rise of personal video recorders like camcorders, mobile phones,etc. video and photo applications have gained ascending prominence. Frame grabbing is becoming very popular on these devices. Astronomy & Astrophotography Amateur astronomers and astrophotographers use frame grabbers when using analog "low light" cameras for live image display and internet video broadcasting of celestial objects. Frame grabbers are essential to connect the analog cameras used in this application to the computers that store or process the images. Day/night security cameras are popular in this field.
DESCRIPTION OF OPENCV
General description Open source computer vision library in C/C++. Optimized and intended for real-time applications. OS/hardware/window-manager independent. Generic image/video loading, saving, and acquisition. Both low and high level API. Provides interface to Intel's Integrated Performance Primitives (IPP) with processor specific optimization (Intel processors). Features Image data manipulation (allocation, release, copying, setting, conversion). Image and video I/O (file and camera based input, image/video file output). Matrix and vector manipulation and linear algebra routines (products, solvers, eigenvalues, SVD). Various dynamic data structures (lists, queues, sets, trees, graphs). Basic image processing (filtering, edge detection, corner detection, sampling and interpolation, color conversion, morphological operations, histograms, image pyramids). Structural analysis (connected components, contour processing, distance transform, various moments, template matching, Hough transform, polygonal approximation, line fitting, ellipse fitting, Delaunay triangulation). Camera calibration (finding and tracking calibration patterns, calibration, fundamental matrix estimation, homography estimation, stereo correspondence). Motion analysis (optical flow, motion segmentation, tracking). Object recognition (eigen-methods, HMM). Basic GUI (display image/video, keyboard and mouse handling, scroll-bars). Image labeling (line, conic, polygon, text drawing) OpenCV modules cv - Main OpenCV functions. cvaux - Auxiliary (experimental) OpenCV functions. cxcore - Data structures and linear algebra support. highgui - GUI functions.
VC++ CODE
// videoapp.cpp : Defines the entry point for the console application. //// camera capture.cpp : Defines the entry point for the console application.
#include "stdafx.h" #include <cv.h> #include <highgui.h> #include <string.h> #include <sstream> #include <iostream>
using namespace std;
char *generatename(int n) { std::stringstream ss; ss<<"c:\\frames\\frame"<<n<<".jpg"; std::string temp=ss.str(); char* buf=new char[temp.length()]; strcpy(buf,temp.c_str()); return buf; } int main() { CvCapture* capture = 0; //capture object initialization
capture = cvCaptureFromCAM(1); //capture object interfacing with webcam
if(!capture) { printf("Could not initialize capturing...\n"); return -1; }
cvNamedWindow("video"); for(int i=0;i<50;i++) { IplImage* frame = 0; //initializing Iplimage structure to store current frames. frame = cvQueryFrame(capture); //Query the current frame from capture structure.
//cvAddS(frame,cvScalar(100,0,0),frame); //cvScale(frame,frame,2); //cvErode(frame,frame,0,2);
cvShowImage("video", frame); char *name= generatename(i); cvSaveImage(name,frame); int c = cvWaitKey(20); if((char)c==27 ) break; } cvReleaseCapture(&capture); return 0;}
MATLAB CODE
clc; clear all; a = imaqhwinfo; [camera_name, camera_id, format] = getCameraInfo(a); % Capture the video frames using the videoinput function % You have to replace the resolution & your installed adaptor name. vid = videoinput(camera_name, camera_id, format); % Set the properties of the video object set(vid,'FramesPerTrigger',Inf); set(vid, 'ReturnedColorspace', 'rgb'); vid.FrameGrabInterval = 2; start(vid) i=0; while(vid.FramesAcquired<=200) % Set a loop that stop after 100 frames of acquisition % Get the snapshot of the current frame data = getsnapshot(vid); str=strcat('C:\mframes\image',num2str(i),'.jpg'); imshow(data); hold on imwrite(data,str); i=i+1; hold off end stop(vid); % Flush all the image data stored in the memory buffer. flushdata(vid);
CONCLUSION
The Frame Grabber can capture a single frame from any video clip in your current project. The grabbed frame can be added directly to your movie or saved to disk in any of a number of standard graphics formats. Once you have saved a grabbed frame to disk, you can use it in other software applications, manipulate it in image-editing software import it back into your movies as a still image with Album or one of the title editors. Direct camera connections via USB, Ethernet and IEEE 1394 ("FireWire") interfaces have become practical and prevalent. Modern frame grabbers are typically able to store multiple frames and compress the frames in real time using algorithms such as MPEG2 & JPEG.
REFERENCE
http://en.wikipedia.org/wiki/Frame_grabber http://en.wikipedia.org/wiki/OpenCV http://www.aishack.in/2010/02/installing-and-getting-opencv-running