Visual Servoing Platform  version 3.2.0 under development (2019-01-22)
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 }
error that can be emited by ViSP classes.
Definition: vpException.h:71
static void write(const vpImage< unsigned char > &I, const std::string &filename)
Definition: vpImageIo.cpp:375
const char * getMessage(void) const
Definition: vpException.cpp:90
static void read(vpImage< unsigned char > &I, const std::string &filename)
Definition: vpImageIo.cpp:207