Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
tutorial-image-reader.cpp
1
2#include <visp3/core/vpConfig.h>
3#include <visp3/io/vpImageIo.h>
4
5int main()
6{
7#ifdef ENABLE_VISP_NAMESPACE
8 using namespace VISP_NAMESPACE_NAME;
9#endif
10
11 try {
13 vpImageIo::read(I, "monkey.jpeg");
14 vpImageIo::write(I, "monkey.png");
15 }
16 catch (const vpException &e) {
17 std::cout << e.getMessage() << std::endl;
18 }
19 catch (...) {
20 std::cout << "Unsupported image format" << std::endl;
21 }
22}
error that can be emitted by ViSP classes.
Definition vpException.h:60
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
static void write(const vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
Definition of the vpImage class member functions.
Definition vpImage.h:131