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

@@ -425,7 +425,7 @@ void normalizeUsingWeightMap(const Mat& weight, Mat& src)
void createWeightMap(const Mat &mask, float sharpness, Mat &weight)
{
CV_Assert(mask.type() == CV_8U);
distanceTransform(mask, weight, CV_DIST_L1, 3);
distanceTransform(mask, weight, DIST_L1, 3);
threshold(weight * sharpness, weight, 1.f, 1.f, THRESH_TRUNC);
}

View File

@@ -350,7 +350,7 @@ void SurfFeaturesFinder::find(const Mat &image, ImageFeatures &features)
CV_Assert((image.type() == CV_8UC3) || (image.type() == CV_8UC1));
if(image.type() == CV_8UC3)
{
cvtColor(image, gray_image, CV_BGR2GRAY);
cvtColor(image, gray_image, COLOR_BGR2GRAY);
}
else
{
@@ -382,9 +382,9 @@ void OrbFeaturesFinder::find(const Mat &image, ImageFeatures &features)
CV_Assert((image.type() == CV_8UC3) || (image.type() == CV_8UC4) || (image.type() == CV_8UC1));
if (image.type() == CV_8UC3) {
cvtColor(image, gray_image, CV_BGR2GRAY);
cvtColor(image, gray_image, COLOR_BGR2GRAY);
} else if (image.type() == CV_8UC4) {
cvtColor(image, gray_image, CV_BGRA2GRAY);
cvtColor(image, gray_image, COLOR_BGRA2GRAY);
} else if (image.type() == CV_8UC1) {
gray_image=image;
} else {
@@ -457,7 +457,7 @@ void SurfFeaturesFinderGpu::find(const Mat &image, ImageFeatures &features)
image_.upload(image);
ensureSizeIsEnough(image.size(), CV_8UC1, gray_image_);
cvtColor(image_, gray_image_, CV_BGR2GRAY);
cvtColor(image_, gray_image_, COLOR_BGR2GRAY);
surf_.nOctaves = num_octaves_;
surf_.nOctaveLayers = num_layers_;

View File

@@ -139,8 +139,8 @@ void VoronoiSeamFinder::findInPair(size_t first, size_t second, Rect roi)
Mat unique2 = submask2.clone(); unique2.setTo(0, collision);
Mat dist1, dist2;
distanceTransform(unique1 == 0, dist1, CV_DIST_L1, 3);
distanceTransform(unique2 == 0, dist2, CV_DIST_L1, 3);
distanceTransform(unique1 == 0, dist1, DIST_L1, 3);
distanceTransform(unique2 == 0, dist2, DIST_L1, 3);
Mat seam = dist1 < dist2;
@@ -522,17 +522,17 @@ void DpSeamFinder::computeGradients(const Mat &image1, const Mat &image2)
Mat gray;
if (image1.channels() == 3)
cvtColor(image1, gray, CV_BGR2GRAY);
cvtColor(image1, gray, COLOR_BGR2GRAY);
else if (image1.channels() == 4)
cvtColor(image1, gray, CV_BGRA2GRAY);
cvtColor(image1, gray, COLOR_BGRA2GRAY);
Sobel(gray, gradx1_, CV_32F, 1, 0);
Sobel(gray, grady1_, CV_32F, 0, 1);
if (image2.channels() == 3)
cvtColor(image2, gray, CV_BGR2GRAY);
cvtColor(image2, gray, COLOR_BGR2GRAY);
else if (image2.channels() == 4)
cvtColor(image2, gray, CV_BGRA2GRAY);
cvtColor(image2, gray, COLOR_BGRA2GRAY);
Sobel(gray, gradx2_, CV_32F, 1, 0);
Sobel(gray, grady2_, CV_32F, 0, 1);