5#include <visp3/core/vpConfig.h>
6#include <visp3/core/vpImage.h>
7#include <visp3/gui/vpDisplayFactory.h>
8#include <visp3/io/vpImageIo.h>
10#if defined(VISP_HAVE_MODULE_IMGPROC)
12#include <visp3/imgproc/vpImgproc.h>
16int main(
int argc,
const char **argv)
19#if defined(VISP_HAVE_MODULE_IMGPROC) && defined(VISP_HAVE_DISPLAY)
23#ifdef ENABLE_VISP_NAMESPACE
27 std::string input_filename =
"grid36-03.pgm";
29 for (
int i = 1;
i < argc;
i++) {
30 if (std::string(argv[i]) ==
"--input" && i + 1 < argc) {
31 input_filename = std::string(argv[i + 1]);
33 else if (std::string(argv[i]) ==
"--help" || std::string(argv[i]) ==
"-h") {
34 std::cout <<
"Usage: " << argv[0] <<
" [--input <input image>] [--help]" << std::endl;
43 I_res.insert(I,
vpImagePoint(I.getHeight(), I.getWidth()));
45#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
63 I_res.insert(I_intermodes,
vpImagePoint(0, I.getWidth()));
69 I_res.insert(I_isodata,
vpImagePoint(0, 2 * I.getWidth()));
81 I_res.insert(I_otsu,
vpImagePoint(I.getHeight(), 2 * I.getWidth()));
87 I_res.insert(I_triangle,
vpImagePoint(2 * I.getHeight(), 0));
102#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11) && defined(VISP_HAVE_DISPLAY)
103 if (display !=
nullptr) {
Class that defines generic functionalities for display.
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition of the vpImage class member functions.
VISP_EXPORT unsigned char autoThreshold(VISP_NAMESPACE_ADDRESSING vpImage< unsigned char > &I, const vpAutoThresholdMethod &method, const unsigned char backgroundValue=0, const unsigned char foregroundValue=255)
@ AUTO_THRESHOLD_INTERMODES
@ AUTO_THRESHOLD_TRIANGLE
std::shared_ptr< vpDisplay > createDisplay()
Return a smart pointer vpDisplay specialization if a GUI library is available or nullptr otherwise.
vpDisplay * allocateDisplay()
Return a newly allocated vpDisplay specialization if a GUI library is available or nullptr otherwise.