Merge pull request #6029 from sturkmen72:patch-7

This commit is contained in:
Alexander Alekhin
2016-06-29 11:55:08 +00:00
110 changed files with 394 additions and 423 deletions

View File

@@ -5,7 +5,7 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/highgui.hpp"
#include <stdio.h>
using namespace cv;

View File

@@ -6,7 +6,7 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/highgui.hpp"
using namespace cv;

View File

@@ -5,10 +5,9 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
using namespace cv;
using namespace std;
@@ -24,10 +23,10 @@ int main( int, char** argv )
const char* equalized_window = "Equalized Image";
/// Load image
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
if( src.empty() )
{ cout<<"Usage: ./Histogram_Demo <path_to_image>"<<endl;
{ cout<<"Usage: ./EqualizeHist_Demo <path_to_image>"<<endl;
return -1;
}

View File

@@ -5,10 +5,9 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
using namespace std;
using namespace cv;
@@ -27,11 +26,24 @@ void MatchingMethod( int, void* );
/**
* @function main
*/
int main( int, char** argv )
int main( int argc, char** argv )
{
if (argc < 3)
{
cout << "Not enough parameters" << endl;
cout << "Usage:\n./MatchTemplate_Demo <image_name> <template_name>" << endl;
return -1;
}
/// Load image and template
img = imread( argv[1], 1 );
templ = imread( argv[2], 1 );
img = imread( argv[1], IMREAD_COLOR );
templ = imread( argv[2], IMREAD_COLOR );
if(img.empty() || templ.empty())
{
cout << "Can't read one of the images" << endl;
return -1;
}
/// Create windows
namedWindow( image_window, WINDOW_AUTOSIZE );

View File

@@ -4,9 +4,9 @@
* @author OpenCV team
*/
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
@@ -27,7 +27,13 @@ void Hist_and_Backproj(int, void* );
int main( int, char** argv )
{
/// Read the image
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
if( src.empty() )
{ cout<<"Usage: ./calcBackProject_Demo1 <path_to_image>"<<endl;
return -1;
}
/// Transform it to HSV
cvtColor( src, hsv, COLOR_BGR2HSV );

View File

@@ -4,9 +4,9 @@
* @author OpenCV team
*/
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
@@ -30,7 +30,7 @@ void pickPoint (int event, int x, int y, int, void* );
int main( int, char** argv )
{
/// Read the image
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
/// Transform it to HSV
cvtColor( src, hsv, COLOR_BGR2HSV );

View File

@@ -4,11 +4,10 @@
* @author
*/
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
using namespace std;
using namespace cv;
@@ -16,12 +15,19 @@ using namespace cv;
/**
* @function main
*/
int main( int, char** argv )
int main(int argc, char** argv)
{
Mat src, dst;
/// Load image
src = imread( argv[1], 1 );
String imageName( "../data/lena.jpg" ); // by default
if (argc > 1)
{
imageName = argv[1];
}
src = imread( imageName, IMREAD_COLOR );
if( src.empty() )
{ return -1; }

View File

@@ -5,10 +5,9 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
using namespace std;
using namespace cv;
@@ -26,13 +25,19 @@ int main( int argc, char** argv )
/// Load three images with different environment settings
if( argc < 4 )
{
printf("** Error. Usage: ./compareHist_Demo <image_settings0> <image_setting1> <image_settings2>\n");
printf("** Error. Usage: ./compareHist_Demo <image_settings0> <image_settings1> <image_settings2>\n");
return -1;
}
src_base = imread( argv[1], 1 );
src_test1 = imread( argv[2], 1 );
src_test2 = imread( argv[3], 1 );
src_base = imread( argv[1], IMREAD_COLOR );
src_test1 = imread( argv[2], IMREAD_COLOR );
src_test2 = imread( argv[3], IMREAD_COLOR );
if(src_base.empty() || src_test1.empty() || src_test2.empty())
{
cout << "Can't read one of the images" << endl;
return -1;
}
/// Convert to HSV
cvtColor( src_base, hsv_base, COLOR_BGR2HSV );

View File

@@ -5,7 +5,7 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
using namespace cv;

View File

@@ -5,7 +5,7 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
using namespace cv;

View File

@@ -4,11 +4,9 @@
* @author OpenCV team
*/
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>
#include "opencv2/highgui.hpp"
using namespace cv;
@@ -32,7 +30,7 @@ void Dilation( int, void* );
int main( int, char** argv )
{
/// Load an image
src = imread( argv[1] );
src = imread( argv[1], IMREAD_COLOR );
if( src.empty() )
{ return -1; }

View File

@@ -4,11 +4,9 @@
* @author OpenCV team
*/
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>
#include "opencv2/highgui.hpp"
using namespace cv;
@@ -34,7 +32,7 @@ void Morphology_Operations( int, void* );
int main( int, char** argv )
{
/// Load an image
src = imread( argv[1] );
src = imread( argv[1], IMREAD_COLOR );
if( src.empty() )
{ return -1; }
@@ -67,7 +65,6 @@ int main( int, char** argv )
*/
void Morphology_Operations( int, void* )
{
// Since MORPH_X : 2,3,4,5 and 6
int operation = morph_operator + 2;

View File

@@ -4,12 +4,9 @@
* @author OpenCV team
*/
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include "opencv2/highgui.hpp"
using namespace cv;

View File

@@ -3,13 +3,10 @@
* brief Sample code for simple filters
* author OpenCV team
*/
#include <iostream>
#include <vector>
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui.hpp"
using namespace std;
using namespace cv;
@@ -35,7 +32,7 @@ int main( void )
namedWindow( window_name, WINDOW_AUTOSIZE );
/// Load the source image
src = imread( "../data/lena.jpg", 1 );
src = imread( "../data/lena.jpg", IMREAD_COLOR );
if( display_caption( "Original Image" ) != 0 ) { return 0; }

View File

@@ -4,11 +4,9 @@
* @author OpenCV team
*/
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>
#include "opencv2/highgui.hpp"
using namespace cv;
@@ -35,10 +33,13 @@ void Threshold_Demo( int, void* );
int main( int, char** argv )
{
/// Load an image
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
if( src.empty() )
{ return -1; }
/// Convert the image to Gray
cvtColor( src, src_gray, COLOR_RGB2GRAY );
cvtColor( src, src_gray, COLOR_BGR2GRAY );
/// Create a window to display results
namedWindow( window_name, WINDOW_AUTOSIZE );

View File

@@ -4,11 +4,9 @@
* @author OpenCV team
*/
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>
#include "opencv2/highgui.hpp"
using namespace cv;
@@ -50,7 +48,7 @@ static void CannyThreshold(int, void*)
int main( int, char** argv )
{
/// Load an image
src = imread( argv[1] );
src = imread( argv[1], IMREAD_COLOR );
if( src.empty() )
{ return -1; }

View File

@@ -5,10 +5,9 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
using namespace cv;
using namespace std;
@@ -31,7 +30,7 @@ int main( int, char** argv )
Mat src, warp_dst, warp_rotate_dst;
/// Load the image
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
/// Set the dst image the same type and size as src
warp_dst = Mat::zeros( src.rows, src.cols, src.type() );

View File

@@ -5,8 +5,8 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace std;
@@ -63,7 +63,7 @@ int main(int argc, char** argv)
}
// Read the image
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
if( src.empty() )
{

View File

@@ -5,10 +5,9 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
using namespace cv;
using namespace std;
@@ -39,7 +38,7 @@ void Probabilistic_Hough( int, void* );
int main( int, char** argv )
{
/// Read the image
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
if( src.empty() )
{ help();

View File

@@ -4,11 +4,9 @@
* @author OpenCV team
*/
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>
#include "opencv2/highgui.hpp"
using namespace cv;
@@ -26,7 +24,7 @@ int main( int, char** argv )
const char* window_name = "Laplace Demo";
/// Load an image
src = imread( argv[1] );
src = imread( argv[1], IMREAD_COLOR );
if( src.empty() )
{ return -1; }

View File

@@ -5,10 +5,9 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
using namespace cv;
@@ -27,7 +26,7 @@ void update_map( void );
int main( int, char** argv )
{
/// Load the image
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
/// Create dst, map_x and map_y with the same size as src:
dst.create( src.size(), src.type() );

View File

@@ -4,11 +4,9 @@
* @author OpenCV team
*/
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>
#include "opencv2/highgui.hpp"
using namespace cv;
@@ -26,7 +24,7 @@ int main( int, char** argv )
int ddepth = CV_16S;
/// Load an image
src = imread( argv[1] );
src = imread( argv[1], IMREAD_COLOR );
if( src.empty() )
{ return -1; }

View File

@@ -4,11 +4,9 @@
* @author OpenCV team
*/
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>
#include "opencv2/highgui.hpp"
using namespace cv;
@@ -28,7 +26,7 @@ int main( int, char** argv )
int c;
/// Load an image
src = imread( argv[1] );
src = imread( argv[1], IMREAD_COLOR );
if( src.empty() )
{

View File

@@ -4,11 +4,9 @@
* @author OpenCV team
*/
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>
#include "opencv2/highgui.hpp"
using namespace cv;
@@ -30,7 +28,7 @@ int main ( int, char** argv )
int c;
/// Load an image
src = imread( argv[1] );
src = imread( argv[1], IMREAD_COLOR );
if( src.empty() )
{ return -1; }

View File

@@ -5,11 +5,9 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace cv;
using namespace std;
@@ -28,7 +26,7 @@ void thresh_callback(int, void* );
int main( int, char** argv )
{
/// Load source image
src = imread(argv[1]);
src = imread(argv[1], IMREAD_COLOR);
if (src.empty())
{
cerr << "No image supplied ..." << endl;

View File

@@ -5,11 +5,9 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace cv;
using namespace std;
@@ -28,7 +26,7 @@ void thresh_callback(int, void* );
int main( int, char** argv )
{
/// Load source image and convert it to gray
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
/// Convert image to gray and blur it
cvtColor( src, src_gray, COLOR_BGR2GRAY );

View File

@@ -5,11 +5,9 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace cv;
using namespace std;
@@ -28,7 +26,7 @@ void thresh_callback(int, void* );
int main( int, char** argv )
{
/// Load source image and convert it to gray
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
/// Convert image to gray and blur it
cvtColor( src, src_gray, COLOR_BGR2GRAY );

View File

@@ -5,11 +5,9 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace cv;
using namespace std;
@@ -28,7 +26,7 @@ void thresh_callback(int, void* );
int main( int, char** argv )
{
/// Load source image and convert it to gray
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
/// Convert image to gray and blur it
cvtColor( src, src_gray, COLOR_BGR2GRAY );

View File

@@ -5,11 +5,9 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace cv;
using namespace std;
@@ -28,7 +26,7 @@ void thresh_callback(int, void* );
int main( int, char** argv )
{
/// Load source image and convert it to gray
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
/// Convert image to gray and blur it
cvtColor( src, src_gray, COLOR_BGR2GRAY );

View File

@@ -4,11 +4,9 @@
* @author OpenCV team
*/
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace cv;
using namespace std;

View File

@@ -3,12 +3,11 @@
* @brief Demo code for detecting corners using OpenCV built-in functions
* @author OpenCV team
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace cv;
using namespace std;
@@ -40,7 +39,7 @@ void myHarris_function( int, void* );
int main( int, char** argv )
{
/// Load source image and convert it to gray
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
cvtColor( src, src_gray, COLOR_BGR2GRAY );
/// Set some parameters

View File

@@ -5,11 +5,9 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace cv;
using namespace std;
@@ -31,7 +29,7 @@ void cornerHarris_demo( int, void* );
int main( int, char** argv )
{
/// Load source image and convert it to gray
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
cvtColor( src, src_gray, COLOR_BGR2GRAY );
/// Create a window and a trackbar

View File

@@ -5,11 +5,9 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace cv;
using namespace std;
@@ -32,7 +30,7 @@ void goodFeaturesToTrack_Demo( int, void* );
int main( int, char** argv )
{
/// Load source image and convert it to gray
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
cvtColor( src, src_gray, COLOR_BGR2GRAY );
/// Create Window

View File

@@ -5,11 +5,9 @@
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace cv;
using namespace std;
@@ -32,7 +30,7 @@ void goodFeaturesToTrack_Demo( int, void* );
int main( int, char** argv )
{
/// Load source image and convert it to gray
src = imread( argv[1], 1 );
src = imread( argv[1], IMREAD_COLOR );
cvtColor( src, src_gray, COLOR_BGR2GRAY );
/// Create Window

View File

@@ -21,7 +21,7 @@ using namespace std;
static void help()
{
cout << "This is a camera calibration sample." << endl
<< "Usage: calibration configurationFile" << endl
<< "Usage: camera_calibration [configuration_file -- default ./default.xml]" << endl
<< "Near the sample file you'll find the configuration file, which has detailed help of "
"how to edit it. It may be any OpenCV supported file format XML/YAML." << endl;
}
@@ -415,7 +415,7 @@ int main(int argc, char* argv[])
for(size_t i = 0; i < s.imageList.size(); i++ )
{
view = imread(s.imageList[i], 1);
view = imread(s.imageList[i], IMREAD_COLOR);
if(view.empty())
continue;
remap(view, rview, map1, map2, INTER_LINEAR);

View File

@@ -11,8 +11,8 @@
#include "ModelRegistration.h"
#include "Utils.h"
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/calib3d.hpp>
// For text
int fontFace = cv::FONT_ITALIC;

View File

@@ -2,11 +2,11 @@
#include <iostream>
#include <time.h>
// OpenCV
#include <opencv2/core/core.hpp>
#include <opencv2//core.hpp>
#include <opencv2/core/utility.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/video/tracking.hpp>
// PnP Tutorial
#include "Mesh.h"

View File

@@ -1,10 +1,10 @@
// C++
#include <iostream>
// OpenCV
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/features2d.hpp>
// PnP Tutorial
#include "Mesh.h"
#include "Model.h"

View File

@@ -4,12 +4,10 @@
* @author A. Huaman
*/
#include <stdio.h>
#include <iostream>
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/calib3d.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/highgui.hpp"
using namespace cv;

View File

@@ -1,7 +1,7 @@
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>

View File

@@ -1,4 +1,4 @@
#include <opencv2/core/core.hpp>
#include <opencv2/core.hpp>
#include <iostream>
#include <string>

View File

@@ -16,7 +16,7 @@ static void help()
<< " we take an input image and divide the native color palette (255) with the " << endl
<< "input. Shows C operator[] method, iterators and at function for on-the-fly item address calculation."<< endl
<< "Usage:" << endl
<< "./howToScanImages imageNameToUse divideWith [G]" << endl
<< "./how_to_scan_images <imageNameToUse> <divideWith> [G]" << endl
<< "if you add a G parameter the image is processed in gray scale" << endl
<< "--------------------------------------------------------------------------" << endl
<< endl;

View File

@@ -1,12 +1,9 @@
//! [head]
#include <stdio.h>
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/imgproc.hpp>
#include "opencv2/imgcodecs.hpp"
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/utility.hpp>
#include <opencv2/highgui.hpp>
using namespace cv; // The new C++ interface API is inside this namespace. Import it.
using namespace std;

View File

@@ -1,5 +1,3 @@
#include <opencv2/core.hpp>
#include <opencv2/core/utility.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
@@ -25,38 +23,44 @@ int main( int argc, char* argv[])
help(argv[0]);
const char* filename = argc >=2 ? argv[1] : "../data/lena.jpg";
Mat I, J, K;
Mat src, dst0, dst1;
if (argc >= 3 && !strcmp("G", argv[2]))
I = imread( filename, IMREAD_GRAYSCALE);
src = imread( filename, IMREAD_GRAYSCALE);
else
I = imread( filename, IMREAD_COLOR);
src = imread( filename, IMREAD_COLOR);
if (src.empty())
{
cerr << "Can't open image [" << filename << "]" << endl;
return -1;
}
namedWindow("Input", WINDOW_AUTOSIZE);
namedWindow("Output", WINDOW_AUTOSIZE);
imshow("Input", I);
imshow( "Input", src );
double t = (double)getTickCount();
Sharpen(I, J);
Sharpen( src, dst0 );
t = ((double)getTickCount() - t)/getTickFrequency();
cout << "Hand written function times passed in seconds: " << t << endl;
imshow("Output", J);
waitKey(0);
imshow( "Output", dst0 );
waitKey();
Mat kern = (Mat_<char>(3,3) << 0, -1, 0,
Mat kernel = (Mat_<char>(3,3) << 0, -1, 0,
-1, 5, -1,
0, -1, 0);
t = (double)getTickCount();
filter2D(I, K, I.depth(), kern );
filter2D( src, dst1, src.depth(), kernel );
t = ((double)getTickCount() - t)/getTickFrequency();
cout << "Built-in filter2D time passed in seconds: " << t << endl;
imshow("Output", K);
imshow( "Output", dst1 );
waitKey(0);
waitKey();
return 0;
}
void Sharpen(const Mat& myImage,Mat& Result)

View File

@@ -1,6 +1,6 @@
/* For description look into the help() function. */
#include "opencv2/core/core.hpp"
#include "opencv2/core.hpp"
#include <iostream>
using namespace std;
@@ -15,7 +15,7 @@ static void help()
<< "That is, cv::Mat M(...); M.create and cout << M. " << endl
<< "Shows how output can be formated to OpenCV, python, numpy, csv and C styles." << endl
<< "Usage:" << endl
<< "./cvout_sample" << endl
<< "./mat_the_basic_image_container" << endl
<< "--------------------------------------------------------------------------" << endl
<< endl;
}

View File

@@ -3,9 +3,9 @@
*/
// OpenCV Headers
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
// C++ Standard Libraries
#include <cmath>
@@ -159,8 +159,8 @@ int main( int argc, char* argv[] ){
* Check input arguments
*/
if( argc < 3 ){
cout << "usage: " << argv[0] << " <image> <dem>" << endl;
return 1;
cout << "usage: " << argv[0] << " <image_name> <dem_model_name>" << endl;
return -1;
}
// load the image (note that we don't have the projection information. You will

View File

@@ -1,7 +1,7 @@
//! [includes]
#include <opencv2/core/core.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <string>
@@ -16,7 +16,7 @@ using namespace std;
int main( int argc, char** argv )
{
//! [load]
string imageName("../data/HappyFish.jpg"); // by default
String imageName( "../data/HappyFish.jpg" ); // by default
if( argc > 1)
{
imageName = argv[1];
@@ -28,7 +28,7 @@ int main( int argc, char** argv )
//! [mat]
//! [imread]
image = imread(imageName.c_str(), IMREAD_COLOR); // Read the file
image = imread( imageName, IMREAD_COLOR ); // Read the file
//! [imread]
if( image.empty() ) // Check for invalid input

View File

@@ -27,13 +27,13 @@ using namespace cv;
int main(int argc, char *argv[])
{
CV_Assert(argc == 2);
Mat I;
I = imread(argv[1]);
Mat src;
src = imread(argv[1], IMREAD_COLOR);
Mat gray = Mat(I.size(),CV_8UC1);
Mat color_boost = Mat(I.size(),CV_8UC3);
Mat gray = Mat(src.size(),CV_8UC1);
Mat color_boost = Mat(src.size(),CV_8UC3);
decolor(I,gray,color_boost);
decolor(src,gray,color_boost);
imshow("grayscale",gray);
imshow("color_boost",color_boost);
waitKey(0);

View File

@@ -35,9 +35,9 @@ int main(int argc, char* argv[])
int num,type;
Mat I = imread(argv[1]);
Mat src = imread(argv[1], IMREAD_COLOR);
if(I.empty())
if(src.empty())
{
cout << "Image not found" << endl;
exit(0);
@@ -71,25 +71,25 @@ int main(int argc, char* argv[])
cin >> type;
edgePreservingFilter(I,img,type);
edgePreservingFilter(src,img,type);
imshow("Edge Preserve Smoothing",img);
}
else if(num == 2)
{
detailEnhance(I,img);
detailEnhance(src,img);
imshow("Detail Enhanced",img);
}
else if(num == 3)
{
Mat img1;
pencilSketch(I,img1, img, 10 , 0.1f, 0.03f);
pencilSketch(src,img1, img, 10 , 0.1f, 0.03f);
imshow("Pencil Sketch",img1);
imshow("Color Pencil Sketch",img);
}
else if(num == 4)
{
stylization(I,img);
stylization(src,img);
imshow("Stylization",img);
}
waitKey(0);

View File

@@ -38,9 +38,9 @@ void help()
<< " OpenCV. You can process both videos (-vid) and images (-img)." << endl
<< endl
<< "Usage:" << endl
<< "./bs {-vid <video filename>|-img <image filename>}" << endl
<< "for example: ./bs -vid video.avi" << endl
<< "or: ./bs -img /data/images/1.png" << endl
<< "./bg_sub {-vid <video filename>|-img <image filename>}" << endl
<< "for example: ./bg_sub -vid video.avi" << endl
<< "or: ./bg_sub -img /data/images/1.png" << endl
<< "--------------------------------------------------------------------------" << endl
<< endl;
}

View File

@@ -3,10 +3,10 @@
#include <iomanip> // for controlling float print precision
#include <sstream> // string to number conversion
#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
#include <opencv2/imgproc/imgproc.hpp> // Gaussian Blur
#include <opencv2/videoio/videoio.hpp>
#include <opencv2/highgui/highgui.hpp> // OpenCV window I/O
#include <opencv2/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
#include <opencv2/imgproc.hpp> // Gaussian Blur
#include <opencv2/videoio.hpp>
#include <opencv2/highgui.hpp> // OpenCV window I/O
using namespace std;
using namespace cv;
@@ -22,7 +22,7 @@ static void help()
<< "tests the similarity of two input videos first with PSNR, and for the frames "
<< "below a PSNR trigger value, also with MSSIM." << endl
<< "Usage:" << endl
<< "./video-source referenceVideo useCaseTestVideo PSNR_Trigger_Value Wait_Between_Frames " << endl
<< "./video-input-psnr-ssim <referenceVideo> <useCaseTestVideo> <PSNR_Trigger_Value> <Wait_Between_Frames> " << endl
<< "--------------------------------------------------------------------------" << endl
<< endl;
}

View File

@@ -1,8 +1,8 @@
#include <iostream> // for standard I/O
#include <string> // for strings
#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat)
#include <opencv2/videoio/videoio.hpp> // Video write
#include <opencv2/core.hpp> // Basic OpenCV structures (cv::Mat)
#include <opencv2/videoio.hpp> // Video write
using namespace std;
using namespace cv;
@@ -14,7 +14,7 @@ static void help()
<< "This program shows how to write video files." << endl
<< "You can extract the R or G or B color channel of the input video." << endl
<< "Usage:" << endl
<< "./video-write inputvideoName [ R | G | B] [Y | N]" << endl
<< "./video-write <input_video_name> [ R | G | B] [Y | N]" << endl
<< "------------------------------------------------------------------------------" << endl
<< endl;
}