Skip to content

Commit 4889ec5

Browse files
committed
structured_light: python / java bindings
1 parent 0c24199 commit 4889ec5

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
set(the_description "Structured Light API")
2-
ocv_define_module(structured_light opencv_core opencv_calib3d opencv_imgproc opencv_highgui opencv_features2d opencv_rgbd OPTIONAL opencv_viz)
2+
ocv_define_module(structured_light opencv_core opencv_calib3d opencv_imgproc opencv_highgui opencv_features2d opencv_rgbd OPTIONAL opencv_viz WRAP python java)

modules/structured_light/include/opencv2/structured_light/graycodepattern.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#define __OPENCV_GRAY_CODE_PATTERN_HPP__
4444

4545
#include "opencv2/core.hpp"
46+
#include "opencv2/structured_light/structured_light.hpp"
4647

4748
namespace cv {
4849
namespace structured_light {
@@ -72,22 +73,22 @@ class CV_EXPORTS_W GrayCodePattern : public StructuredLightPattern
7273
* @param width Projector's width. Default value is 1024.
7374
* @param height Projector's height. Default value is 768.
7475
*/
75-
struct CV_EXPORTS_W_SIMPLE Params
76+
struct CV_EXPORTS Params
7677
{
77-
CV_WRAP
7878
Params();
79-
CV_PROP_RW
8079
int width;
81-
CV_PROP_RW
8280
int height;
8381
};
8482

8583
/** @brief Constructor
8684
@param parameters GrayCodePattern parameters GrayCodePattern::Params: the width and the height of the projector.
8785
*/
88-
CV_WRAP
8986
static Ptr<GrayCodePattern> create( const GrayCodePattern::Params &parameters = GrayCodePattern::Params() );
9087

88+
// alias for scripting
89+
CV_WRAP
90+
static Ptr<GrayCodePattern> create( int width, int height );
91+
9192
/** @brief Get the number of pattern images needed for the graycode pattern.
9293
*
9394
* @return The number of pattern images needed for the graycode pattern.

modules/structured_light/src/graycodepattern.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,5 +471,15 @@ Ptr<GrayCodePattern> GrayCodePattern::create( const GrayCodePattern::Params& par
471471
return makePtr<GrayCodePattern_Impl>( params );
472472
}
473473

474+
// Creates the GrayCodePattern instance
475+
// alias for scripting
476+
Ptr<GrayCodePattern> GrayCodePattern::create( int width, int height )
477+
{
478+
Params params;
479+
params.width = width;
480+
params.height = height;
481+
return makePtr<GrayCodePattern_Impl>( params );
482+
}
483+
474484
}
475485
}

0 commit comments

Comments
 (0)