Go to the documentation of this file.
23 #include <mrpt/examples_config.h>
25 MRPT_EXAMPLES_BASE_DIRECTORY +
string (
"vision_multiple_checkerboards/" );
31 const std::string & img_filename,
const unsigned int checkerboard_size_x,
32 const unsigned int checkerboard_size_y)
38 if (!
img .loadFromFile(img_filename))
39 throw std::runtime_error(
"Can't load image!" );
42 vector<vector<TPixelCoordf>> listCornerCoords;
44 timlog.
enter (
"findMultipleChessboardsCorners" );
47 img , listCornerCoords, checkerboard_size_x, checkerboard_size_y);
49 timlog.
leave (
"findMultipleChessboardsCorners" );
51 cout <<
"Number of checkerboards detected: " << listCornerCoords.size()
57 for (
size_t i = 0; i < listCornerCoords.size(); i++)
59 listCornerCoords[i], checkerboard_size_x, checkerboard_size_y);
63 win1.showImage(img_detect);
75 int main (
int argc,
char ** argv)
80 unsigned int checkerboard_size_x = 5;
81 unsigned int checkerboard_size_y = 4;
86 checkerboard_size_x = atoi(argv[2]);
87 checkerboard_size_y = atoi(argv[3]);
91 std::cerr <<
"Usage: " << argv[0] <<
" [IMAGE_FILE NX NY]\n" ;
96 sFile, checkerboard_size_x, checkerboard_size_y);
99 catch (std::exception& e)
101 std::cout <<
"MRPT exception caught: " << e.what() << std::endl;
106 printf(
"Untyped exception!!" );
A versatile "profiler" that logs the time spent within each pair of calls to enter(X)-leave(X),...
Classes for computer vision, detectors, features, etc.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void colorImage(CImage &ret) const
Returns a RGB version of the grayscale image, or itself if it is already a RGB image.
void enter(const char *func_name)
Start of a named section.
void dumpAllStats(const size_t column_width=80) const
Dump all stats through the COutputLogger interface.
void clear(bool deep_clear=false)
Resets all stats.
double leave(const char *func_name)
End of a named section.
This class creates a window as a graphical user interface (GUI) for displaying images to the user.
void findMultipleChessboardsCorners(const mrpt::img::CImage &img, std::vector< std::vector< mrpt::img::TPixelCoordf >> &cornerCoords, unsigned int check_size_x, unsigned int check_size_y)
Look for the corners of one or more chessboard/checkerboards in the image.
Classes for creating GUI windows for 2D and 3D visualization.
A class for storing images as grayscale or RGB bitmaps.
GLsizei const GLchar ** string
void TestMultipleCheckerboard(const std::string &img_filename, const unsigned int checkerboard_size_x, const unsigned int checkerboard_size_y)
bool drawChessboardCorners(std::vector< TPixelCoordf > &cornerCoords, unsigned int check_size_x, unsigned int check_size_y, unsigned int lines_width=1, unsigned int circles_radius=4)
Draw onto this image the detected corners of a chessboard.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST