25 #ifndef __MULTIPLE_DEPTH_WARP_HH__
26 #define __MULTIPLE_DEPTH_WARP_HH__
28 #include <Geometry/Projection.hh>
29 #include <Geometry/ProjectionParametersPerspectiveDepth.hh>
30 #include <Geometry/ProjectionParametersPerspective.hh>
32 #include <OpenGLFramework/Base/glfTexture2D.hh>
33 #include <OpenGLFramework/Base/glfBatch.hh>
34 #include <OpenGLFramework/Base/glfFramebufferObject.hh>
36 #include <bias_config.h>
44 NONE = 0, POLYNOM = 1, LINEAR = 2
48 DISPARITY = 0, DEPTH = 1
62 Projection>& sourceCameras,
bool createDepthMaps =
true);
85 useProjectiveTexturing_ = enable;
93 int UploadDepthMap(
Image<float>& depthMap,
unsigned int index);
100 int SetDepthMap(
glfTexture2D* depthMap,
unsigned int index);
113 int Warp(
unsigned int index);
115 int SetupNViewsWarp(
const double& distToScreen,
116 const double& zoom,
const double& shift,
117 unsigned int numberOfViews,
unsigned int centralViewIndex,
bool separate =
true);
140 void SetDispForDistance(
const float& dist_from_cam,
const float& disp);
144 void SetBaseline(
const float& baseline);
151 void SetZNearAndZFar(
const float& zNear,
const float& zFar);
153 void SetDiscardAngle(
float degree);
155 void SetDepthScaleBeforeWarping(
float scale);
166 return resultDispTextures_[current_index_];
170 if (index < resultDispTextures_.size()) {
171 resultDispTextures_[index]->CopyToImage(dispMap);
179 if (index < resultDispTextures_.size()) {
180 return resultDispTextures_[index];
187 return &renderTarget_;
191 depthCorType_ = type;
199 return &resultTexturesForNViews_;
203 return &resultDepthMapsForNViews_;
207 multiStereoModus_ = stereo;
212 DEPTH_COR_TYPE depthCorType_;
213 WARPING_TYPE warpType_;
215 bool multiStereoModus_, initCalled_, flop_, flip_, createDepthMaps_, useProjectiveTexturing_, separate_, clearColorBuffer_;
217 float zNear_, zFar_, thr_, depthScaleBeforeWarping_;
229 bool focallengthContained_;
231 float minDepth_, maxDepth_, depthRange_;
233 unsigned numberOfSampForDepthCorr_;
235 double nViewsWarpDistToScreen_, nViewsWarpEyeDist_, nViewsWarpSceneScale_, nViewsWarpShift_;
237 unsigned int current_index_;
239 unsigned int numberOfViews_;
244 std::vector<glfTexture2D*> depthMaps_;
245 std::vector<glfTexture2D*> resultDepthMapsForNViews_;
246 std::vector<glfTexture2D*> resultTexturesForNViews_;
248 std::vector<glfTexture2D*> resultDispTextures_;
249 std::vector<glfTexture2D*> resultColorTextures_;
254 std::vector<Projection> sourceParams_;
255 std::vector<Vector3<double> > cameraCenters_;
263 std::vector<glfMatrix> modelViewMatricesForNViewWarp_;
264 std::vector<glfMatrix> projectionMatricesForNViewWarp_;
280 void SetupPrimitiveRendering_();
281 void SetupShaders_(
int shaderType);
An element buffer contains vertex indices that form primitives.
std::vector< glfTexture2D * > * GetResultDepthMapsFromNViewWarp()
Defines the usage of the depth buffer.
additional depth calibration parameters for a perspective depth camera to be used for ToF-(PMD) camer...
camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
int GetTextureAsImage(Image< float > &dispMap, unsigned int index)
glfFramebufferObject * GetFrameBufferObject()
A vertex buffer contains an array of vertices that can be used for rendering.
A batch represents a single Draw call including all parameters (render states).
A shader program composed of several shaders.
A GLSL vertex shader or fragment shader, which must be linked in a shader program.
This class hides the underlying projection model, like projection matrix, spherical camera...
void SwithToMultiStereoModus(bool stereo)
class for setting viewports
void FlipTextureCoordinates(bool flip)
void SetWarpType(WARPING_TYPE type)
A 4x4 matrix in native OpenGL format.
void FlopTextureCoordinates(bool flop)
void UseProjectiveTexturing(bool enable)
enable or disables use of projective texturing
std::vector< glfTexture2D * > * GetResultTexturesFromNViewWarp()
void SetDepthCorType(DEPTH_COR_TYPE type)
glfTexture2D * GetTexture(unsigned int index)
glfTexture2D * GetWarpedDispTexture()