Make imgproc.hpp independent from C API
This commit is contained in:
@@ -30,7 +30,7 @@ int main( int, char** argv )
|
||||
src = imread( argv[1], 1 );
|
||||
|
||||
/// Convert image to gray and blur it
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
blur( src_gray, src_gray, Size(3,3) );
|
||||
|
||||
/// Create Window
|
||||
@@ -57,7 +57,7 @@ void thresh_callback(int, void* )
|
||||
/// Detect edges using canny
|
||||
Canny( src_gray, canny_output, thresh, thresh*2, 3 );
|
||||
/// Find contours
|
||||
findContours( canny_output, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0) );
|
||||
findContours( canny_output, contours, hierarchy, RETR_TREE, CHAIN_APPROX_SIMPLE, Point(0, 0) );
|
||||
|
||||
/// Draw contours
|
||||
Mat drawing = Mat::zeros( canny_output.size(), CV_8UC3 );
|
||||
|
@@ -30,7 +30,7 @@ int main( int, char** argv )
|
||||
src = imread( argv[1], 1 );
|
||||
|
||||
/// Convert image to gray and blur it
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
blur( src_gray, src_gray, Size(3,3) );
|
||||
|
||||
/// Create Window
|
||||
@@ -57,7 +57,7 @@ void thresh_callback(int, void* )
|
||||
/// Detect edges using Threshold
|
||||
threshold( src_gray, threshold_output, thresh, 255, THRESH_BINARY );
|
||||
/// Find contours
|
||||
findContours( threshold_output, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0) );
|
||||
findContours( threshold_output, contours, hierarchy, RETR_TREE, CHAIN_APPROX_SIMPLE, Point(0, 0) );
|
||||
|
||||
/// Approximate contours to polygons + get bounding rects and circles
|
||||
vector<vector<Point> > contours_poly( contours.size() );
|
||||
|
@@ -30,7 +30,7 @@ int main( int, char** argv )
|
||||
src = imread( argv[1], 1 );
|
||||
|
||||
/// Convert image to gray and blur it
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
blur( src_gray, src_gray, Size(3,3) );
|
||||
|
||||
/// Create Window
|
||||
@@ -57,7 +57,7 @@ void thresh_callback(int, void* )
|
||||
/// Detect edges using Threshold
|
||||
threshold( src_gray, threshold_output, thresh, 255, THRESH_BINARY );
|
||||
/// Find contours
|
||||
findContours( threshold_output, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0) );
|
||||
findContours( threshold_output, contours, hierarchy, RETR_TREE, CHAIN_APPROX_SIMPLE, Point(0, 0) );
|
||||
|
||||
/// Find the rotated rectangles and ellipses for each contour
|
||||
vector<RotatedRect> minRect( contours.size() );
|
||||
|
@@ -30,7 +30,7 @@ int main( int, char** argv )
|
||||
src = imread( argv[1], 1 );
|
||||
|
||||
/// Convert image to gray and blur it
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
blur( src_gray, src_gray, Size(3,3) );
|
||||
|
||||
/// Create Window
|
||||
@@ -59,7 +59,7 @@ void thresh_callback(int, void* )
|
||||
threshold( src_gray, threshold_output, thresh, 255, THRESH_BINARY );
|
||||
|
||||
/// Find contours
|
||||
findContours( threshold_output, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0) );
|
||||
findContours( threshold_output, contours, hierarchy, RETR_TREE, CHAIN_APPROX_SIMPLE, Point(0, 0) );
|
||||
|
||||
/// Find the convex hull object for each contour
|
||||
vector<vector<Point> >hull( contours.size() );
|
||||
|
@@ -30,7 +30,7 @@ int main( int, char** argv )
|
||||
src = imread( argv[1], 1 );
|
||||
|
||||
/// Convert image to gray and blur it
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
blur( src_gray, src_gray, Size(3,3) );
|
||||
|
||||
/// Create Window
|
||||
@@ -57,7 +57,7 @@ void thresh_callback(int, void* )
|
||||
/// Detect edges using canny
|
||||
Canny( src_gray, canny_output, thresh, thresh*2, 3 );
|
||||
/// Find contours
|
||||
findContours( canny_output, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0) );
|
||||
findContours( canny_output, contours, hierarchy, RETR_TREE, CHAIN_APPROX_SIMPLE, Point(0, 0) );
|
||||
|
||||
/// Get the moments
|
||||
vector<Moments> mu(contours.size() );
|
||||
|
Reference in New Issue
Block a user