Normalize line endings and whitespace
This commit is contained in:

committed by
Andrey Kamaev

parent
69020da607
commit
04384a71e4
@@ -37,7 +37,7 @@ void CannyThreshold(int, void*)
|
||||
|
||||
/// Using Canny's output as a mask, we display our result
|
||||
dst = Scalar::all(0);
|
||||
|
||||
|
||||
src.copyTo( dst, detected_edges);
|
||||
imshow( window_name, dst );
|
||||
}
|
||||
|
@@ -32,14 +32,14 @@ int main( int argc, char** argv )
|
||||
/// Load the image
|
||||
src = imread( argv[1], 1 );
|
||||
|
||||
/// Set the dst image the same type and size as src
|
||||
/// Set the dst image the same type and size as src
|
||||
warp_dst = Mat::zeros( src.rows, src.cols, src.type() );
|
||||
|
||||
/// Set your 3 points to calculate the Affine Transform
|
||||
srcTri[0] = Point2f( 0,0 );
|
||||
srcTri[1] = Point2f( src.cols - 1, 0 );
|
||||
srcTri[2] = Point2f( 0, src.rows - 1 );
|
||||
|
||||
|
||||
dstTri[0] = Point2f( src.cols*0.0, src.rows*0.33 );
|
||||
dstTri[1] = Point2f( src.cols*0.85, src.rows*0.25 );
|
||||
dstTri[2] = Point2f( src.cols*0.15, src.rows*0.7 );
|
||||
@@ -62,7 +62,7 @@ int main( int argc, char** argv )
|
||||
|
||||
/// Rotate the warped image
|
||||
warpAffine( warp_dst, warp_rotate_dst, rot_mat, warp_dst.size() );
|
||||
|
||||
|
||||
|
||||
/// Show what you got
|
||||
namedWindow( source_window, CV_WINDOW_AUTOSIZE );
|
||||
|
@@ -24,7 +24,7 @@ int main(int argc, char** argv)
|
||||
if( !src.data )
|
||||
{ return -1; }
|
||||
|
||||
/// Convert it to gray
|
||||
/// Convert it to gray
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
|
||||
/// Reduce the noise so we avoid false circle detection
|
||||
@@ -46,7 +46,7 @@ int main(int argc, char** argv)
|
||||
circle( src, center, radius, Scalar(0,0,255), 3, 8, 0 );
|
||||
}
|
||||
|
||||
/// Show your results
|
||||
/// Show your results
|
||||
namedWindow( "Hough Circle Transform Demo", CV_WINDOW_AUTOSIZE );
|
||||
imshow( "Hough Circle Transform Demo", src );
|
||||
|
||||
|
@@ -15,8 +15,8 @@ using namespace std;
|
||||
/// Global variables
|
||||
|
||||
/** General variables */
|
||||
Mat src, edges;
|
||||
Mat src_gray;
|
||||
Mat src, edges;
|
||||
Mat src_gray;
|
||||
Mat standard_hough, probabilistic_hough;
|
||||
int min_threshold = 50;
|
||||
int max_trackbar = 150;
|
||||
@@ -47,7 +47,7 @@ int main( int argc, char** argv )
|
||||
|
||||
/// Pass the image to gray
|
||||
cvtColor( src, src_gray, CV_RGB2GRAY );
|
||||
|
||||
|
||||
/// Apply Canny edge detector
|
||||
Canny( src_gray, edges, 50, 200, 3 );
|
||||
|
||||
@@ -88,7 +88,7 @@ void Standard_Hough( int, void* )
|
||||
cvtColor( edges, standard_hough, CV_GRAY2BGR );
|
||||
|
||||
/// 1. Use Standard Hough Transform
|
||||
HoughLines( edges, s_lines, 1, CV_PI/180, min_threshold + s_trackbar, 0, 0 );
|
||||
HoughLines( edges, s_lines, 1, CV_PI/180, min_threshold + s_trackbar, 0, 0 );
|
||||
|
||||
/// Show the result
|
||||
for( int i = 0; i < s_lines.size(); i++ )
|
||||
@@ -100,8 +100,8 @@ void Standard_Hough( int, void* )
|
||||
|
||||
Point pt1( cvRound(x0 + alpha*(-sin_t)), cvRound(y0 + alpha*cos_t) );
|
||||
Point pt2( cvRound(x0 - alpha*(-sin_t)), cvRound(y0 - alpha*cos_t) );
|
||||
line( standard_hough, pt1, pt2, Scalar(255,0,0), 3, CV_AA);
|
||||
}
|
||||
line( standard_hough, pt1, pt2, Scalar(255,0,0), 3, CV_AA);
|
||||
}
|
||||
|
||||
imshow( standard_name, standard_hough );
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ int main( int argc, char** argv )
|
||||
{
|
||||
|
||||
Mat src, src_gray, dst;
|
||||
int kernel_size = 3;
|
||||
int kernel_size = 3;
|
||||
int scale = 1;
|
||||
int delta = 0;
|
||||
int ddepth = CV_16S;
|
||||
|
@@ -32,7 +32,7 @@ int main( int argc, char** argv )
|
||||
dst.create( src.size(), src.type() );
|
||||
map_x.create( src.size(), CV_32FC1 );
|
||||
map_y.create( src.size(), CV_32FC1 );
|
||||
|
||||
|
||||
/// Create window
|
||||
namedWindow( remap_window, CV_WINDOW_AUTOSIZE );
|
||||
|
||||
@@ -47,7 +47,7 @@ int main( int argc, char** argv )
|
||||
|
||||
/// Update map_x & map_y. Then apply remap
|
||||
update_map();
|
||||
remap( src, dst, map_x, map_y, CV_INTER_LINEAR, BORDER_CONSTANT, Scalar(0, 0, 0) );
|
||||
remap( src, dst, map_x, map_y, CV_INTER_LINEAR, BORDER_CONSTANT, Scalar(0, 0, 0) );
|
||||
|
||||
// Display results
|
||||
imshow( remap_window, dst );
|
||||
@@ -65,34 +65,34 @@ void update_map( void )
|
||||
|
||||
for( int j = 0; j < src.rows; j++ )
|
||||
{ for( int i = 0; i < src.cols; i++ )
|
||||
{
|
||||
{
|
||||
switch( ind )
|
||||
{
|
||||
case 0:
|
||||
if( i > src.cols*0.25 && i < src.cols*0.75 && j > src.rows*0.25 && j < src.rows*0.75 )
|
||||
{
|
||||
case 0:
|
||||
if( i > src.cols*0.25 && i < src.cols*0.75 && j > src.rows*0.25 && j < src.rows*0.75 )
|
||||
{
|
||||
map_x.at<float>(j,i) = 2*( i - src.cols*0.25 ) + 0.5 ;
|
||||
map_y.at<float>(j,i) = 2*( j - src.rows*0.25 ) + 0.5 ;
|
||||
}
|
||||
else
|
||||
{ map_x.at<float>(j,i) = 0 ;
|
||||
map_y.at<float>(j,i) = 0 ;
|
||||
map_x.at<float>(j,i) = 2*( i - src.cols*0.25 ) + 0.5 ;
|
||||
map_y.at<float>(j,i) = 2*( j - src.rows*0.25 ) + 0.5 ;
|
||||
}
|
||||
else
|
||||
{ map_x.at<float>(j,i) = 0 ;
|
||||
map_y.at<float>(j,i) = 0 ;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
map_x.at<float>(j,i) = i ;
|
||||
map_y.at<float>(j,i) = src.rows - j ;
|
||||
break;
|
||||
case 1:
|
||||
map_x.at<float>(j,i) = i ;
|
||||
map_y.at<float>(j,i) = src.rows - j ;
|
||||
break;
|
||||
case 2:
|
||||
map_x.at<float>(j,i) = src.cols - i ;
|
||||
map_y.at<float>(j,i) = j ;
|
||||
break;
|
||||
map_x.at<float>(j,i) = src.cols - i ;
|
||||
map_y.at<float>(j,i) = j ;
|
||||
break;
|
||||
case 3:
|
||||
map_x.at<float>(j,i) = src.cols - i ;
|
||||
map_y.at<float>(j,i) = src.rows - j ;
|
||||
break;
|
||||
map_x.at<float>(j,i) = src.cols - i ;
|
||||
map_y.at<float>(j,i) = src.rows - j ;
|
||||
break;
|
||||
} // end of switch
|
||||
}
|
||||
}
|
||||
}
|
||||
ind++;
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ int main( int argc, char** argv )
|
||||
{
|
||||
|
||||
Mat src, src_gray;
|
||||
Mat grad;
|
||||
Mat grad;
|
||||
char* window_name = "Sobel Demo - Simple Edge Detector";
|
||||
int scale = 1;
|
||||
int delta = 0;
|
||||
@@ -43,15 +43,15 @@ int main( int argc, char** argv )
|
||||
/// Generate grad_x and grad_y
|
||||
Mat grad_x, grad_y;
|
||||
Mat abs_grad_x, abs_grad_y;
|
||||
|
||||
|
||||
/// Gradient X
|
||||
//Scharr( src_gray, grad_x, ddepth, 1, 0, scale, delta, BORDER_DEFAULT );
|
||||
Sobel( src_gray, grad_x, ddepth, 1, 0, 3, scale, delta, BORDER_DEFAULT );
|
||||
Sobel( src_gray, grad_x, ddepth, 1, 0, 3, scale, delta, BORDER_DEFAULT );
|
||||
convertScaleAbs( grad_x, abs_grad_x );
|
||||
|
||||
/// Gradient Y
|
||||
/// Gradient Y
|
||||
//Scharr( src_gray, grad_y, ddepth, 0, 1, scale, delta, BORDER_DEFAULT );
|
||||
Sobel( src_gray, grad_y, ddepth, 0, 1, 3, scale, delta, BORDER_DEFAULT );
|
||||
Sobel( src_gray, grad_y, ddepth, 0, 1, 3, scale, delta, BORDER_DEFAULT );
|
||||
convertScaleAbs( grad_y, abs_grad_y );
|
||||
|
||||
/// Total Gradient (approximate)
|
||||
|
@@ -11,7 +11,7 @@
|
||||
|
||||
using namespace cv;
|
||||
|
||||
/// Global Variables
|
||||
/// Global Variables
|
||||
Mat src, dst;
|
||||
int top, bottom, left, right;
|
||||
int borderType;
|
||||
@@ -29,10 +29,10 @@ int main( int argc, char** argv )
|
||||
|
||||
/// Load an image
|
||||
src = imread( argv[1] );
|
||||
|
||||
|
||||
if( !src.data )
|
||||
{ return -1;
|
||||
printf(" No data entered, please enter the path to an image file \n");
|
||||
printf(" No data entered, please enter the path to an image file \n");
|
||||
}
|
||||
|
||||
/// Brief how-to for this program
|
||||
@@ -46,12 +46,12 @@ int main( int argc, char** argv )
|
||||
namedWindow( window_name, CV_WINDOW_AUTOSIZE );
|
||||
|
||||
/// Initialize arguments for the filter
|
||||
top = (int) (0.05*src.rows); bottom = (int) (0.05*src.rows);
|
||||
top = (int) (0.05*src.rows); bottom = (int) (0.05*src.rows);
|
||||
left = (int) (0.05*src.cols); right = (int) (0.05*src.cols);
|
||||
dst = src;
|
||||
|
||||
imshow( window_name, dst );
|
||||
|
||||
|
||||
while( true )
|
||||
{
|
||||
c = waitKey(500);
|
||||
|
@@ -22,7 +22,7 @@ int main ( int argc, char** argv )
|
||||
Mat kernel;
|
||||
Point anchor;
|
||||
double delta;
|
||||
int ddepth;
|
||||
int ddepth;
|
||||
int kernel_size;
|
||||
char* window_name = "filter2D Demo";
|
||||
|
||||
@@ -36,7 +36,7 @@ int main ( int argc, char** argv )
|
||||
|
||||
/// Create window
|
||||
namedWindow( window_name, CV_WINDOW_AUTOSIZE );
|
||||
|
||||
|
||||
/// Initialize arguments for the filter
|
||||
anchor = Point( -1, -1 );
|
||||
delta = 0;
|
||||
@@ -60,6 +60,6 @@ int main ( int argc, char** argv )
|
||||
imshow( window_name, dst );
|
||||
ind++;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user