Visual Servoing Platform  version 3.6.1 under development (2024-03-18)
tutorial-image-reader.cpp
#include <visp3/io/vpImageIo.h>
int main()
{
try {
vpImageIo::read(I, "monkey.jpeg");
vpImageIo::write(I, "monkey.png");
} catch (const vpException &e) {
std::cout << e.getMessage() << std::endl;
} catch (...) {
std::cout << "Unsupported image format" << std::endl;
}
}
error that can be emitted by ViSP classes.
Definition: vpException.h:59
const char * getMessage() const
Definition: vpException.cpp:64
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
Definition: vpImageIo.cpp:143
static void write(const vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
Definition: vpImageIo.cpp:287