1 #include <Base/Image/ImageIO.hh>
2 #include <OpenGLFramework/RenderingContext/glfPBuffer.hh>
3 #include <OpenGLFramework/RenderingContext/glfRenderingContext.hh>
6 #include <VideoSource/VideoSource_Kinect2.hh>
7 #include <OpenGLFramework/SpecializedBatches/MultipleDepthWarp.hh>
12 int main(
int argc,
char *argv[]) {
27 std::string cdir=
"/home/fkellner/20150415_calibration_kinects_only/";
28 std::string idir=
"/home/fkellner/20150415_test_kinect/";
31 ImageIO::Load(idir+
"kinect-main-00000-depth.mip", depthmapmain);
32 ImageIO::Load(idir+
"kinect-sieg-00000-depth.mip", depthmapsieg);
35 projmain.
Load(cdir+
"igor-kinect-calibration-main.xml");
36 projsieg.
Load(cdir+
"igor-kinect-calibration-sieg.xml");
37 std::vector<Projection> sourceCams;
38 sourceCams.push_back( projmain );
39 sourceCams.push_back( projsieg );
52 warp.
Init( *targetCam, sourceCams,
true);
58 ImageIO::Save(
"warp.mip", result);
virtual int Load(const std::string &filename)
convenience wrapper which tries to read different formats
camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
int Warp()
warps the depths maps for all sourceCameras to the target camera view as disparity / depth map ...
virtual void MakeCurrent()
Makes this context the current target for OpenGL calls.
int GetWarpedDisparity(Image< float > &dispMap)
gives the warped disparity / depth map as a bias image
virtual void SetC(const Vector3< double > &C, unsigned int cam=0)
Set center of camera with index cam.
BIAS::Quaternion< double > GetQ(unsigned int cam=0) const
return rotation quaternion of camera with index cam if cam>0 this is a relative pose in the coordinat...
int UploadDepthMap(Image< float > &depthMap, unsigned int index)
uploads the given depthMap to the gpu as texture depthMap is a depth map from source camera i ...
const ProjectionParametersBase * GetParameters(unsigned int cam=0) const
const parameter access function
This class hides the underlying projection model, like projection matrix, spherical camera...
Quaternion< QUAT_TYPE > Interpolate(const Quaternion< QUAT_TYPE > &to, const QUAT_TYPE &t) const
Spherical interpolation between this and given quaternion.
GLX pbuffer rendering context.
void FlipTextureCoordinates(bool flip)
void SetWarpType(WARPING_TYPE type)
virtual void Init(const glfRenderingContextConfig &config)
Initializes the rendering context with the given configuration.
void MultIP(const T &scalar)
int Init(const ProjectionParametersPerspective &targetCam, std::vector< Projection > &sourceCameras, bool createDepthMaps=true)
virtual void SetQ(const Quaternion< double > &Q, unsigned int cam=0)
Set rotation quaternion of camera with index cam.
Vector3< double > GetC(unsigned int cam=0) const
return Center of camera with index cam.
Configuration for a rendering context.