Skip to content

Commit 320e633

Browse files
committed
Merge pull request #1981 from paroj:linemodpy
2 parents 3575a71 + f515f0f commit 320e633

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
@@ -200,7 +200,7 @@ class CV_EXPORTS_W Modality
200200
/**
201201
* \brief Modality that computes quantized gradient orientations from a color image.
202202
*/
203-
class CV_EXPORTS ColorGradient : public Modality
203+
class CV_EXPORTS_W ColorGradient : public Modality
204204
{
205205
public:
206206
/**
@@ -218,14 +218,16 @@ class CV_EXPORTS ColorGradient : public Modality
218218
*/
219219
ColorGradient(float weak_threshold, size_t num_features, float strong_threshold);
220220

221+
CV_WRAP static Ptr<ColorGradient> create(float weak_threshold, size_t num_features, float strong_threshold);
222+
221223
virtual String name() const CV_OVERRIDE;
222224

223225
virtual void read(const FileNode& fn) CV_OVERRIDE;
224226
virtual void write(FileStorage& fs) const CV_OVERRIDE;
225227

226-
float weak_threshold;
227-
size_t num_features;
228-
float strong_threshold;
228+
CV_PROP float weak_threshold;
229+
CV_PROP size_t num_features;
230+
CV_PROP float strong_threshold;
229231

230232
protected:
231233
virtual Ptr<QuantizedPyramid> processImpl(const Mat& src,
@@ -235,7 +237,7 @@ class CV_EXPORTS ColorGradient : public Modality
235237
/**
236238
* \brief Modality that computes quantized surface normals from a dense depth map.
237239
*/
238-
class CV_EXPORTS DepthNormal : public Modality
240+
class CV_EXPORTS_W DepthNormal : public Modality
239241
{
240242
public:
241243
/**
@@ -256,15 +258,18 @@ class CV_EXPORTS DepthNormal : public Modality
256258
DepthNormal(int distance_threshold, int difference_threshold, size_t num_features,
257259
int extract_threshold);
258260

261+
CV_WRAP static Ptr<DepthNormal> create(int distance_threshold, int difference_threshold,
262+
size_t num_features, int extract_threshold);
263+
259264
virtual String name() const CV_OVERRIDE;
260265

261266
virtual void read(const FileNode& fn) CV_OVERRIDE;
262267
virtual void write(FileStorage& fs) const CV_OVERRIDE;
263268

264-
int distance_threshold;
265-
int difference_threshold;
266-
size_t num_features;
267-
int extract_threshold;
269+
CV_PROP int distance_threshold;
270+
CV_PROP int difference_threshold;
271+
CV_PROP size_t num_features;
272+
CV_PROP int extract_threshold;
268273

269274
protected:
270275
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
@@ -562,6 +562,11 @@ ColorGradient::ColorGradient(float _weak_threshold, size_t _num_features, float
562562
{
563563
}
564564

565+
Ptr<ColorGradient> ColorGradient::create(float weak_threshold, size_t num_features, float strong_threshold)
566+
{
567+
return makePtr<ColorGradient>(weak_threshold, num_features, strong_threshold);
568+
}
569+
565570
static const char CG_NAME[] = "ColorGradient";
566571

567572
String ColorGradient::name() const
@@ -877,6 +882,12 @@ DepthNormal::DepthNormal(int _distance_threshold, int _difference_threshold, siz
877882
{
878883
}
879884

885+
Ptr<DepthNormal> DepthNormal::create(int distance_threshold, int difference_threshold, size_t num_features,
886+
int extract_threshold)
887+
{
888+
return makePtr<DepthNormal>(distance_threshold, difference_threshold, num_features, extract_threshold);
889+
}
890+
880891
static const char DN_NAME[] = "DepthNormal";
881892

882893
String DepthNormal::name() const

0 commit comments

Comments
 (0)