MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
patch_optimization.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015, Ronny Klowsky, Simon Fuhrmann
3 * TU Darmstadt - Graphics, Capture and Massively Parallel Computing
4 * All rights reserved.
5 *
6 * This software may be modified and distributed under the terms
7 * of the BSD 3-Clause license. See the LICENSE.txt file for details.
8 */
9
10#ifndef DMRECON_PATCH_OPTIMIZATION_H
11#define DMRECON_PATCH_OPTIMIZATION_H
12
13#include <iostream>
14
15#include "math/vector.h"
16#include "dmrecon/defines.h"
18#include "dmrecon/single_view.h"
20
22
23struct Status
24{
25 std::size_t iterationCount;
28};
29
31{
32public:
34 std::vector<SingleView::Ptr> const& _views,
35 Settings const& _settings,
36 int _x, // Pixel position
37 int _y,
38 float _depth,
39 float _dzI,
40 float _dzJ,
41 IndexSet const& _globalViewIDs,
42 IndexSet const& _localViewIDs);
43
44 void computeColorScale();
45 float computeConfidence();
46 float derivNorm();
47 void doAutoOptimization();
48 float getDepth() const;
49 float getDzI() const;
50 float getDzJ() const;
51 IndexSet const& getLocalViewIDs() const;
52 math::Vec3f getNormal() const;
53 float objFunValue();
54 void optimizeDepthOnly();
55 void optimizeDepthAndNormal();
56
57private:
58 std::vector<SingleView::Ptr> const& views;
59 Settings const& settings;
60 // initial values and settings
61 const int midx;
62 const int midy;
63
64 float depth;
65 float dzI, dzJ; // represents patch normal
66 std::map<std::size_t, math::Vec3f, std::less<std::size_t> > colorScale;
67 Status status;
68
69 PatchSampler::Ptr sampler;
70 std::vector<int> ii, jj;
71 std::vector<float> pixel_weight;
72 LocalViewSelection localVS;
73};
74
75inline float
76PatchOptimization::getDepth() const
77{
78 return depth;
79}
80
81inline float
82PatchOptimization::getDzI() const
83{
84 return dzI;
85}
86
87inline float
88PatchOptimization::getDzJ() const
89{
90 return dzJ;
91}
92
93inline IndexSet const&
94PatchOptimization::getLocalViewIDs() const
95{
96 return localVS.getSelectedIDs();
97}
98
99inline math::Vec3f
100PatchOptimization::getNormal() const
101{
102 return sampler->getPatchNormal();
103}
104
106
107#endif
Vector class for arbitrary dimensions and types.
Definition vector.h:87
std::shared_ptr< PatchSampler > Ptr
IndexSet const & getSelectedIDs() const
#define MVS_NAMESPACE_BEGIN
Definition defines.h:18
#define MVS_NAMESPACE_END
Definition defines.h:19
std::set< std::size_t > IndexSet
Definition defines.h:24
std::size_t iterationCount