Make highgui.hpp independent from C API

This commit is contained in:
Andrey Kamaev
2013-04-07 22:45:38 +04:00
parent 288a0634c2
commit 0738ea7d0f
152 changed files with 899 additions and 594 deletions

View File

@@ -31,7 +31,7 @@ class Mouse
public:
static void start(const std::string& a_img_name)
{
cvSetMouseCallback(a_img_name.c_str(), Mouse::cv_on_mouse, 0);
cv::setMouseCallback(a_img_name.c_str(), Mouse::cv_on_mouse, 0);
}
static int event(void)
{
@@ -190,14 +190,14 @@ int main(int argc, char * argv[])
int num_modalities = (int)detector->getModalities().size();
// Open Kinect sensor
cv::VideoCapture capture( CV_CAP_OPENNI );
cv::VideoCapture capture( cv::CAP_OPENNI );
if (!capture.isOpened())
{
printf("Could not open OpenNI-capable sensor\n");
return -1;
}
capture.set(CV_CAP_PROP_OPENNI_REGISTRATION, 1);
double focal_length = capture.get(CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH);
capture.set(cv::CAP_PROP_OPENNI_REGISTRATION, 1);
double focal_length = capture.get(cv::CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH);
//printf("Focal length = %f\n", focal_length);
// Main loop
@@ -206,8 +206,8 @@ int main(int argc, char * argv[])
{
// Capture next color/depth pair
capture.grab();
capture.retrieve(depth, CV_CAP_OPENNI_DEPTH_MAP);
capture.retrieve(color, CV_CAP_OPENNI_BGR_IMAGE);
capture.retrieve(depth, cv::CAP_OPENNI_DEPTH_MAP);
capture.retrieve(color, cv::CAP_OPENNI_BGR_IMAGE);
std::vector<cv::Mat> sources;
sources.push_back(color);
@@ -224,7 +224,7 @@ int main(int argc, char * argv[])
cv::Point pt1 = mouse - roi_offset; // top left
cv::Point pt2 = mouse + roi_offset; // bottom right
if (event == CV_EVENT_RBUTTONDOWN)
if (event == cv::EVENT_RBUTTONDOWN)
{
// Compute object mask by subtracting the plane within the ROI
std::vector<CvPoint> chain(4);
@@ -331,7 +331,7 @@ int main(int argc, char * argv[])
cv::imshow("normals", quantized_images[1]);
cv::FileStorage fs;
char key = (char)cvWaitKey(10);
char key = (char)cv::waitKey(10);
if( key == 'q' )
break;