Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed point cloud test code.

  • Loading branch information...
commit 42826b5c98dc492113c07d53fcc0ca9eb79c5bfe 1 parent ba771f2
@markusk authored
View
28 kinect/src/QKinect.cpp
@@ -474,6 +474,7 @@ void QKinect::toggleVideoState(bool _mode)
stopVideo();
}
}
+
//----------------------------------------------------------------------------------------------------------------------
void QKinect::toggleDepthState(bool _mode)
{
@@ -486,30 +487,3 @@ void QKinect::toggleDepthState(bool _mode)
stopDepth();
}
}
-//----------------------------------------------------------------------------------------------------------------------
-
-
-float QKinect::getDistanceAt(int x, int y)
-{
- return m_bufferDepthRaw16[y * FREENECT_FRAME_W + x];
-}
-
-
-ofPoint QKinect::getWorldCoordinateFor(int x, int y)
-{
- //Based on http://graphics.stanford.edu/~mdfisher/Kinect.html
- static const double fx_d = 1.0 / 5.9421434211923247e+02;
- static const double fy_d = 1.0 / 5.9104053696870778e+02;
- static const double cx_d = 3.3930780975300314e+02;
- static const double cy_d = 2.4273913761751615e+02;
-
-// ofxVec3f result;
- ofPoint result;
- const double depth = getDistanceAt(x,y)/100.0;
- result.x = float((x - cx_d) * depth * fx_d);
- result.y = float((y - cy_d) * depth * fy_d);
- result.z = depth;
-
- return result;
-}
-
View
11 kinect/src/QKinect.h
@@ -47,12 +47,6 @@
/// it needs to be a class so we can use the Qt thread system
//----------------------------------------------------------------------------------------------------------------------
-typedef struct {
- float x;
- float y;
- float z;
-} ofPoint;
-
class QKinectProcessEvents : public QThread
{
@@ -93,7 +87,6 @@ private :
/// be set before the thread is run with QThread::start
//----------------------------------------------------------------------------------------------------------------------
freenect_context *m_ctx;
-
};
@@ -140,10 +133,6 @@ public :
//----------------------------------------------------------------------------------------------------------------------
bool kinectDetected;
- float getDistanceAt(int x, int y);
-
- ofPoint getWorldCoordinateFor(int x, int y);
-
public slots :
//----------------------------------------------------------------------------------------------------------------------
View
33 kinect/src/RGBWindow.cpp
@@ -97,7 +97,7 @@ void RGBWindow::paintGL()
}
else if(m_mode == 1)
{
-// kinect->getDepth(m_rgb);
+ kinect->getDepth(m_rgb);
}
glBindTexture(GL_TEXTURE_2D, m_rgbTexture);
glTexImage2D(GL_TEXTURE_2D, 0, 3, 640, 480, 0, GL_RGB, GL_UNSIGNED_BYTE, &m_rgb[0]);
@@ -111,37 +111,6 @@ void RGBWindow::paintGL()
glTexCoord2f(1, 0); glVertex3f(640,0,0);
glTexCoord2f(1, 1); glVertex3f(640,480,0);
glTexCoord2f(0, 1); glVertex3f(0,480,0);
-
-
- // - - - - - -
- // drawPointClou
-
- if(m_mode == 1)
- {
- // ofScale(400, 400, 400);
- int w = 640;
- int h = 480;
- // ofRotateY(mouseX);
- // already done above: float* distancePixels = kinect->getDepth();
-
- glBegin(GL_POINTS);
- int step = 2;
- for (int y = 0; y < h; y += step)
- {
- for(int x = 0; x < w; x += step)
- {
- mx = 1;
- my = 1;
- mz = 1;
- ofPoint cur = kinect->getWorldCoordinateFor(x, y);
- glVertex3f(cur.x, cur.y, cur.z);
- }
- }
- // glEnd();
- }
- // - - - - - -
-
-
glEnd();
}
View
7 kinect/src/RGBWindow.h
@@ -64,13 +64,6 @@ private :
/// @brief the draw mode we are using
int m_mode;
- /// @brief the image data to draw point cloud
- std::vector<uint8_t> m_points;
-
- GLfloat mx;
- GLfloat my;
- GLfloat mz;
-
protected:
Please sign in to comment.
Something went wrong with that request. Please try again.