mirror of
https://github.com/opencv/opencv.git
synced 2025-01-19 06:53:50 +08:00
Merge pull request #22041 from nglee:fix_return_by_const_value
This commit is contained in:
commit
9da9e8244b
@ -13,7 +13,7 @@ namespace cv {
|
||||
CV_EXPORTS const char* depthToString(int depth);
|
||||
|
||||
/** 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
|
||||
@ -23,7 +23,7 @@ namespace detail {
|
||||
CV_EXPORTS const char* depthToString_(int depth);
|
||||
|
||||
/** 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 {
|
||||
TEST_CUSTOM = 0,
|
||||
|
@ -147,7 +147,7 @@ public:
|
||||
return handle != NULL;
|
||||
}
|
||||
void* getSymbol(const char* symbolName) const;
|
||||
const std::string getName() const;
|
||||
std::string getName() const;
|
||||
private:
|
||||
void libraryLoad(const FileSystemPath_t& filename);
|
||||
void libraryRelease();
|
||||
|
@ -14,7 +14,7 @@ const char* depthToString(int depth)
|
||||
return s ? s : "<invalid depth>";
|
||||
}
|
||||
|
||||
const cv::String typeToString(int type)
|
||||
cv::String typeToString(int type)
|
||||
{
|
||||
cv::String s = detail::typeToString_(type);
|
||||
if (s.empty())
|
||||
@ -47,7 +47,7 @@ const char* depthToString_(int depth)
|
||||
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 cn = CV_MAT_CN(type);
|
||||
|
@ -231,7 +231,7 @@ static const bool CV_OPENCL_DISABLE_BUFFER_RECT_OPERATIONS = utils::getConfigura
|
||||
#endif
|
||||
);
|
||||
|
||||
static const String getBuildExtraOptions()
|
||||
static String getBuildExtraOptions()
|
||||
{
|
||||
static String param_buildExtraOptions;
|
||||
static bool initialized = false;
|
||||
|
@ -56,7 +56,7 @@ void* DynamicLib::getSymbol(const char* symbolName) const
|
||||
return res;
|
||||
}
|
||||
|
||||
const std::string DynamicLib::getName() const
|
||||
std::string DynamicLib::getName() const
|
||||
{
|
||||
return toPrintablePath(fname);
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ private:
|
||||
bool param = utils::getConfigurationParameterBool("OPENCV_DNN_ONNX_USE_LEGACY_NAMES", false);
|
||||
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;
|
||||
}
|
||||
|
||||
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
|
||||
if (node_proto.has_name() && !node_proto.name().empty())
|
||||
|
@ -568,7 +568,7 @@ private:
|
||||
typedef std::map<std::string, TFImporterNodeParser> DispatchMap;
|
||||
|
||||
const DispatchMap dispatch;
|
||||
static const DispatchMap buildDispatchMap();
|
||||
static DispatchMap buildDispatchMap();
|
||||
|
||||
void parseConvolution (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;
|
||||
};
|
||||
|
||||
const TFImporter::DispatchMap TFImporter::buildDispatchMap()
|
||||
TFImporter::DispatchMap TFImporter::buildDispatchMap()
|
||||
{
|
||||
static DispatchMap dispatch;
|
||||
dispatch["Conv2D"] = dispatch["SpaceToBatchND"] = dispatch["DepthwiseConv2dNative"] =
|
||||
|
@ -1143,8 +1143,8 @@ protected:
|
||||
virtual void clear();
|
||||
|
||||
const Mat& getDescriptors() const;
|
||||
const Mat getDescriptor( int imgIdx, int localDescIdx ) const;
|
||||
const Mat getDescriptor( int globalDescIdx ) const;
|
||||
Mat getDescriptor( int imgIdx, int localDescIdx ) const;
|
||||
Mat getDescriptor( int globalDescIdx ) const;
|
||||
void getLocalIdx( int globalDescIdx, int& imgIdx, int& localDescIdx ) const;
|
||||
|
||||
int size() const;
|
||||
|
@ -475,7 +475,7 @@ void DescriptorMatcher::DescriptorCollection::clear()
|
||||
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() );
|
||||
int globalIdx = startIdxs[imgIdx] + localDescIdx;
|
||||
@ -489,7 +489,7 @@ const Mat& DescriptorMatcher::DescriptorCollection::getDescriptors() const
|
||||
return mergedDescriptors;
|
||||
}
|
||||
|
||||
const Mat DescriptorMatcher::DescriptorCollection::getDescriptor( int globalDescIdx ) const
|
||||
Mat DescriptorMatcher::DescriptorCollection::getDescriptor( int globalDescIdx ) const
|
||||
{
|
||||
CV_Assert( globalDescIdx < size() );
|
||||
return mergedDescriptors.row( globalDescIdx );
|
||||
|
@ -181,7 +181,7 @@ template<> struct fluid_get_in<cv::GMat>
|
||||
template<> struct fluid_get_in<cv::GScalar>
|
||||
{
|
||||
// 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>();
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ inline Rect& operator&=(Rect& lhs, const Rect& rhs)
|
||||
return lhs;
|
||||
}
|
||||
|
||||
inline const Rect operator&(const Rect& lhs, const Rect& rhs)
|
||||
inline Rect operator&(const Rect& lhs, const Rect& rhs)
|
||||
{
|
||||
Rect result = lhs;
|
||||
return result &= rhs;
|
||||
|
@ -205,12 +205,12 @@ public:
|
||||
void setWaveCorrectKind(detail::WaveCorrectKind kind) { wave_correct_kind_ = kind; }
|
||||
|
||||
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)
|
||||
{ features_finder_ = features_finder; }
|
||||
|
||||
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)
|
||||
{ features_matcher_ = features_matcher; }
|
||||
|
||||
|
@ -133,7 +133,7 @@ private:
|
||||
class CV_EXPORTS_W BundleAdjusterBase : public Estimator
|
||||
{
|
||||
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_Assert(mask.type() == CV_8U && mask.size() == Size(3, 3));
|
||||
|
Loading…
Reference in New Issue
Block a user