fixed compilation witn C++11 compiler

pull/265/head
Anatoly Baksheev 10 years ago
parent 24a9effd59
commit 62feeec31d
  1. 4
      modules/dnn/CMakeLists.txt
  2. 19
      modules/dnn/include/opencv2/dnn.hpp
  3. 10
      modules/dnn/include/opencv2/dnn/dict.hpp

@ -3,7 +3,7 @@ set(OPENCV_MODULE_IS_PART_OF_WORLD OFF)
option(WITH_PROTOBUF "Build with libprotobuf" ON)
if(NOT WITH_PROTOBUF)
message(FATAL_ERROR "libprotobuf is required for dnn module")
message(FATAL_ERROR "libprotobuf is required for dnn module")
endif()
find_package( Protobuf REQUIRED )
@ -27,4 +27,4 @@ ocv_create_module()
target_link_libraries(opencv_dnn ${PROTOBUF_LIBRARIES})
ocv_add_accuracy_tests()
ocv_add_perf_tests()
ocv_add_samples()
ocv_add_samples()

@ -17,10 +17,8 @@ namespace dnn
class LayerParams;
//wrapper over cv::Mat and cv::UMat
CV_EXPORTS class Blob
class CV_EXPORTS Blob
{
Mat m;
public:
Blob();
Blob(InputArray in);
@ -44,16 +42,19 @@ namespace dnn
int num() const;
Vec4i shape() const;
private:
Mat m;
};
CV_EXPORTS class LayerParams : public Dict
class CV_EXPORTS LayerParams : public Dict
{
public:
std::vector<Blob> learnedBlobs;
};
CV_EXPORTS class LayerRegister
class CV_EXPORTS LayerRegister
{
public:
@ -73,7 +74,7 @@ namespace dnn
};
//this class allows to build new Layers
CV_EXPORTS class Layer
class CV_EXPORTS Layer
{
public:
@ -103,7 +104,7 @@ namespace dnn
//TODO: maybe eliminate all int ids and replace them by string names
//Proxy class for different formats
//Each format importer must populate it
CV_EXPORTS class NetConfiguration
class CV_EXPORTS NetConfiguration
{
public:
@ -140,7 +141,7 @@ namespace dnn
};
CV_EXPORTS class Net
class CV_EXPORTS Net
{
public:
@ -157,7 +158,7 @@ namespace dnn
virtual void forward(int layer, std::vector<Ptr<Blob> > &layerOutputs) = 0;
};
CV_EXPORTS class Importer
class CV_EXPORTS Importer
{
public:

@ -35,7 +35,7 @@ struct DictValue
DictValue &operator=(const DictValue &r);
~DictValue();
private:
void release();
};
@ -57,14 +57,14 @@ public:
}
template <typename T>
const T &get(const String &name, const T &default) const
const T &get(const String &name, const T &default_value) const
{
_Dict::const_iterator i = dict.find(name);
if (i != dict.end())
return i->second.get<T>();
else
return default;
return default_value;
}
template<typename T>
@ -154,7 +154,7 @@ inline DictValue & DictValue::operator=(const DictValue &r)
{
if (&r == this)
return *this;
release();
//how to copy anonymous union without memcpy?
@ -175,4 +175,4 @@ inline DictValue::DictValue(const DictValue &r)
}
}
}
}

Loading…
Cancel
Save