1
- #define CV__ENABLE_C_API_CTORS // enable C API ctors (must be removed)
2
-
3
1
#include < opencv2/core.hpp>
4
2
#include < opencv2/core/utility.hpp>
5
3
#include < opencv2/imgproc/imgproc_c.h> // cvFindContours
@@ -69,7 +67,7 @@ int Mouse::m_y;
69
67
70
68
static void help ()
71
69
{
72
- printf (" Usage: openni_demo [templates.yml]\n\n "
70
+ printf (" Usage: example_rgbd_linemod [templates.yml]\n\n "
73
71
" Place your object on a planar, featureless surface. With the mouse,\n "
74
72
" frame it in the 'color' window and right click to learn a first template.\n "
75
73
" Then press 'l' to enter online learning mode, and move the camera around.\n "
@@ -231,10 +229,10 @@ int main(int argc, char * argv[])
231
229
{
232
230
// Compute object mask by subtracting the plane within the ROI
233
231
std::vector<CvPoint> chain (4 );
234
- chain[0 ] = pt1;
235
- chain[1 ] = cv::Point (pt2.x , pt1.y );
236
- chain[2 ] = pt2;
237
- chain[3 ] = cv::Point (pt1.x , pt2.y );
232
+ chain[0 ] = cvPoint ( pt1) ;
233
+ chain[1 ] = cvPoint (pt2.x , pt1.y );
234
+ chain[2 ] = cvPoint ( pt2) ;
235
+ chain[3 ] = cvPoint (pt1.x , pt2.y );
238
236
cv::Mat mask;
239
237
subtractPlane (depth, mask, chain, focal_length);
240
238
@@ -574,9 +572,9 @@ void subtractPlane(const cv::Mat& depth, cv::Mat& mask, std::vector<CvPoint>& ch
574
572
{
575
573
mask = cv::Mat::zeros (depth.size (), CV_8U);
576
574
std::vector<IplImage*> tmp;
577
- IplImage mask_ipl = mask;
575
+ IplImage mask_ipl = cvIplImage ( mask) ;
578
576
tmp.push_back (&mask_ipl);
579
- IplImage depth_ipl = depth;
577
+ IplImage depth_ipl = cvIplImage ( depth) ;
580
578
filterPlane (&depth_ipl, tmp, chain, f);
581
579
}
582
580
@@ -595,7 +593,7 @@ std::vector<CvPoint> maskFromTemplate(const std::vector<cv::linemod::Template>&
595
593
CvSeq * lp_contour = 0 ;
596
594
597
595
cv::Mat mask_copy = mask.clone ();
598
- IplImage mask_copy_ipl = mask_copy;
596
+ IplImage mask_copy_ipl = cvIplImage ( mask_copy) ;
599
597
cvFindContours (&mask_copy_ipl, lp_storage, &lp_contour, sizeof (CvContour),
600
598
CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
601
599
0 commit comments