Go to the documentation of this file.
34 bool do_smooth =
false;
35 bool do_grayscale =
false;
38 cout <<
"Number of octaves to use [4]: ";
42 int i = atoi(s.c_str());
43 if (i > 0) N_OCTAVES = i;
48 cout <<
"Please, select the input video file or camera...\n";
54 cout <<
"Video stream open OK\n";
61 std::vector<COpenGLViewport::Ptr> gl_views(N_OCTAVES);
64 gl_views[0] = theScene->getViewport(
"main");
68 for (
size_t i = 1; i < N_OCTAVES; i++)
69 gl_views[i] = theScene->createViewport(
format(
"view_%i", (
int)i));
78 (double(1 << (N_OCTAVES - 1))) / ((1 << N_OCTAVES) - 1);
82 for (
size_t i = 0; i < N_OCTAVES; i++)
93 win.unlockAccess3DScene();
101 "Keys: 's'=Smoothing, 'g': Grayscale 'f': Features",
108 cout <<
"Close the window to end.\n";
111 win.addTextMessage(5, 5,
format(
"%.02fFPS",
win.getRenderingFPS()));
112 std::this_thread::sleep_for(1ms);
122 std::dynamic_pointer_cast<CObservationImage>(obs);
128 N_OCTAVES, do_smooth, do_grayscale);
130 win.get3DSceneAndLock();
132 for (
size_t i = 0; i < N_OCTAVES; i++)
142 "Smooth=%i Grayscale=%i",
int(do_smooth ? 1 : 0),
143 int(do_grayscale ? 1 : 0)),
147 win.unlockAccess3DScene();
154 int key =
win.getPushedKey(&kmods);
158 if (key ==
's' || key ==
'S') do_smooth = !do_smooth;
159 if (key ==
'g' || key ==
'G') do_grayscale = !do_grayscale;
176 catch (
const std::exception& e)
183 printf(
"Untyped exception!!");
std::shared_ptr< CObservation > Ptr
void setImageView(const mrpt::img::CImage &img)
Set this viewport into "image view"-mode, where an image is efficiently drawn (fitting the viewport a...
Copyright (C) 2010 Hauke Strasdat Imperial College London Copyright (c) 2005-2020,...
std::shared_ptr< mrpt::obs ::CObservationImage > Ptr
#define IS_CLASS(obj, class_name)
True if the given reference to object (derived from mrpt::rtti::CObject) is of the given class.
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.
CCameraSensor::Ptr prepareVideoSourceFromUserSelection()
Show to the user a list of possible camera drivers and creates and open the selected camera.
mrpt::gui::CDisplayWindow3D::Ptr win
Classes for creating GUI windows for 2D and 3D visualization.
void setViewportPosition(const double x, const double y, const double width, const double height)
Change the viewport position and dimension on the rendering window.
std::shared_ptr< mrpt::opengl ::COpenGLScene > Ptr
A viewport within a COpenGLScene, containing a set of OpenGL objects to render.
std::shared_ptr< CCameraSensor > Ptr
std::vector< mrpt::img::CImage > images
The individual images:
std::string exception_to_str(const std::exception &e)
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THR...
Holds and builds a pyramid of images: starting with an image at full resolution (octave=1),...
The namespace for 3D scene representation and rendering.
Declares a class derived from "CObservation" that encapsules an image from a camera,...
A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.
std::string std::string format(std::string_view fmt, ARGS &&... args)
bool buildPyramidFast(mrpt::img::CImage &img, const size_t nOctaves, const bool smooth_halves=true, const bool convert_grayscale=false)
Exactly like buildPyramid(), but if the input image has not to be converted from RGB to grayscale,...
Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sat Jun 27 14:00:59 UTC 2020 | |