Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DisplacementMapping.hh
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5 Multimediale Systeme der Informationsverarbeitung
6 Institut fuer Informatik
7 Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 #include <Base/Common/BIASpragmaStart.hh>
26 
27 #ifndef __DisplacementMapping_hh__
28 #define __DisplacementMapping_hh__
29 
30 #include <Image/BackwardMapping.hh>
31 
32 
33 
34 namespace BIAS {
35 
36  /** @class DisplacementMapping
37  @brief Maps image src to image sink with displacement mapl generated
38  by backwardmapping method
39 
40  TO-DO: - Displacement MAP Currently CONTAINS BIAS-PIXEL-COORDINATES
41  they must be converted into TEXTURE-COORDINATES
42 
43  @author amattal 05/2007
44  */
45  template <class InputStorageType, class OutputStorageType>
46  class BIASImage_EXPORT DisplacementMapping
47  : public BackwardMapping<InputStorageType, OutputStorageType> {
48  public:
49 
50  virtual ~DisplacementMapping();
51 
54 
55  /** required because assignment is */
57  (*this) = src;
58  }
59 
60  /** required because of const members */
63  BIASERR("dont copy me - not implemented.");
64  BIASABORT;
65  return *this;
66  }
67 
68  int SetDisplacementMap(Image<float>& dismap);
69 
70  /** @brief reimplementation for homography, takes sink and computes
71  coords in source taking the values from displacement map dismap_*/
72  virtual int GetSourceCoordinates_(const HomgPoint2D& sink,
73  HomgPoint2D& source) const;
74 
75  protected:
76  //says if the dismap_ is filled
77  bool mapped_;
78 
79  //Displacement Map of the Displacement Mapper
80  // *****************
81  //should be * interleaved *
82  // * 3-channel RGB *
83  // * flipped *
84  // * float-image * with values as follows:
85  // *****************
86  //dismap_(x,y) = (xx,yy,zz)
87  //(xx,yy) - corresponding unmapped TEXTUREcoordinates of sinkpoint (x,y)
88  // in the source image
89  // zz = -1.0 - unmapped pixel is not within borders of the image
90  // = 1.0 - unmapped pixel is within the image,
91  // unmapped coordinates of which are (xx,yy)
93 
96 
97  };
98 
99 
100 
101 
102 } // namespace
103 
104 #endif
105 
106 #include <Base/Common/BIASpragmaEnd.hh>
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
Definition: HomgPoint2D.hh:67
Abstract base class to map an image (texture) src to an image sink with an arbitrary continuous funct...
Maps image src to image sink with displacement mapl generated by backwardmapping method.
DisplacementMapping(const DisplacementMapping &src)
required because assignment is
DisplacementMapping< InputStorageType, OutputStorageType > & operator=(const DisplacementMapping &src)
required because of const members