Make imgproc.hpp independent from C API

This commit is contained in:
Andrey Kamaev
2013-04-06 18:16:51 +04:00
parent 7ac0d86992
commit 288a0634c2
95 changed files with 1400 additions and 1300 deletions

View File

@@ -197,7 +197,7 @@ void detectAndDraw( Mat& img,
cv::ocl::oclMat image(img);
cv::ocl::oclMat gray, smallImg( cvRound (img.rows/scale), cvRound(img.cols/scale), CV_8UC1 );
cv::ocl::cvtColor( image, gray, CV_BGR2GRAY );
cv::ocl::cvtColor( image, gray, COLOR_BGR2GRAY );
cv::ocl::resize( gray, smallImg, smallImg.size(), 0, 0, INTER_LINEAR );
cv::ocl::equalizeHist( smallImg, smallImg );

View File

@@ -296,8 +296,8 @@ void App::run()
workBegin();
// Change format of the image
if (make_gray) cvtColor(frame, img_aux, CV_BGR2GRAY);
else if (use_gpu) cvtColor(frame, img_aux, CV_BGR2BGRA);
if (make_gray) cvtColor(frame, img_aux, COLOR_BGR2GRAY);
else if (use_gpu) cvtColor(frame, img_aux, COLOR_BGR2BGRA);
else frame.copyTo(img_aux);
// Resize image
@@ -351,8 +351,8 @@ void App::run()
throw std::runtime_error("can't create video writer");
}
if (make_gray) cvtColor(img_to_show, img, CV_GRAY2BGR);
else cvtColor(img_to_show, img, CV_BGRA2BGR);
if (make_gray) cvtColor(img_to_show, img, COLOR_GRAY2BGR);
else cvtColor(img_to_show, img, COLOR_BGRA2BGR);
video_writer << img;
}

View File

@@ -88,7 +88,7 @@ static void findSquares( const Mat& image, vector<vector<Point> >& squares )
}
// find contours and store them all as a list
findContours(gray, contours, CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE);
findContours(gray, contours, RETR_LIST, CHAIN_APPROX_SIMPLE);
vector<Point> approx;

View File

@@ -89,12 +89,12 @@ int main(int argc, char* argv[])
if(argc != 5)
{
cpu_img1 = imread("o.png");
cvtColor(cpu_img1, cpu_img1_grey, CV_BGR2GRAY);
cvtColor(cpu_img1, cpu_img1_grey, COLOR_BGR2GRAY);
img1 = cpu_img1_grey;
CV_Assert(!img1.empty());
cpu_img2 = imread("r2.png");
cvtColor(cpu_img2, cpu_img2_grey, CV_BGR2GRAY);
cvtColor(cpu_img2, cpu_img2_grey, COLOR_BGR2GRAY);
img2 = cpu_img2_grey;
}
else
@@ -104,14 +104,14 @@ int main(int argc, char* argv[])
if (string(argv[i]) == "--left")
{
cpu_img1 = imread(argv[++i]);
cvtColor(cpu_img1, cpu_img1_grey, CV_BGR2GRAY);
cvtColor(cpu_img1, cpu_img1_grey, COLOR_BGR2GRAY);
img1 = cpu_img1_grey;
CV_Assert(!img1.empty());
}
else if (string(argv[i]) == "--right")
{
cpu_img2 = imread(argv[++i]);
cvtColor(cpu_img2, cpu_img2_grey, CV_BGR2GRAY);
cvtColor(cpu_img2, cpu_img2_grey, COLOR_BGR2GRAY);
img2 = cpu_img2_grey;
}
else if (string(argv[i]) == "--help")