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

@@ -29,7 +29,7 @@ void convertAndResize(const T& src, T& gray, T& resized, double scale)
{
if (src.channels() == 3)
{
cvtColor( src, gray, CV_BGR2GRAY );
cvtColor( src, gray, COLOR_BGR2GRAY );
}
else
{
@@ -272,7 +272,7 @@ int main(int argc, const char *argv[])
}
cout << endl;
cvtColor(resized_cpu, frameDisp, CV_GRAY2BGR);
cvtColor(resized_cpu, frameDisp, COLOR_GRAY2BGR);
displayState(frameDisp, helpScreen, useGPU, findLargestObject, filterRects, fps);
imshow("result", frameDisp);

View File

@@ -86,11 +86,11 @@ int main(int argc, const char* argv[])
Mat templ = loadImage(templName);
Mat image = loadImage(imageName);
int method = GHT_POSITION;
int method = cv::GeneralizedHough::GHT_POSITION;
if (estimateScale)
method += GHT_SCALE;
method += cv::GeneralizedHough::GHT_SCALE;
if (estimateRotation)
method += GHT_ROTATION;
method += cv::GeneralizedHough::GHT_ROTATION;
vector<Vec4f> position;
cv::TickMeter tm;

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

@@ -34,7 +34,7 @@ int main(int argc, const char* argv[])
Canny(src, mask, 100, 200, 3);
Mat dst_cpu;
cvtColor(mask, dst_cpu, CV_GRAY2BGR);
cvtColor(mask, dst_cpu, COLOR_GRAY2BGR);
Mat dst_gpu = dst_cpu.clone();
vector<Vec4i> lines_cpu;

View File

@@ -39,9 +39,9 @@ static void OpenClose(int, void*)
int an = n > 0 ? n : -n;
Mat element = getStructuringElement(element_shape, Size(an*2+1, an*2+1), Point(an, an) );
if( n < 0 )
cv::gpu::morphologyEx(src, dst, CV_MOP_OPEN, element);
cv::gpu::morphologyEx(src, dst, MORPH_OPEN, element);
else
cv::gpu::morphologyEx(src, dst, CV_MOP_CLOSE, element);
cv::gpu::morphologyEx(src, dst, MORPH_CLOSE, element);
imshow("Open/Close",(Mat)dst);
}
@@ -84,7 +84,7 @@ int main( int argc, char** argv )
{
// gpu support only 4th channel images
GpuMat src4ch;
cv::gpu::cvtColor(src, src4ch, CV_BGR2BGRA);
cv::gpu::cvtColor(src, src4ch, COLOR_BGR2BGRA);
src = src4ch;
}

View File

@@ -163,8 +163,8 @@ void App::run()
right_src = imread(p.right);
if (left_src.empty()) throw runtime_error("can't open file \"" + p.left + "\"");
if (right_src.empty()) throw runtime_error("can't open file \"" + p.right + "\"");
cvtColor(left_src, left, CV_BGR2GRAY);
cvtColor(right_src, right, CV_BGR2GRAY);
cvtColor(left_src, left, COLOR_BGR2GRAY);
cvtColor(right_src, right, COLOR_BGR2GRAY);
d_left.upload(left);
d_right.upload(right);
@@ -193,8 +193,8 @@ void App::run()
if (d_left.channels() > 1 || d_right.channels() > 1)
{
cout << "BM doesn't support color images\n";
cvtColor(left_src, left, CV_BGR2GRAY);
cvtColor(right_src, right, CV_BGR2GRAY);
cvtColor(left_src, left, COLOR_BGR2GRAY);
cvtColor(right_src, right, COLOR_BGR2GRAY);
cout << "image_channels: " << left.channels() << endl;
d_left.upload(left);
d_right.upload(right);
@@ -262,8 +262,8 @@ void App::handleKey(char key)
}
else
{
cvtColor(left_src, left, CV_BGR2GRAY);
cvtColor(right_src, right, CV_BGR2GRAY);
cvtColor(left_src, left, COLOR_BGR2GRAY);
cvtColor(right_src, right, COLOR_BGR2GRAY);
}
d_left.upload(left);
d_right.upload(right);