OSVR-Core
TrackingDebugDisplay.h
Go to the documentation of this file.
1 
11 // Copyright 2016 Sensics, Inc.
12 //
13 // Licensed under the Apache License, Version 2.0 (the "License");
14 // you may not use this file except in compliance with the License.
15 // You may obtain a copy of the License at
16 //
17 // http://www.apache.org/licenses/LICENSE-2.0
18 //
19 // Unless required by applicable law or agreed to in writing, software
20 // distributed under the License is distributed on an "AS IS" BASIS,
21 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 // See the License for the specific language governing permissions and
23 // limitations under the License.
24 
25 #ifndef INCLUDED_TrackingDebugDisplay_h_GUID_AEB0A21B_C043_4EB3_F532_8BF3D9DDEF5C
26 #define INCLUDED_TrackingDebugDisplay_h_GUID_AEB0A21B_C043_4EB3_F532_8BF3D9DDEF5C
27 
28 // Internal Includes
29 #include "ConfigParams.h"
30 #include "LED.h"
31 #include "TrackingSystem_Impl.h"
32 
33 // Library/third-party includes
34 #include <util/Stride.h>
35 
36 #include <opencv2/core/core.hpp>
37 
38 // Standard includes
39 #include <iosfwd>
40 #include <string>
41 
42 namespace osvr {
43 namespace vbtracker {
44  enum class DebugDisplayMode {
45  InputImage,
46  Thresholding,
47  Blobs,
48  Status,
49  StatusWithAllReprojections
50  };
51  class TrackingSystem;
52  class TrackedBodyTarget;
53  struct CameraParameters;
55  public:
56  TrackingDebugDisplay(ConfigParams const &params);
57 
59  TrackingDebugDisplay &operator=(TrackingDebugDisplay const &) = delete;
60 
61  void triggerDisplay(TrackingSystem &tracking,
62  TrackingSystem::Impl const &impl);
63 
64  void showDebugImage(cv::Mat const &image, bool needsCopy = true);
65 
66  void quitDebug();
67 
68  private:
69  std::ostream &msg() const;
70  cv::Mat createAnnotatedBlobImage(TrackingSystem const &tracking,
71  CameraParameters const &camParams,
72  cv::Mat const &blobImage);
73  cv::Mat createStatusImage(TrackingSystem const &tracking,
74  CameraParameters const &camParams,
75  cv::Mat const &baseImage,
76  bool reprojectUnseenBeacons = false);
77 
78  bool m_enabled;
79  DebugDisplayMode m_mode = DebugDisplayMode::Status;
80  std::string m_windowName;
81  cv::Mat m_displayedFrame;
82  ::util::Stride m_debugStride;
83  const bool m_performingOptimization;
84  };
85 } // namespace vbtracker
86 } // namespace osvr
87 #endif // INCLUDED_TrackingDebugDisplay_h_GUID_AEB0A21B_C043_4EB3_F532_8BF3D9DDEF5C
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Definition: CameraParameters.h:41
A class for handling "do this every n times".
Private implementation structure for TrackingSystem.
Definition: TrackingSystem_Impl.h:49
Definition: TrackingSystem.h:54
Header file for class that tracks and identifies LEDs.
Definition: TrackingDebugDisplay.h:54
General configuration parameters.
Definition: ConfigParams.h:82
Handle the task of "do this every n times" in an easy way.
Definition: Stride.h:49