Simple Example Using OpenCV By CPP And Python

The article introduces how to display an image by OpenCV in CPlusPlus and Python language. The user can exit the whole program when he presses the ESC key. CPP CMakeLists.txt macro(use_cxx11) if (CMAKE_VERSION VERSION_LESS “3.1”) if (CMAKE_CXX_COMPILER_ID STREQUAL “GNU”) set (CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} -std=gnu++11”) endif () else () set (CMAKE_CXX_STANDARD 11) Read more…

Delete vtkObjectBase Object

The interface vtkObjectBase::UnRegister will reduce the reference count for pointer and delete the pointer if the reference count becomes zero. vtkObjectBase::Delete <= vtkObjectBase::UnRegister <= vtkObjectBase::UnRegisterInternal <= delete ptr vtkSmartPointerBase::~vtkSmartPointerBase { vtkObjectBase* object = this->Object; if(object) { this->Object = nullptr; object->UnRegister(nullptr); } } We can get the reference count and consumer Read more…

boost::progress_display

The class progress_display has definition and implementation in progress.hpp. The relevant example is in the following code snippet. Qt pro file: TEMPLATE = app CONFIG += console c++11 CONFIG -= app_bundle CONFIG -= qt INCLUDEPATH += /usr/local/Cellar/boost/1.66.0/include/ SOURCES += \ main.cpp main.cpp: #include <iostream> #include <boost/progress.hpp> #include <vector> #include <fstream> Read more…

A prohibited operation