Move the sources to trunk
[opencv] / filters / Tracker3dFilter / include / ITracker.h
1 /*M///////////////////////////////////////////////////////////////////////////////////////
2 //
3 //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4 //
5 //  By downloading, copying, installing or using the software you agree to this license.
6 //  If you do not agree to this license, do not download, install,
7 //  copy or use the software.
8 //
9 //
10 //                        Intel License Agreement
11 //                For Open Source Computer Vision Library
12 //
13 // Copyright (C) 2002, Intel Corporation, all rights reserved.
14 // Third party copyrights are property of their respective owners.
15 //
16 // Redistribution and use in source and binary forms, with or without modification,
17 // are permitted provided that the following conditions are met:
18 //
19 //   * Redistributions of source code must retain the above copyright notice,
20 //     this list of conditions and the following disclaimer.
21 //
22 //   * Redistributions in binary form must reproduce the above copyright notice,
23 //     this list of conditions and the following disclaimer in the documentation
24 //     and/or other materials provided with the distribution.
25 //
26 //   * The name of Intel Corporation may not be used to endorse or promote products
27 //     derived from this software without specific prior written permission.
28 //
29 // This software is provided by the copyright holders and contributors "as is" and
30 // any express or implied warranties, including, but not limited to, the implied
31 // warranties of merchantability and fitness for a particular purpose are disclaimed.
32 // In no event shall the Intel Corporation or contributors be liable for any direct,
33 // indirect, incidental, special, exemplary, or consequential damages
34 // (including, but not limited to, procurement of substitute goods or services;
35 // loss of use, data, or profits; or business interruption) however caused
36 // and on any theory of liability, whether in contract, strict liability,
37 // or tort (including negligence or otherwise) arising in any way out of
38 // the use of this software, even if advised of the possibility of such damage.
39 //
40 //M*/
41
42
43 // ITracker.h
44
45 #ifndef ITRACKER_H
46 #define ITRACKER_H
47
48 #include <vector>
49 #include <objbase.h>
50 #include "cv.h"
51 #include "cvaux.h"
52
53 // ITracker is the interface used by the 3D Tracker filter to call the
54 // 2D trackers.
55 // {FC2DF436-EBBB-42b7-BC83-7D536D65F413}
56 DEFINE_GUID(IID_ITracker, 0xfc2df436, 0xebbb, 0x42b7, 0xbc, 0x83, 0x7d, 0x53, 0x6d, 0x65, 0xf4, 0x13);
57
58 // CATID_Trackers is the "Video Trackers" category of COM classes in the registry,
59 // which allows the 3D Tracker Filter Property Page to find the available trackers.
60 // {D9EFDB52-BCCA-4b4c-BC04-A78184FB2052}
61 DEFINE_GUID(CATID_Trackers, 0xd9efdb52, 0xbcca, 0x4b4c, 0xbc, 0x4, 0xa7, 0x81, 0x84, 0xfb, 0x20, 0x52);
62
63 interface ITracker : IUnknown
64 {
65     typedef std::vector<Cv3dTracker2dTrackedObject> TrackingInfo;
66
67     // CheckFormat: returns S_OK if the format is acceptable; otherwise a failure code.
68     STDMETHOD(CheckFormat)(IplImage *format) = 0;
69
70     // SetFormat: specifies the format of images that will be passed to Process.
71     // This is guaranteed to be called before Process is called. The tracker may
72     // use this to perform configuration or memory allocation based on the image
73     // format and size. Returns a failure code if the image format is not
74     // acceptable or if a configuration or allocation error occurs.
75     STDMETHOD(SetFormat)(IplImage *image_header) = 0;
76
77     // Process: perform tracking on the image. The format of the image will match
78     // the format passed to SetFormat.
79     STDMETHOD(Process)(IplImage *sample) = 0;
80
81     // GetTrackedObjects: returns the objects found in the preceding call
82     // to Process.
83     STDMETHOD(GetTrackedObjects)(TrackingInfo &tracked_objects) = 0;
84
85     // GetPropertyPage: returns the GUID of a property page object
86     // that supports configuration of the tracker. This returns S_OK
87     // if a property page is available; otherwise a failure code.
88     STDMETHOD(GetPropertyPage)(GUID *page) = 0;
89 };
90
91 #endif // ITRACKER_H