source: level2/competencies/MotionDirectionDetection/src/CaptureFrame.h @ 322

Revision 322, 1.8 KB checked in by ginevra, 10 years ago (diff)
Line 
1// AUTHOR: Ginevra Castellano
2// Queen Mary University of London
3// DATE: 03/2010
4// VERSION: 1.0
5
6// Copyright (C) 2009 Ginevra Castellano
7// Queen Mary University of London
8
9// This file is part of the MotionDirectionDetection program
10
11// MotionDirectionDetection is free software: you can redistribute it and/or modify
12// it under the terms of the GNU Lesser General Public License as published by
13// the Free Software Foundation, either version 3 of the License, or
14// (at your option) any later version.
15
16// This program is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19// GNU Lesser General Public License for more details.
20
21// You should have received a copy of the GNU Lesser General Public License
22// along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
24// MotionDirectionDetection uses the OpenCV library
25// Copyright (C) 2000-2006, Intel Corporation, all rights reserved.
26// Third party copyrights are property of their respective owners.
27// See OpenCV_license.txt, in the program folder, for details.
28
29
30
31
32#ifndef _CAPTURE_FRAME
33#define _CAPTURE_FRAME
34
35#include "cv.h"
36#include "highgui.h"
37
38enum CaptureType {
39        FROM_AVI = 0,
40        FROM_CAMERA = 1
41};
42
43class CaptureFrame
44{
45        public:
46        CaptureFrame(void);
47        ~CaptureFrame(void);
48
49        bool StartCapture(CaptureType c, char* aviname = NULL);  // can specify whether to capture from camera or from avi file
50
51        bool CaptureNextFrame(void);
52
53        void AllocateFrames(int width, int height, int channels);
54        void DeallocateFrames(void);
55
56        IplImage* getFrameCopy(void);  // get current frame
57       
58        private:
59        IplImage* frame;
60    IplImage* frameCopy;
61        CvCapture* capture;  // Structure for getting video from camera or avi
62
63};
64
65#endif
Note: See TracBrowser for help on using the repository browser.