opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
thin_plate_spline_common_inputs.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <filesystem>
6#include <functional>
7#include <utility>
8
9namespace opyn
10{
11 // Struct of runtime inputs that are common for all uses of the TPS
12 // scaling algorithm.
14
16 std::filesystem::path sourceLandmarksPath_,
17 std::filesystem::path destinationLandmarksPath_,
18 double sourceLandmarksPrescale_,
19 double destinationLandmarksPrescale_,
20 double blendingFactor_,
21 double warpingPenalty_) :
22
23 sourceLandmarksPath{std::move(sourceLandmarksPath_)},
24 destinationLandmarksPath{std::move(destinationLandmarksPath_)},
25 sourceLandmarksPrescale{sourceLandmarksPrescale_},
26 destinationLandmarksPrescale{destinationLandmarksPrescale_},
27 blendingFactor{blendingFactor_},
28 warpingPenalty{warpingPenalty_}
29 {}
30
32
33 std::filesystem::path sourceLandmarksPath;
34 std::filesystem::path destinationLandmarksPath;
38 bool applyAffineScale = true;
40 bool applyNonAffineWarp = true;
41 double blendingFactor = 1.0;
42 double warpingPenalty = 0.0;
43 };
44}
45
46template<>
47struct std::hash<opyn::ThinPlateSplineCommonInputs> final {
48 size_t operator()(const opyn::ThinPlateSplineCommonInputs& inputs) const noexcept
49 {
50 return osc::hash_of(
51 inputs.sourceLandmarksPath,
52 inputs.destinationLandmarksPath,
53 inputs.sourceLandmarksPrescale,
54 inputs.destinationLandmarksPrescale,
55 inputs.applyAffineRotation,
56 inputs.applyAffineScale,
57 inputs.applyAffineRotation,
58 inputs.applyNonAffineWarp,
59 inputs.blendingFactor,
60 inputs.warpingPenalty
61 );
62 }
63};
Definition component_registry.h:14
size_t hash_of(const T &v) noexcept(noexcept(std::hash< T >{}(v)))
Definition hash_helpers.h:24
Definition thin_plate_spline_common_inputs.h:13
bool applyNonAffineWarp
Definition thin_plate_spline_common_inputs.h:40
double destinationLandmarksPrescale
Definition thin_plate_spline_common_inputs.h:36
ThinPlateSplineCommonInputs(std::filesystem::path sourceLandmarksPath_, std::filesystem::path destinationLandmarksPath_, double sourceLandmarksPrescale_, double destinationLandmarksPrescale_, double blendingFactor_, double warpingPenalty_)
Definition thin_plate_spline_common_inputs.h:15
bool applyAffineTranslation
Definition thin_plate_spline_common_inputs.h:37
bool applyAffineScale
Definition thin_plate_spline_common_inputs.h:38
double warpingPenalty
Definition thin_plate_spline_common_inputs.h:42
double sourceLandmarksPrescale
Definition thin_plate_spline_common_inputs.h:35
friend bool operator==(const ThinPlateSplineCommonInputs &, const ThinPlateSplineCommonInputs &)=default
std::filesystem::path sourceLandmarksPath
Definition thin_plate_spline_common_inputs.h:33
double blendingFactor
Definition thin_plate_spline_common_inputs.h:41
std::filesystem::path destinationLandmarksPath
Definition thin_plate_spline_common_inputs.h:34
bool applyAffineRotation
Definition thin_plate_spline_common_inputs.h:39
size_t operator()(const opyn::ThinPlateSplineCommonInputs &inputs) const noexcept
Definition thin_plate_spline_common_inputs.h:48