10#ifndef DMRECON_SINGLE_VIEW_H
11#define DMRECON_SINGLE_VIEW_H
31 typedef std::shared_ptr<SingleView>
Ptr;
32 typedef std::shared_ptr<SingleView const>
ConstPtr;
36 std::string
const& embedding);
39 void addFeature(std::size_t idx);
40 std::vector<std::size_t>
const& getFeatureIndices()
const;
41 int clampLevel(
int level)
const;
46 std::string createFileName(
float scale)
const;
50 math::Vec3f viewRay(
float x,
float y,
int level)
const;
52 void loadColorImage(
int minLevel);
54 void saveReconAsPly(std::string
const& path,
float scale)
const;
55 bool seesFeature(std::size_t idx)
const;
56 void prepareMasterView(
int scale);
59 std::size_t getViewID()
const;
71 std::string
const& _embedding);
77 std::string embedding;
80 std::vector<std::size_t> featInd;
82 bool has_target_level;
95 std::string
const& embedding)
101SingleView::addFeature(std::size_t idx)
103 featInd.push_back(idx);
106inline std::vector<std::size_t>
const &
107SingleView::getFeatureIndices()
const
113SingleView::clampLevel(
int level)
const
115 if (level < minLevel)
118 int maxLevel = this->img_pyramid->size() - 1;
119 if (level > maxLevel)
126SingleView::getMVEView()
const
132SingleView::getPyramidImg(
int level)
const
134 return this->img_pyramid->at(level).image;
138SingleView::getScaledImg()
const
140 return this->target_level.image;
144SingleView::createFileName(
float scale)
const
146 std::string fileName =
"mvs-";
156 return (this->worldToCam.mult(point, 1)[2] * this->source_level.invproj[0]);
162 assert(this->has_target_level);
163 return (this->worldToCam.mult(point, 1)[2] * this->target_level.invproj[0]);
167SingleView::seesFeature(std::size_t idx)
const
169 for (std::size_t i = 0; i < featInd.size(); ++i)
170 if (featInd[i] == idx)
178 assert(this->has_target_level);
183 math::Vec2f res(sp[0] / sp[2] - 0.5f, sp[1] / sp[2] - 0.5f);
191 math::Vec3f sp = this->img_pyramid->at(level).proj * cp;
193 math::Vec2f res(sp[0] / sp[2] - 0.5f, sp[1] / sp[2] - 0.5f);
198SingleView::getViewID()
const
200 return this->view->get_id();
Matrix class for arbitrary dimensions and types.
Vector class for arbitrary dimensions and types.
std::shared_ptr< Image< T > > Ptr
std::shared_ptr< Image< T > const > ConstPtr
std::shared_ptr< Scene > Ptr
std::shared_ptr< View > Ptr
std::shared_ptr< ImagePyramid const > ConstPtr
mve::FloatImage::Ptr confImg
mve::FloatImage::Ptr dzImg
std::shared_ptr< SingleView const > ConstPtr
mve::FloatImage::Ptr normalImg
std::shared_ptr< SingleView > Ptr
mve::FloatImage::Ptr depthImg
#define MVS_NAMESPACE_BEGIN
#define MVS_NAMESPACE_END
std::string get_filled(T const &value, int width, char fill='0')
Returns a string filled to the left to a length of 'width' chars.
std::string get(T const &value)
From arbitrary types to string conversion.