Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TemplateTracker.h
Go to the documentation of this file.
00001 /********************************************************************
00002 **                Image Component Library (ICL)                    **
00003 **                                                                 **
00004 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld          **
00005 **                         Neuroinformatics Group                  **
00006 ** Website: www.iclcv.org and                                      **
00007 **          http://opensource.cit-ec.de/projects/icl               **
00008 **                                                                 **
00009 ** File   : ICLCV/src/ICLCV/TemplateTracker.h                      **
00010 ** Module : ICLCV                                                  **
00011 ** Authors: Eckard Riedenklau, Christof Elbrechter                 **
00012 **                                                                 **
00013 **                                                                 **
00014 ** GNU LESSER GENERAL PUBLIC LICENSE                               **
00015 ** This file may be used under the terms of the GNU Lesser General **
00016 ** Public License version 3.0 as published by the                  **
00017 **                                                                 **
00018 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
00019 ** included in the packaging of this file.  Please review the      **
00020 ** following information to ensure the license requirements will   **
00021 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt                **
00022 **                                                                 **
00023 ** The development of this software was supported by the           **
00024 ** Excellence Cluster EXC 277 Cognitive Interaction Technology.    **
00025 ** The Excellence Cluster EXC 277 is a grant of the Deutsche       **
00026 ** Forschungsgemeinschaft (DFG) in the context of the German       **
00027 ** Excellence Initiative.                                          **
00028 **                                                                 **
00029 ********************************************************************/
00030 
00031 #pragma once
00032 
00033 #include <ICLUtils/Configurable.h>
00034 #include <ICLUtils/Uncopyable.h>
00035 #include <ICLCore/Img.h>
00036 namespace icl{
00037   namespace cv{
00038   
00039   
00041 
00042     class ICLCV_API TemplateTracker : public utils::Configurable, public utils::Uncopyable{
00043       struct Data; 
00044       Data *data;  
00045       
00046       public:
00048       struct Result{
00050         inline Result(const utils::Point32f &pos=utils::Point32f(-1,-1), 
00051                       float angle=0, float proximityValue=0,
00052                       const core::Img8u *matchedTemplateImage=0):
00053           pos(pos),angle(angle),proximityValue(proximityValue),
00054           matchedTemplateImage(matchedTemplateImage){}
00055         utils::Point32f pos; 
00056         float angle;  
00057         float proximityValue; 
00058 
00059         const core::Img8u *matchedTemplateImage;  
00060       };
00061   
00063 
00064       TemplateTracker(const core::Img8u *templateImage=0,
00065                       float rotationStepSizeDegree=1.0,
00066                       int positionTrackingRangePix=100, 
00067                       float rotationTrackingRangeDegree=45,
00068                       int coarseSteps=10,int fineSteps=1,
00069                       const Result &initialResult=Result());
00070   
00072       ~TemplateTracker();
00073       
00074       
00076       void showRotationLUT() const;
00077       
00079       void setRotationLUT(const std::vector<utils::SmartPtr<core::Img8u> > &lut);
00080       
00082 
00086       void setTemplateImage(const core::Img8u &templateImage, 
00087                             float rotationStepSizeDegree=1.0);
00088       
00090       Result track(const core::Img8u &image, const Result *initialResult=0,
00091                    std::vector<Result> *allResults=0);
00092   
00093     };
00094   
00095   } // namespace cv
00096 }
00097 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines