64 Mat rgbMat(Size(640, 480), CV_8UC3, Scalar(0));
65 Mat rgbMat2(Size(640, 480), CV_8UC3, Scalar(0));
66 Mat rgbMat3(Size(640, 480), CV_8UC3, Scalar(0));
69 Mat depthMat(Size(640, 480), CV_16UC1);
70 Mat depthF (Size(640, 480), CV_8UC1);
82 freenect_sync_get_video((
void**)&
data, &
timestamp, 0, FREENECT_VIDEO_RGB);
85 rgbMat.data = (uchar*)
data;
92 qimage = QImage( (uchar*) rgbMat.data, rgbMat.cols, rgbMat.rows, rgbMat.step, QImage::Format_RGB888 );
107 depthMat.convertTo(depthF, CV_8UC1, 255.0/2048.0);
108 cvtColor( depthF, rgbMat2, CV_GRAY2RGB );
111 qimageDepth = QImage( (uchar*) rgbMat2.data, rgbMat2.cols, rgbMat2.rows, rgbMat2.step, QImage::Format_RGB888 );
141 vector<vector<Point> > lines;
142 vector<Vec4i> hierarchy;
144 cvtColor( rgbMat2,
gray, CV_BGR2GRAY );
147 findContours(
gray, lines, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE);
148 drawContours(
gray, lines, -1, Scalar(255, 0, 0), 2);
151 cvtColor(
gray, rgbMat3, CV_GRAY2RGB );
152 qimageOpenCV = QImage( (uchar*) rgbMat3.data, rgbMat3.cols, rgbMat3.rows, rgbMat3.step, QImage::Format_RGB888 );
177 if (state == Qt::Checked)
191 if (haarClassifierCascade ==
"none")
226 if (freenect_sync_set_tilt_degs(angle, 0))
228 emit
message(
"<font color=\"#FF0000\">ERROR: could not initialize Kinect camera.</font>");
239 emit
message(
"Kinect camera initialized.");