Visual Servoing Platform  version 3.5.0 under development (2022-02-15)
tutorial-image-reader.cpp
1 
2 #include <visp3/io/vpImageIo.h>
3 
4 int main()
5 {
6  try {
8  vpImageIo::read(I, "monkey.jpeg");
9  vpImageIo::write(I, "monkey.png");
10  } catch (const vpException &e) {
11  std::cout << e.getMessage() << std::endl;
12  } catch (...) {
13  std::cout << "Unsupported image format" << std::endl;
14  }
15 }
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
Definition: vpImageIo.cpp:149
error that can be emited by ViSP classes.
Definition: vpException.h:71
const char * getMessage() const
Definition: vpException.cpp:90
static void write(const vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
Definition: vpImageIo.cpp:293