Go to the documentation of this file.
32 cerr <<
"The user didn't pick any camera. Exiting." << endl;
38 cout <<
"Press 's' to save frames.\nClose the window to exit.\n";
45 if (!counter) tictac.
Tic();
55 std::dynamic_pointer_cast<CObservationImage>(obs);
61 std::dynamic_pointer_cast<CObservationStereoImages>(obs);
67 std::dynamic_pointer_cast<CObservation3DRangeScan>(obs);
68 if (o->hasIntensityImage)
img = &o->intensityImage;
75 double t = tictac.
Tac();
76 cout <<
"Frame Rate: " << counter /
t <<
" fps" << endl;
92 cout <<
"Saving frame to: " << sFile << endl;
93 img->saveToFile(sFile);
101 std::this_thread::sleep_for(2ms);
104 cout <<
"Closing..." << endl;
118 catch (std::exception& e)
120 std::cout <<
"MRPT exception caught: " << e.what() << std::endl;
125 printf(
"Untyped exception!!");
bool kbhit() noexcept
An OS-independent version of kbhit, which returns true if a key has been pushed.
std::shared_ptr< CObservation > Ptr
A high-performance stopwatch, with typical resolution of nanoseconds.
Contains classes for various device interfaces.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define ASSERT_(f)
Defines an assertion mechanism.
This namespace contains representation of robot actions and observations.
double Tac() noexcept
Stops the stopwatch.
std::shared_ptr< CObservationStereoImages > Ptr
CCameraSensor::Ptr prepareVideoSourceFromUserSelection()
Show to the user a list of possible camera drivers and creates and open the selected camera.
Declares a class derived from "CObservation" that encapsules a 3D range scan measurement,...
mrpt::gui::CDisplayWindow3D::Ptr win
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
std::shared_ptr< CObservationImage > Ptr
#define IS_CLASS(ptrObj, class_name)
Evaluates to true if the given pointer to an object (derived from mrpt::rtti::CObject) is of the give...
void Tic() noexcept
Starts the stopwatch.
This class creates a window as a graphical user interface (GUI) for displaying images to the user.
Classes for creating GUI windows for 2D and 3D visualization.
A class for storing images as grayscale or RGB bitmaps.
std::shared_ptr< CObservation3DRangeScan > Ptr
int getch() noexcept
An OS-independent version of getch, which waits until a key is pushed.
GLsizei const GLchar ** string
std::shared_ptr< CCameraSensor > Ptr
Declares a class derived from "CObservation" that encapsules an image from a camera,...
void TestCameraCaptureAsk()
Observation class for either a pair of left+right or left+disparity images from a stereo camera.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |