Ocean
InitializerHomographyMappingAdaptionF1.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_CV_SYNTHESIS_INITIALIZER_HOMOGRAPHY_MAPPING_ADAPTION_F_1_H
9 #define META_OCEAN_CV_SYNTHESIS_INITIALIZER_HOMOGRAPHY_MAPPING_ADAPTION_F_1_H
10 
17 
19 
20 namespace Ocean
21 {
22 
23 namespace CV
24 {
25 
26 namespace Synthesis
27 {
28 
29 /**
30  * This class implements an initializer that initializes the float mapping by the application of a previous mapping with corresponding homography.
31  * @ingroup cvsynthesis
32  */
33 class OCEAN_CV_SYNTHESIS_EXPORT InitializerHomographyMappingAdaptionF1 :
34  virtual public InitializerF,
35  virtual public InitializerRandomized,
36  virtual public InitializerSubset,
37  virtual public Initializer1
38 {
39  public:
40 
41  /**
42  * Creates a new initializer object.
43  * @param layer The layer for that the initial mapping has to be provided
44  * @param sourceLayer Source synthesis layer with same dimension as the initializer layer and float accuracy
45  * @param randomGenerator Random number generator
46  * @param homography Homography transformation that is applied
47  */
48  inline InitializerHomographyMappingAdaptionF1(LayerF1& layer, const LayerF1& sourceLayer, RandomGenerator& randomGenerator, const SquareMatrix3& homography);
49 
50  /**
51  * Creates a new initializer object.
52  * @param layer The layer for that the initial mapping has to be provided
53  * @param sourceMapping Source mapping with same dimension as the initializer layer and float accuracy
54  * @param randomGenerator Random number generator
55  * @param homography Homography transformation that is applied
56  */
57  inline InitializerHomographyMappingAdaptionF1(LayerF1& layer, const MappingF1& sourceMapping, RandomGenerator& randomGenerator, const SquareMatrix3& homography);
58 
59  /**
60  * Creates a new initializer object.
61  * @param layer The layer for that the initial mapping has to be provided
62  * @param sourceLayer Source synthesis layer with same dimension as the initializer layer and integer accuracy
63  * @param randomGenerator Random number generator
64  * @param homography Homography transformation that is applied
65  */
66  inline InitializerHomographyMappingAdaptionF1(LayerF1& layer, const LayerI1& sourceLayer, RandomGenerator& randomGenerator, const SquareMatrix3& homography);
67 
68  private:
69 
70  /**
71  * Initializes a subset of the entire mapping area.
72  * @see InitializerSubset::initializeSubset().
73  * @see initializeSubsetChannels().
74  */
75  void initializeSubset(const unsigned int firstColumn, const unsigned int numberColumns, const unsigned int firstRow, const unsigned int numberRows) const override;
76 
77  /**
78  * Initializes a subset of the entire mapping area.
79  * The source layer has float accuracy.
80  * @param firstColumn First column of the mapping area to be initialized
81  * @param numberColumns Number of columns of the mapping area to be handled
82  * @param firstRow First row of the mapping area to be initialized
83  * @param numberRows Number of rows of the mapping area to be handled
84  */
85  void initializeSubsetF1(const unsigned int firstColumn, const unsigned int numberColumns, const unsigned int firstRow, const unsigned int numberRows) const;
86 
87  /**
88  * Initializes a subset of the entire mapping area.
89  * The source layer has integer accuracy.
90  * @param firstColumn First column of the mapping area to be initialized
91  * @param numberColumns Number of columns of the mapping area to be handled
92  * @param firstRow First row of the mapping area to be initialized
93  * @param numberRows Number of rows of the mapping area to be handled
94  */
95  void initializeSubsetI1(const unsigned int firstColumn, const unsigned int numberColumns, const unsigned int firstRow, const unsigned int numberRows) const;
96 
97  private:
98 
99  /// Source mapping to be adapted with float accuracy.
101 
102  /// Source mapping to be adapted with integer accuracy.
104 
105  /// Homography transformation.
107 };
108 
110  Initializer(layer),
111  InitializerF(layer),
112  InitializerRandomized(layer, randomGenerator),
113  InitializerSubset(layer),
114  Initializer1(layer),
115  sourceMappingF1_(&sourceLayer.mappingF1()),
116  sourceMappingI1_(nullptr),
117  homography_(homography)
118 {
119  // nothing to do here
120 }
121 
123  Initializer(layer),
124  InitializerF(layer),
125  InitializerRandomized(layer, randomGenerator),
126  InitializerSubset(layer),
127  Initializer1(layer),
128  sourceMappingF1_(&sourceMapping),
129  sourceMappingI1_(nullptr),
130  homography_(homography)
131 {
132  // nothing to do here
133 }
134 
136  Initializer(layer),
137  InitializerF(layer),
138  InitializerRandomized(layer, randomGenerator),
139  InitializerSubset(layer),
140  Initializer1(layer),
141  sourceMappingF1_(nullptr),
142  sourceMappingI1_(&sourceLayer.mappingI1()),
143  homography_(homography)
144 {
145  // nothing to do here
146 }
147 
148 }
149 
150 }
151 
152 }
153 
154 #endif // META_OCEAN_CV_SYNTHESIS_INITIALIZER_HOMOGRAPHY_MAPPING_ADAPTION_F_1_H
This class is the base class for all initializers that are provided for a single frame only.
Definition: Initializer1.h:29
This class implements the base class for all initializer objects that are applied for mappings with f...
Definition: InitializerF.h:30
This class implements an initializer that initializes the float mapping by the application of a previ...
Definition: InitializerHomographyMappingAdaptionF1.h:38
const SquareMatrix3 homography_
Homography transformation.
Definition: InitializerHomographyMappingAdaptionF1.h:106
const MappingI1 * sourceMappingI1_
Source mapping to be adapted with integer accuracy.
Definition: InitializerHomographyMappingAdaptionF1.h:103
void initializeSubset(const unsigned int firstColumn, const unsigned int numberColumns, const unsigned int firstRow, const unsigned int numberRows) const override
Initializes a subset of the entire mapping area.
InitializerHomographyMappingAdaptionF1(LayerF1 &layer, const LayerF1 &sourceLayer, RandomGenerator &randomGenerator, const SquareMatrix3 &homography)
Creates a new initializer object.
Definition: InitializerHomographyMappingAdaptionF1.h:109
void initializeSubsetI1(const unsigned int firstColumn, const unsigned int numberColumns, const unsigned int firstRow, const unsigned int numberRows) const
Initializes a subset of the entire mapping area.
void initializeSubsetF1(const unsigned int firstColumn, const unsigned int numberColumns, const unsigned int firstRow, const unsigned int numberRows) const
Initializes a subset of the entire mapping area.
const MappingF1 * sourceMappingF1_
Source mapping to be adapted with float accuracy.
Definition: InitializerHomographyMappingAdaptionF1.h:100
This class implements the base class for all synthesis initializers.
Definition: Initializer.h:34
This class is the base class for all initializers that mainly initialize the synthesis mapping by a h...
Definition: InitializerRandomized.h:30
This class is the base class for all initializer objects that can separate the initialization process...
Definition: InitializerSubset.h:29
This class implements a single layer for pixel synthesis within one frame and sub-pixel accuracy.
Definition: LayerF1.h:44
This class implements a single layer for pixel synthesis within one frame and pixel accuracy.
Definition: LayerI1.h:41
Cost function:
Definition: MappingF1.h:52
This class implements the pixel mapping between source and target frames.
Definition: MappingI1.h:49
This class implements a generator for random numbers.
Definition: RandomGenerator.h:42
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15