Go to the documentation of this file.
34 bool do_smooth =
false;
35 bool do_grayscale =
false;
36 bool do_features =
false;
39 cout <<
"Number of octaves to use [4]: ";
43 int i = atoi(
s.c_str());
44 if (i > 0) N_OCTAVES = i;
49 cout <<
"Please, select the input video file or camera...\n";
55 cout <<
"Video stream open OK\n";
62 std::vector<COpenGLViewport::Ptr> gl_views(N_OCTAVES);
65 gl_views[0] = theScene->getViewport(
"main");
69 for (
size_t i = 1; i < N_OCTAVES; i++)
70 gl_views[i] = theScene->createViewport(
format(
"view_%i", (
int)i));
79 (double(1 << (N_OCTAVES - 1))) / ((1 << N_OCTAVES) - 1);
83 for (
size_t i = 0; i < N_OCTAVES; i++)
94 win.unlockAccess3DScene();
102 "Keys: 's'=Smoothing, 'g': Grayscale 'f': Features",
TColorf(.8, .8, 0),
112 cout <<
"Close the window to end.\n";
115 win.addTextMessage(5, 5,
format(
"%.02fFPS",
win.getRenderingFPS()));
116 std::this_thread::sleep_for(1ms);
126 std::dynamic_pointer_cast<CObservationImage>(obs);
132 N_OCTAVES, do_smooth, do_grayscale);
137 static const int threshold = 20;
145 CFeatureExtraction::detectFeatures_SSE2_FASTER12(
146 gray_img, feats, threshold);
153 win.get3DSceneAndLock();
155 for (
size_t i = 0; i < N_OCTAVES; i++)
165 "Smooth=%i Grayscale=%i Features=%i",
166 int(do_smooth ? 1 : 0),
int(do_grayscale ? 1 : 0),
167 int(do_features ? 1 : 0)),
168 TColorf(.8, .8, 0),
"sans", 10,
174 win.unlockAccess3DScene();
181 int key =
win.getPushedKey(&kmods);
185 if (key ==
's' || key ==
'S') do_smooth = !do_smooth;
186 if (key ==
'g' || key ==
'G') do_grayscale = !do_grayscale;
187 if (key ==
'f' || key ==
'F') do_features = !do_features;
204 catch (std::exception& e)
206 std::cout <<
"MRPT exception caught: " << e.what() << std::endl;
211 printf(
"Untyped exception!!");
std::shared_ptr< CObservation > Ptr
void 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,...
GLenum GLsizei GLenum format
void setImageView(const mrpt::img::CImage &img)
Set this viewport into "image view"-mode, where an image is efficiently drawn (fitting the viewport a...
Classes for computer vision, detectors, features, etc.
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
std::shared_ptr< CObservationImage > Ptr
A RGB color - floats in the range [0,1].
#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...
Classes for creating GUI windows for 2D and 3D visualization.
@ FILL
renders glyphs as filled polygons
void setViewportPosition(const double x, const double y, const double width, const double height)
Change the viewport position and dimension on the rendering window.
A class for storing images as grayscale or RGB bitmaps.
@ FAST_REF_OR_CONVERT_TO_GRAY
A viewport within a COpenGLScene, containing a set of OpenGL objects to render.
GLsizei const GLchar ** string
std::shared_ptr< COpenGLScene > Ptr
std::shared_ptr< CCameraSensor > Ptr
std::vector< mrpt::img::CImage > images
The individual images:
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.
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 | |