Skip to content

Commit d6895a1

Browse files
committed
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
2 parents 158af2f + 320e633 commit d6895a1

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

modules/rgbd/include/opencv2/rgbd/linemod.hpp

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class CV_EXPORTS_W Modality
163163
/**
164164
* \brief Modality that computes quantized gradient orientations from a color image.
165165
*/
166-
class CV_EXPORTS ColorGradient : public Modality
166+
class CV_EXPORTS_W ColorGradient : public Modality
167167
{
168168
public:
169169
/**
@@ -181,14 +181,16 @@ class CV_EXPORTS ColorGradient : public Modality
181181
*/
182182
ColorGradient(float weak_threshold, size_t num_features, float strong_threshold);
183183

184+
CV_WRAP static Ptr<ColorGradient> create(float weak_threshold, size_t num_features, float strong_threshold);
185+
184186
virtual String name() const CV_OVERRIDE;
185187

186188
virtual void read(const FileNode& fn) CV_OVERRIDE;
187189
virtual void write(FileStorage& fs) const CV_OVERRIDE;
188190

189-
float weak_threshold;
190-
size_t num_features;
191-
float strong_threshold;
191+
CV_PROP float weak_threshold;
192+
CV_PROP size_t num_features;
193+
CV_PROP float strong_threshold;
192194

193195
protected:
194196
virtual Ptr<QuantizedPyramid> processImpl(const Mat& src,
@@ -198,7 +200,7 @@ class CV_EXPORTS ColorGradient : public Modality
198200
/**
199201
* \brief Modality that computes quantized surface normals from a dense depth map.
200202
*/
201-
class CV_EXPORTS DepthNormal : public Modality
203+
class CV_EXPORTS_W DepthNormal : public Modality
202204
{
203205
public:
204206
/**
@@ -219,15 +221,18 @@ class CV_EXPORTS DepthNormal : public Modality
219221
DepthNormal(int distance_threshold, int difference_threshold, size_t num_features,
220222
int extract_threshold);
221223

224+
CV_WRAP static Ptr<DepthNormal> create(int distance_threshold, int difference_threshold,
225+
size_t num_features, int extract_threshold);
226+
222227
virtual String name() const CV_OVERRIDE;
223228

224229
virtual void read(const FileNode& fn) CV_OVERRIDE;
225230
virtual void write(FileStorage& fs) const CV_OVERRIDE;
226231

227-
int distance_threshold;
228-
int difference_threshold;
229-
size_t num_features;
230-
int extract_threshold;
232+
CV_PROP int distance_threshold;
233+
CV_PROP int difference_threshold;
234+
CV_PROP size_t num_features;
235+
CV_PROP int extract_threshold;
231236

232237
protected:
233238
virtual Ptr<QuantizedPyramid> processImpl(const Mat& src,

modules/rgbd/src/linemod.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,11 @@ ColorGradient::ColorGradient(float _weak_threshold, size_t _num_features, float
549549
{
550550
}
551551

552+
Ptr<ColorGradient> ColorGradient::create(float weak_threshold, size_t num_features, float strong_threshold)
553+
{
554+
return makePtr<ColorGradient>(weak_threshold, num_features, strong_threshold);
555+
}
556+
552557
static const char CG_NAME[] = "ColorGradient";
553558

554559
String ColorGradient::name() const
@@ -864,6 +869,12 @@ DepthNormal::DepthNormal(int _distance_threshold, int _difference_threshold, siz
864869
{
865870
}
866871

872+
Ptr<DepthNormal> DepthNormal::create(int distance_threshold, int difference_threshold, size_t num_features,
873+
int extract_threshold)
874+
{
875+
return makePtr<DepthNormal>(distance_threshold, difference_threshold, num_features, extract_threshold);
876+
}
877+
867878
static const char DN_NAME[] = "DepthNormal";
868879

869880
String DepthNormal::name() const

0 commit comments

Comments
 (0)