Commit 4889ec5c authored by berak's avatar berak

structured_light: python / java bindings

parent 0c241990
set(the_description "Structured Light API") set(the_description "Structured Light API")
ocv_define_module(structured_light opencv_core opencv_calib3d opencv_imgproc opencv_highgui opencv_features2d opencv_rgbd OPTIONAL opencv_viz) ocv_define_module(structured_light opencv_core opencv_calib3d opencv_imgproc opencv_highgui opencv_features2d opencv_rgbd OPTIONAL opencv_viz WRAP python java)
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#define __OPENCV_GRAY_CODE_PATTERN_HPP__ #define __OPENCV_GRAY_CODE_PATTERN_HPP__
#include "opencv2/core.hpp" #include "opencv2/core.hpp"
#include "opencv2/structured_light/structured_light.hpp"
namespace cv { namespace cv {
namespace structured_light { namespace structured_light {
...@@ -72,22 +73,22 @@ class CV_EXPORTS_W GrayCodePattern : public StructuredLightPattern ...@@ -72,22 +73,22 @@ class CV_EXPORTS_W GrayCodePattern : public StructuredLightPattern
* @param width Projector's width. Default value is 1024. * @param width Projector's width. Default value is 1024.
* @param height Projector's height. Default value is 768. * @param height Projector's height. Default value is 768.
*/ */
struct CV_EXPORTS_W_SIMPLE Params struct CV_EXPORTS Params
{ {
CV_WRAP
Params(); Params();
CV_PROP_RW
int width; int width;
CV_PROP_RW
int height; int height;
}; };
/** @brief Constructor /** @brief Constructor
@param parameters GrayCodePattern parameters GrayCodePattern::Params: the width and the height of the projector. @param parameters GrayCodePattern parameters GrayCodePattern::Params: the width and the height of the projector.
*/ */
CV_WRAP
static Ptr<GrayCodePattern> create( const GrayCodePattern::Params &parameters = GrayCodePattern::Params() ); static Ptr<GrayCodePattern> create( const GrayCodePattern::Params &parameters = GrayCodePattern::Params() );
// alias for scripting
CV_WRAP
static Ptr<GrayCodePattern> create( int width, int height );
/** @brief Get the number of pattern images needed for the graycode pattern. /** @brief Get the number of pattern images needed for the graycode pattern.
* *
* @return The number of pattern images needed for the graycode pattern. * @return The number of pattern images needed for the graycode pattern.
......
...@@ -471,5 +471,15 @@ Ptr<GrayCodePattern> GrayCodePattern::create( const GrayCodePattern::Params& par ...@@ -471,5 +471,15 @@ Ptr<GrayCodePattern> GrayCodePattern::create( const GrayCodePattern::Params& par
return makePtr<GrayCodePattern_Impl>( params ); return makePtr<GrayCodePattern_Impl>( params );
} }
// Creates the GrayCodePattern instance
// alias for scripting
Ptr<GrayCodePattern> GrayCodePattern::create( int width, int height )
{
Params params;
params.width = width;
params.height = height;
return makePtr<GrayCodePattern_Impl>( params );
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment