Update samples (#10333)
* Update samples * Update calib3d.hpp * Update calib3d.hpp * Update calib3d.hpp * Update calib3d.hpp
This commit is contained in:
committed by
Vadim Pisarevsky
parent
d3a124c820
commit
1654dfe3a9
@@ -5,10 +5,11 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <iostream>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
|
||||
/// Global variables
|
||||
Mat src, erosion_dst, dilation_dst;
|
||||
@@ -27,13 +28,17 @@ void Dilation( int, void* );
|
||||
/**
|
||||
* @function main
|
||||
*/
|
||||
int main( int, char** argv )
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
/// Load an image
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
CommandLineParser parser( argc, argv, "{@input | ../data/chicky_512.png | input image}" );
|
||||
src = imread( parser.get<String>( "@input" ), IMREAD_COLOR );
|
||||
if( src.empty() )
|
||||
{ return -1; }
|
||||
{
|
||||
cout << "Could not open or find the image!\n" << endl;
|
||||
cout << "Usage: " << argv[0] << " <Input image>" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// Create windows
|
||||
namedWindow( "Erosion Demo", WINDOW_AUTOSIZE );
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <iostream>
|
||||
|
||||
using namespace cv;
|
||||
|
||||
@@ -32,15 +33,14 @@ void Morphology_Operations( int, void* );
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
//![load]
|
||||
String imageName("../data/baboon.jpg"); // by default
|
||||
if (argc > 1)
|
||||
CommandLineParser parser( argc, argv, "{@input | ../data/baboon.jpg | input image}" );
|
||||
src = imread( parser.get<String>( "@input" ), IMREAD_COLOR );
|
||||
if (src.empty())
|
||||
{
|
||||
imageName = argv[1];
|
||||
std::cout << "Could not open or find the image!\n" << std::endl;
|
||||
std::cout << "Usage: " << argv[0] << " <Input image>" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
src = imread(imageName, IMREAD_COLOR); // Load an image
|
||||
|
||||
if( src.empty() )
|
||||
{ return -1; }
|
||||
//![load]
|
||||
|
||||
//![window]
|
||||
|
||||
@@ -11,16 +11,15 @@ void show_wait_destroy(const char* winname, cv::Mat img);
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
int main(int, char** argv)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
//! [load_image]
|
||||
// Load the image
|
||||
Mat src = imread(argv[1]);
|
||||
|
||||
// Check if image is loaded fine
|
||||
if(src.empty()){
|
||||
printf(" Error opening image\n");
|
||||
printf(" Program Arguments: [image_path]\n");
|
||||
CommandLineParser parser(argc, argv, "{@input | ../data/notes.png | input image}");
|
||||
Mat src = imread(parser.get<String>("@input"), IMREAD_COLOR);
|
||||
if (src.empty())
|
||||
{
|
||||
cout << "Could not open or find the image!\n" << endl;
|
||||
cout << "Usage: " << argv[0] << " <Input image>" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user