Ocean
Loading...
Searching...
No Matches
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
20namespace Ocean
21{
22
23namespace CV
24{
25
26namespace 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 */
33class 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 previous_H_current The homography transforming a point defined in the current layer into a point defined in the previous layer: previousPoint = previous_H_current * currentPoint, must be valid
47 */
48 inline InitializerHomographyMappingAdaptionF1(LayerF1& layer, const LayerF1& sourceLayer, RandomGenerator& randomGenerator, const SquareMatrix3& previous_H_current);
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 previous_H_current The homography transforming a point defined in the current layer into a point defined in the previous layer: previousPoint = previous_H_current * currentPoint, must be valid
56 */
57 inline InitializerHomographyMappingAdaptionF1(LayerF1& layer, const MappingF1& sourceMapping, RandomGenerator& randomGenerator, const SquareMatrix3& previous_H_current);
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 previous_H_current The homography transforming a point defined in the current layer into a point defined in the previous layer: previousPoint = previous_H_current * currentPoint, must be valid
65 */
66 inline InitializerHomographyMappingAdaptionF1(LayerF1& layer, const LayerI1& sourceLayer, RandomGenerator& randomGenerator, const SquareMatrix3& previous_H_current);
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.
103 const MappingI1* sourceMappingI1_ = nullptr;
104
105 /// The homography transforming a point defined in the current layer into a point defined in the previous layer.
107};
108
109inline InitializerHomographyMappingAdaptionF1::InitializerHomographyMappingAdaptionF1(LayerF1& layer, const LayerF1& sourceLayer, RandomGenerator& randomGenerator, const SquareMatrix3& previous_H_current) :
110 Initializer(layer),
111 InitializerF(layer),
112 InitializerRandomized(layer, randomGenerator),
113 InitializerSubset(layer),
114 Initializer1(layer),
115 sourceMappingF1_(&sourceLayer.mappingF1()),
116 previous_H_current_(previous_H_current)
117{
118 // nothing to do here
119}
120
121inline InitializerHomographyMappingAdaptionF1::InitializerHomographyMappingAdaptionF1(LayerF1& layer, const MappingF1& sourceMapping, RandomGenerator& randomGenerator, const SquareMatrix3& previous_H_current) :
122 Initializer(layer),
123 InitializerF(layer),
124 InitializerRandomized(layer, randomGenerator),
125 InitializerSubset(layer),
126 Initializer1(layer),
127 sourceMappingF1_(&sourceMapping),
128 previous_H_current_(previous_H_current)
129{
130 // nothing to do here
131}
132
133inline InitializerHomographyMappingAdaptionF1::InitializerHomographyMappingAdaptionF1(LayerF1& layer, const LayerI1& sourceLayer, RandomGenerator& randomGenerator, const SquareMatrix3& previous_H_current) :
134 Initializer(layer),
135 InitializerF(layer),
136 InitializerRandomized(layer, randomGenerator),
137 InitializerSubset(layer),
138 Initializer1(layer),
139 sourceMappingF1_(nullptr),
140 sourceMappingI1_(&sourceLayer.mappingI1()),
141 previous_H_current_(previous_H_current)
142{
143 // nothing to do here
144}
145
146}
147
148}
149
150}
151
152#endif // META_OCEAN_CV_SYNTHESIS_INITIALIZER_HOMOGRAPHY_MAPPING_ADAPTION_F_1_H
Initializer1(Layer &layer)
Creates a new initializer object.
Definition Initializer1.h:39
InitializerF(LayerF &layer)
Creates a new initializer object.
Definition InitializerF.h:45
const SquareMatrix3 previous_H_current_
The homography transforming a point defined in the current layer into a point defined in the previous...
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 &previous_H_current)
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
InitializerRandomized(Layer &layer, RandomGenerator &randomGenerator)
Creates a new initializer object.
Definition InitializerRandomized.h:46
InitializerSubset(Layer &layer)
Creates a new initializer object.
Definition InitializerSubset.h:57
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
SquareMatrixT3< Scalar > SquareMatrix3
Definition of the SquareMatrix3 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with ...
Definition SquareMatrix3.h:43
Namespace of the CV Synthesis library.
Definition Constraint.h:25
Namespace of the CV library.
Definition Advanced.h:17
The namespace covering the entire Ocean framework.
Definition Accessor.h:15