Merge pull request #22041 from nglee:fix_return_by_const_value

pull/22017/head
Alexander Alekhin 3 years ago
commit 9da9e8244b
  1. 4
      modules/core/include/opencv2/core/check.hpp
  2. 2
      modules/core/include/opencv2/core/utils/plugin_loader.private.hpp
  3. 4
      modules/core/src/check.cpp
  4. 2
      modules/core/src/ocl.cpp
  5. 2
      modules/core/src/utils/plugin_loader.impl.hpp
  6. 4
      modules/dnn/src/onnx/onnx_importer.cpp
  7. 4
      modules/dnn/src/tensorflow/tf_importer.cpp
  8. 4
      modules/features2d/include/opencv2/features2d.hpp
  9. 4
      modules/features2d/src/matchers.cpp
  10. 2
      modules/gapi/include/opencv2/gapi/fluid/gfluidkernel.hpp
  11. 2
      modules/gapi/include/opencv2/gapi/own/types.hpp
  12. 4
      modules/stitching/include/opencv2/stitching.hpp
  13. 2
      modules/stitching/include/opencv2/stitching/detail/motion_estimators.hpp

@ -13,7 +13,7 @@ namespace cv {
CV_EXPORTS const char* depthToString(int depth); CV_EXPORTS const char* depthToString(int depth);
/** Returns string of cv::Mat depth value: CV_8UC3 -> "CV_8UC3" or "<invalid type>" */ /** Returns string of cv::Mat depth value: CV_8UC3 -> "CV_8UC3" or "<invalid type>" */
CV_EXPORTS const String typeToString(int type); CV_EXPORTS String typeToString(int type);
//! @cond IGNORED //! @cond IGNORED
@ -23,7 +23,7 @@ namespace detail {
CV_EXPORTS const char* depthToString_(int depth); CV_EXPORTS const char* depthToString_(int depth);
/** Returns string of cv::Mat depth value: CV_8UC3 -> "CV_8UC3" or cv::String() */ /** Returns string of cv::Mat depth value: CV_8UC3 -> "CV_8UC3" or cv::String() */
CV_EXPORTS const cv::String typeToString_(int type); CV_EXPORTS cv::String typeToString_(int type);
enum TestOp { enum TestOp {
TEST_CUSTOM = 0, TEST_CUSTOM = 0,

@ -147,7 +147,7 @@ public:
return handle != NULL; return handle != NULL;
} }
void* getSymbol(const char* symbolName) const; void* getSymbol(const char* symbolName) const;
const std::string getName() const; std::string getName() const;
private: private:
void libraryLoad(const FileSystemPath_t& filename); void libraryLoad(const FileSystemPath_t& filename);
void libraryRelease(); void libraryRelease();

@ -14,7 +14,7 @@ const char* depthToString(int depth)
return s ? s : "<invalid depth>"; return s ? s : "<invalid depth>";
} }
const cv::String typeToString(int type) cv::String typeToString(int type)
{ {
cv::String s = detail::typeToString_(type); cv::String s = detail::typeToString_(type);
if (s.empty()) if (s.empty())
@ -47,7 +47,7 @@ const char* depthToString_(int depth)
return (depth <= CV_16F && depth >= 0) ? depthNames[depth] : NULL; return (depth <= CV_16F && depth >= 0) ? depthNames[depth] : NULL;
} }
const cv::String typeToString_(int type) cv::String typeToString_(int type)
{ {
int depth = CV_MAT_DEPTH(type); int depth = CV_MAT_DEPTH(type);
int cn = CV_MAT_CN(type); int cn = CV_MAT_CN(type);

@ -231,7 +231,7 @@ static const bool CV_OPENCL_DISABLE_BUFFER_RECT_OPERATIONS = utils::getConfigura
#endif #endif
); );
static const String getBuildExtraOptions() static String getBuildExtraOptions()
{ {
static String param_buildExtraOptions; static String param_buildExtraOptions;
static bool initialized = false; static bool initialized = false;

@ -56,7 +56,7 @@ void* DynamicLib::getSymbol(const char* symbolName) const
return res; return res;
} }
const std::string DynamicLib::getName() const std::string DynamicLib::getName() const
{ {
return toPrintablePath(fname); return toPrintablePath(fname);
} }

@ -205,7 +205,7 @@ private:
bool param = utils::getConfigurationParameterBool("OPENCV_DNN_ONNX_USE_LEGACY_NAMES", false); bool param = utils::getConfigurationParameterBool("OPENCV_DNN_ONNX_USE_LEGACY_NAMES", false);
return param; return param;
} }
const std::string extractNodeName(const opencv_onnx::NodeProto& node_proto); std::string extractNodeName(const opencv_onnx::NodeProto& node_proto);
}; };
@ -922,7 +922,7 @@ const ONNXImporter::DispatchMap& ONNXImporter::getDispatchMap(const opencv_onnx:
return it->second; return it->second;
} }
const std::string ONNXImporter::extractNodeName(const opencv_onnx::NodeProto& node_proto) std::string ONNXImporter::extractNodeName(const opencv_onnx::NodeProto& node_proto)
{ {
// We need to rework DNN outputs API, this is a workaround for #21698 // We need to rework DNN outputs API, this is a workaround for #21698
if (node_proto.has_name() && !node_proto.name().empty()) if (node_proto.has_name() && !node_proto.name().empty())

@ -568,7 +568,7 @@ private:
typedef std::map<std::string, TFImporterNodeParser> DispatchMap; typedef std::map<std::string, TFImporterNodeParser> DispatchMap;
const DispatchMap dispatch; const DispatchMap dispatch;
static const DispatchMap buildDispatchMap(); static DispatchMap buildDispatchMap();
void parseConvolution (tensorflow::GraphDef& net, const tensorflow::NodeDef& layer, LayerParams& layerParams); void parseConvolution (tensorflow::GraphDef& net, const tensorflow::NodeDef& layer, LayerParams& layerParams);
void parseBias (tensorflow::GraphDef& net, const tensorflow::NodeDef& layer, LayerParams& layerParams); void parseBias (tensorflow::GraphDef& net, const tensorflow::NodeDef& layer, LayerParams& layerParams);
@ -645,7 +645,7 @@ protected:
TFImporter* importer; TFImporter* importer;
}; };
const TFImporter::DispatchMap TFImporter::buildDispatchMap() TFImporter::DispatchMap TFImporter::buildDispatchMap()
{ {
static DispatchMap dispatch; static DispatchMap dispatch;
dispatch["Conv2D"] = dispatch["SpaceToBatchND"] = dispatch["DepthwiseConv2dNative"] = dispatch["Conv2D"] = dispatch["SpaceToBatchND"] = dispatch["DepthwiseConv2dNative"] =

@ -1143,8 +1143,8 @@ protected:
virtual void clear(); virtual void clear();
const Mat& getDescriptors() const; const Mat& getDescriptors() const;
const Mat getDescriptor( int imgIdx, int localDescIdx ) const; Mat getDescriptor( int imgIdx, int localDescIdx ) const;
const Mat getDescriptor( int globalDescIdx ) const; Mat getDescriptor( int globalDescIdx ) const;
void getLocalIdx( int globalDescIdx, int& imgIdx, int& localDescIdx ) const; void getLocalIdx( int globalDescIdx, int& imgIdx, int& localDescIdx ) const;
int size() const; int size() const;

@ -475,7 +475,7 @@ void DescriptorMatcher::DescriptorCollection::clear()
mergedDescriptors.release(); mergedDescriptors.release();
} }
const Mat DescriptorMatcher::DescriptorCollection::getDescriptor( int imgIdx, int localDescIdx ) const Mat DescriptorMatcher::DescriptorCollection::getDescriptor( int imgIdx, int localDescIdx ) const
{ {
CV_Assert( imgIdx < (int)startIdxs.size() ); CV_Assert( imgIdx < (int)startIdxs.size() );
int globalIdx = startIdxs[imgIdx] + localDescIdx; int globalIdx = startIdxs[imgIdx] + localDescIdx;
@ -489,7 +489,7 @@ const Mat& DescriptorMatcher::DescriptorCollection::getDescriptors() const
return mergedDescriptors; return mergedDescriptors;
} }
const Mat DescriptorMatcher::DescriptorCollection::getDescriptor( int globalDescIdx ) const Mat DescriptorMatcher::DescriptorCollection::getDescriptor( int globalDescIdx ) const
{ {
CV_Assert( globalDescIdx < size() ); CV_Assert( globalDescIdx < size() );
return mergedDescriptors.row( globalDescIdx ); return mergedDescriptors.row( globalDescIdx );

@ -181,7 +181,7 @@ template<> struct fluid_get_in<cv::GMat>
template<> struct fluid_get_in<cv::GScalar> template<> struct fluid_get_in<cv::GScalar>
{ {
// FIXME: change to return by reference when moved to own::Scalar // FIXME: change to return by reference when moved to own::Scalar
static const cv::Scalar get(const cv::GArgs &in_args, int idx) static cv::Scalar get(const cv::GArgs &in_args, int idx)
{ {
return in_args[idx].unsafe_get<cv::Scalar>(); return in_args[idx].unsafe_get<cv::Scalar>();
} }

@ -89,7 +89,7 @@ inline Rect& operator&=(Rect& lhs, const Rect& rhs)
return lhs; return lhs;
} }
inline const Rect operator&(const Rect& lhs, const Rect& rhs) inline Rect operator&(const Rect& lhs, const Rect& rhs)
{ {
Rect result = lhs; Rect result = lhs;
return result &= rhs; return result &= rhs;

@ -205,12 +205,12 @@ public:
void setWaveCorrectKind(detail::WaveCorrectKind kind) { wave_correct_kind_ = kind; } void setWaveCorrectKind(detail::WaveCorrectKind kind) { wave_correct_kind_ = kind; }
Ptr<Feature2D> featuresFinder() { return features_finder_; } Ptr<Feature2D> featuresFinder() { return features_finder_; }
const Ptr<Feature2D> featuresFinder() const { return features_finder_; } Ptr<Feature2D> featuresFinder() const { return features_finder_; }
void setFeaturesFinder(Ptr<Feature2D> features_finder) void setFeaturesFinder(Ptr<Feature2D> features_finder)
{ features_finder_ = features_finder; } { features_finder_ = features_finder; }
Ptr<detail::FeaturesMatcher> featuresMatcher() { return features_matcher_; } Ptr<detail::FeaturesMatcher> featuresMatcher() { return features_matcher_; }
const Ptr<detail::FeaturesMatcher> featuresMatcher() const { return features_matcher_; } Ptr<detail::FeaturesMatcher> featuresMatcher() const { return features_matcher_; }
void setFeaturesMatcher(Ptr<detail::FeaturesMatcher> features_matcher) void setFeaturesMatcher(Ptr<detail::FeaturesMatcher> features_matcher)
{ features_matcher_ = features_matcher; } { features_matcher_ = features_matcher; }

@ -133,7 +133,7 @@ private:
class CV_EXPORTS_W BundleAdjusterBase : public Estimator class CV_EXPORTS_W BundleAdjusterBase : public Estimator
{ {
public: public:
CV_WRAP const Mat refinementMask() const { return refinement_mask_.clone(); } CV_WRAP Mat refinementMask() const { return refinement_mask_.clone(); }
CV_WRAP void setRefinementMask(const Mat &mask) CV_WRAP void setRefinementMask(const Mat &mask)
{ {
CV_Assert(mask.type() == CV_8U && mask.size() == Size(3, 3)); CV_Assert(mask.type() == CV_8U && mask.size() == Size(3, 3));

Loading…
Cancel
Save