Basic Image AlgorithmS Library
2.8.0
|
class can be used to warp sequences of pmd depth images into a second view with different parameters, including a different camera center. More...
#include <OpenGLFramework/SpecializedBatches/PMDWarp.hh>
Public Member Functions | |
void | ChangeZClipping (double zNear, double zFar) |
void | Draw () |
void | ExecuteLinearHypothesesAssignment (const BIAS::ProjectionParametersPerspective &relativePpp, double zNear, double zFar, float N, int output=0) |
Function is used to assign a hypotheses to the warped depth map. More... | |
BIAS::glfBatch & | GetBatch () |
BIAS::glfDepthBufferMode & | GetDepthBufferMode () |
void | Init (const BIAS::ProjectionParametersPerspective &pppd, bool targetParametersHaveDistortion=false) |
Initializes all neccessary data in order to render using a batch. More... | |
PMDWarp () | |
void | SetDispForDistanceAndScale (const float &dist_from_cam, const float &disp, const float &scale) |
if disparity output is required, then points with the distance (dist_from_cam) will get disparity (disp) all disparities will also be scaled with the given scale factor More... | |
void | SetRenderTarget (const BIAS::glfRenderTarget *renderTarget) |
void | SetTargetCameraParameters (const BIAS::ProjectionParametersPerspective &relativePpp, double zNear, double zFar) |
is also used to determine viewport More... | |
void | SetTargetCameraParameters (BIAS::Matrix4x4< double > modelViewMatrix, BIAS::Matrix4x4< double > projectionMatrix, unsigned int width, unsigned int height) |
void | SetTargetCameraParametersToGlobal (bool global) |
void | SetViewportSize (unsigned int width, unsigned int height) |
void | SetViewportToGlobal (bool global) |
void | UploadDepthMap (const BIAS::Image< float > &pmdDepthImage) |
Upload the pmd depth image to the graphics card. More... | |
void | UploadDepthMap (const BIAS::ImageBase &pmdDepthImage) |
Upload the pmd depth image to the graphics card. More... | |
void | UploadProjectiveTexture (const BIAS::Image< unsigned char > &projectiveTexture) |
Upload the color image to the graphics card. More... | |
void | UseProjectiveTexturing (const BIAS::ProjectionParametersPerspective &ppp) |
ppp extrinsicis have to be in global coordinates of pppd of Init call! projective texturing cannot deal with distortion! More... | |
~PMDWarp () | |
Protected Member Functions | |
void | SetupDefaultPrimitiveRendering_ () |
void | SetupShadersDefault_ () |
void | SetupShadersProjectiveTexturing_ () |
class can be used to warp sequences of pmd depth images into a second view with different parameters, including a different camera center.
usage:
deliverence of output can be controlled using the SetRenderTarget() method.
Definition at line 61 of file PMDWarp.hh.
PMDWarp::~PMDWarp | ( | ) |
Definition at line 248 of file PMDWarp.cpp.
PMDWarp::PMDWarp | ( | ) |
Definition at line 243 of file PMDWarp.cpp.
void PMDWarp::ChangeZClipping | ( | double | zNear, |
double | zFar | ||
) |
Definition at line 206 of file PMDWarp.cpp.
void PMDWarp::Draw | ( | ) |
Definition at line 213 of file PMDWarp.cpp.
References BIAS::TimeMeasure::PrintRealTime(), BIAS::TimeMeasure::Reset(), BIAS::TimeMeasure::Start(), and BIAS::TimeMeasure::Stop().
void PMDWarp::ExecuteLinearHypothesesAssignment | ( | const BIAS::ProjectionParametersPerspective & | relativePpp, |
double | zNear, | ||
double | zFar, | ||
float | N, | ||
int | output = 0 |
||
) |
Function is used to assign a hypotheses to the warped depth map.
The result will be pushed to the MRT target identified by output. The result is a 3D image the first two channels coding the two representants the warped depth is lying in between, if an exact representant is found, both will be the same. The third channels is holding the relative distance of the depth to the two representants. The range between zNear and zFar is equidistantly discretized into N intervalls.
Definition at line 458 of file PMDWarp.cpp.
References BIAS::glfShader::Create(), fragmentProgram_, BIAS::glfShader::GetInfoLog(), BIAS::glfShaderProgram::GetInfoLog(), BIAS::glfShaderProgram::Link(), SetTargetCameraParameters(), BIAS::glfShaderProgram::SetUniform(), and shaderProgram_.
glfBatch & PMDWarp::GetBatch | ( | ) |
Definition at line 69 of file PMDWarp.cpp.
BIAS::glfDepthBufferMode & PMDWarp::GetDepthBufferMode | ( | ) |
Definition at line 75 of file PMDWarp.cpp.
void PMDWarp::Init | ( | const BIAS::ProjectionParametersPerspective & | pppd, |
bool | targetParametersHaveDistortion = false |
||
) |
Initializes all neccessary data in order to render using a batch.
parametersHaveDistortion | is a flag the toggles the use of distortion parameters, if this is set to false then a shader using idealy perspective camera parameters is used, otherwise vertices are displaced so that they form a distorted image, uniform params are derived from target parameters (see SetTargetCameraParameters)! |
Definition at line 36 of file PMDWarp.cpp.
References BIAS::ProjectionParametersBase::GetImageSize().
void PMDWarp::SetDispForDistanceAndScale | ( | const float & | dist_from_cam, |
const float & | disp, | ||
const float & | scale | ||
) |
if disparity output is required, then points with the distance (dist_from_cam) will get disparity (disp) all disparities will also be scaled with the given scale factor
Definition at line 449 of file PMDWarp.cpp.
References BIAS::glfShaderProgram::SetUniform(), and shaderProgram_.
void PMDWarp::SetRenderTarget | ( | const BIAS::glfRenderTarget * | renderTarget | ) |
Definition at line 129 of file PMDWarp.cpp.
void PMDWarp::SetTargetCameraParameters | ( | const BIAS::ProjectionParametersPerspective & | relativePpp, |
double | zNear, | ||
double | zFar | ||
) |
is also used to determine viewport
Definition at line 143 of file PMDWarp.cpp.
References BIAS::ProjectionParametersPerspective::GetUndistortion().
Referenced by ExecuteLinearHypothesesAssignment().
void PMDWarp::SetTargetCameraParameters | ( | BIAS::Matrix4x4< double > | modelViewMatrix, |
BIAS::Matrix4x4< double > | projectionMatrix, | ||
unsigned int | width, | ||
unsigned int | height | ||
) |
Definition at line 166 of file PMDWarp.cpp.
void PMDWarp::SetTargetCameraParametersToGlobal | ( | bool | global | ) |
Definition at line 177 of file PMDWarp.cpp.
|
protected |
Definition at line 253 of file PMDWarp.cpp.
References BIAS::glfVertexFormat::AddAttribute(), BIAS::glfVertexFormat::ATTRIB_POSITION, BIAS::glfVertexFormat::ATTRIB_TEXCOORD, batch_, BIAS::glfVertexBuffer::Create(), BIAS::glfElementBuffer::Create(), defaultRendering_, depthImageHeight_, depthImageWidth_, elements_, BIAS::Vector3< T >::Normalize(), BIAS::Vector3< T >::NormL2(), pmdParams_, BIAS::glfBatch::SetElementBuffer(), BIAS::glfBatch::SetVertexBuffer(), BIAS::ProjectionParametersPerspective::UnProjectLocal(), and vertices_.
|
protected |
Definition at line 335 of file PMDWarp.cpp.
References BIAS::glfShaderProgram::AttachShader(), BIAS::glfShader::Create(), fragmentProgram_, geometryProgram_, BIAS::glfShaderProgram::GetProgramId(), BIAS::glfShaderProgram::Link(), BIAS::glfShaderProgram::SetUniform(), shaderProgram_, targetParametersHaveDistortion_, and vertexProgram_.
|
protected |
Definition at line 514 of file PMDWarp.cpp.
References BIAS::glfShader::Create(), fragmentProgram_, BIAS::glfShaderProgram::Link(), BIAS::glfShaderProgram::SetUniform(), shaderProgram_, targetParametersHaveDistortion_, and vertexProgram_.
void PMDWarp::SetViewportSize | ( | unsigned int | width, |
unsigned int | height | ||
) |
Definition at line 135 of file PMDWarp.cpp.
void PMDWarp::SetViewportToGlobal | ( | bool | global | ) |
Definition at line 193 of file PMDWarp.cpp.
void PMDWarp::UploadDepthMap | ( | const BIAS::Image< float > & | pmdDepthImage | ) |
Upload the pmd depth image to the graphics card.
Do not flip the image!
Definition at line 83 of file PMDWarp.cpp.
void PMDWarp::UploadDepthMap | ( | const BIAS::ImageBase & | pmdDepthImage | ) |
Upload the pmd depth image to the graphics card.
Do not flip the image!
Definition at line 89 of file PMDWarp.cpp.
void PMDWarp::UploadProjectiveTexture | ( | const BIAS::Image< unsigned char > & | projectiveTexture | ) |
Upload the color image to the graphics card.
Do not flip the image! projective texturing cannot deal with distortion!
Definition at line 123 of file PMDWarp.cpp.
void PMDWarp::UseProjectiveTexturing | ( | const BIAS::ProjectionParametersPerspective & | ppp | ) |
ppp extrinsicis have to be in global coordinates of pppd of Init call! projective texturing cannot deal with distortion!
Definition at line 95 of file PMDWarp.cpp.
References BIAS::CoordinateTransform3D::BecomeRelativeTransform(), BIAS::ProjectionParametersBase::GetC(), BIAS::ProjectionParametersBase::GetPose(), and BIAS::ProjectionParametersBase::SetPose().
|
protected |
Definition at line 178 of file PMDWarp.hh.
Referenced by SetupDefaultPrimitiveRendering_().
|
protected |
Definition at line 182 of file PMDWarp.hh.
Referenced by SetupDefaultPrimitiveRendering_().
|
protected |
Definition at line 167 of file PMDWarp.hh.
|
protected |
Definition at line 180 of file PMDWarp.hh.
Referenced by SetupDefaultPrimitiveRendering_().
|
protected |
Definition at line 179 of file PMDWarp.hh.
Referenced by SetupDefaultPrimitiveRendering_().
|
protected |
Definition at line 165 of file PMDWarp.hh.
Referenced by SetupDefaultPrimitiveRendering_().
|
protected |
Definition at line 172 of file PMDWarp.hh.
Referenced by ExecuteLinearHypothesesAssignment(), SetupShadersDefault_(), and SetupShadersProjectiveTexturing_().
|
protected |
Definition at line 173 of file PMDWarp.hh.
Referenced by SetupShadersDefault_().
|
protected |
Definition at line 158 of file PMDWarp.hh.
|
protected |
Definition at line 161 of file PMDWarp.hh.
|
protected |
Definition at line 190 of file PMDWarp.hh.
|
protected |
Definition at line 156 of file PMDWarp.hh.
|
protected |
Definition at line 169 of file PMDWarp.hh.
|
protected |
Definition at line 153 of file PMDWarp.hh.
Referenced by SetupDefaultPrimitiveRendering_().
|
protected |
Definition at line 157 of file PMDWarp.hh.
|
protected |
Definition at line 175 of file PMDWarp.hh.
|
protected |
Definition at line 170 of file PMDWarp.hh.
Referenced by ExecuteLinearHypothesesAssignment(), SetDispForDistanceAndScale(), SetupShadersDefault_(), and SetupShadersProjectiveTexturing_().
|
protected |
Definition at line 188 of file PMDWarp.hh.
Referenced by SetupShadersDefault_(), and SetupShadersProjectiveTexturing_().
|
protected |
Definition at line 154 of file PMDWarp.hh.
|
protected |
Definition at line 176 of file PMDWarp.hh.
|
protected |
Definition at line 171 of file PMDWarp.hh.
Referenced by SetupShadersDefault_(), and SetupShadersProjectiveTexturing_().
|
protected |
Definition at line 164 of file PMDWarp.hh.
Referenced by SetupDefaultPrimitiveRendering_().
|
protected |
Definition at line 160 of file PMDWarp.hh.