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,8 +5,8 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <iostream>
|
||||
|
||||
using namespace cv;
|
||||
|
||||
@@ -56,13 +56,18 @@ static void CannyThreshold(int, void*)
|
||||
/**
|
||||
* @function main
|
||||
*/
|
||||
int main( int, char** argv )
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
//![load]
|
||||
src = imread( argv[1], IMREAD_COLOR ); // Load an image
|
||||
CommandLineParser parser( argc, argv, "{@input | ../data/fruits.jpg | input image}" );
|
||||
src = imread( parser.get<String>( "@input" ), IMREAD_COLOR ); // Load an image
|
||||
|
||||
if( src.empty() )
|
||||
{ return -1; }
|
||||
{
|
||||
std::cout << "Could not open or find the image!\n" << std::endl;
|
||||
std::cout << "Usage: " << argv[0] << " <Input image>" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
//![load]
|
||||
|
||||
//![create_mat]
|
||||
|
||||
@@ -20,7 +20,7 @@ const char* warp_rotate_window = "Warp + Rotate";
|
||||
/**
|
||||
* @function main
|
||||
*/
|
||||
int main( int, char** argv )
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
Point2f srcTri[3];
|
||||
Point2f dstTri[3];
|
||||
@@ -30,7 +30,14 @@ int main( int, char** argv )
|
||||
Mat src, warp_dst, warp_rotate_dst;
|
||||
|
||||
/// Load the image
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
CommandLineParser parser( argc, argv, "{@input | ../data/lena.jpg | input image}" );
|
||||
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;
|
||||
}
|
||||
|
||||
/// Set the dst image the same type and size as src
|
||||
warp_dst = Mat::zeros( src.rows, src.cols, src.type() );
|
||||
|
||||
@@ -12,7 +12,7 @@ using namespace std;
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
//![load]
|
||||
const char* filename = argc >=2 ? argv[1] : "../../../data/smarties.png";
|
||||
const char* filename = argc >=2 ? argv[1] : "../data/smarties.png";
|
||||
|
||||
// Loads an image
|
||||
Mat src = imread( filename, IMREAD_COLOR );
|
||||
|
||||
@@ -16,7 +16,7 @@ int main(int argc, char** argv)
|
||||
Mat dst, cdst, cdstP;
|
||||
|
||||
//![load]
|
||||
const char* default_file = "../../../data/sudoku.png";
|
||||
const char* default_file = "../data/sudoku.png";
|
||||
const char* filename = argc >=2 ? argv[1] : default_file;
|
||||
|
||||
// Loads an image
|
||||
|
||||
Reference in New Issue
Block a user