Skip to content
Snippets Groups Projects
  • Khan Schroder-Turner's avatar
    d5bffa24
    Library renaming fork (#219) · d5bffa24
    Khan Schroder-Turner authored
    
    * feat(library): Update CMakeLists to import more canonically
    
    Update the source files and CMakeLists to import more canonically when using as an external library.
    
    * feat(library): Update CMakeLists to import more canonically
    
    Update the source files and CMakeLists to import more canonically when using as an external library.
    
    * feat(library): Library Renaming
    
    Update library path in demo files
    
    * feat(library): Library Renaming
    
    Update library path in demo files
    
    * feat(library): Library Renaming
    
    Update library path
    
    ---------
    
    Co-authored-by: default avatarKhan Schroder-Turner <khan.schroder-turner@droneshield.com>
    Library renaming fork (#219)
    Khan Schroder-Turner authored
    
    * feat(library): Update CMakeLists to import more canonically
    
    Update the source files and CMakeLists to import more canonically when using as an external library.
    
    * feat(library): Update CMakeLists to import more canonically
    
    Update the source files and CMakeLists to import more canonically when using as an external library.
    
    * feat(library): Library Renaming
    
    Update library path in demo files
    
    * feat(library): Library Renaming
    
    Update library path in demo files
    
    * feat(library): Library Renaming
    
    Update library path
    
    ---------
    
    Co-authored-by: default avatarKhan Schroder-Turner <khan.schroder-turner@droneshield.com>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Main.cpp 1.57 KiB
#include <iostream>

#include "utils/GenericKeys.h"
#include "VideoAnalysis.h"

namespace bgslibrary
{
  class Main
  {
  private:
    Main();

  public:
    static void start(int argc, const char **argv)
    {
      std::cout << "---------------------------------------------" << std::endl;
      std::cout << "Background Subtraction Library               " << std::endl;
      std::cout << "https://github.com/andrewssobral/bgslibrary  " << std::endl;
      std::cout << "This software is under the MIT License       " << std::endl;
      std::cout << "---------------------------------------------" << std::endl;
      std::cout << "Using OpenCV version " << CV_VERSION << std::endl;

      try
      {
        auto key = KEY_ESC;

        do
        {
          auto videoAnalysis = std::make_unique<VideoAnalysis>();

          if (videoAnalysis->setup(argc, argv))
          {
            videoAnalysis->start();

            std::cout << "Processing finished, enter:" << std::endl;
            std::cout << "R - Repeat" << std::endl;
            std::cout << "Q - Quit" << std::endl;

            key = cv::waitKey();
          }

          cv::destroyAllWindows();

        } while (key == KEY_REPEAT);
      }
      catch (const std::exception& ex)
      {
        std::cout << "std::exception:" << ex.what() << std::endl;
        return;
      }
      catch (...)
      {
        std::cout << "Unknow error" << std::endl;
        return;
      }

#ifdef WIN32
      //system("pause");
#endif
    }
  };
}

int main(int argc, const char **argv)
{
  bgslibrary::Main::start(argc, argv);
  return 0;
}