Merge pull request #679 from dharezlak:patch-1

pull/683/head
Maksim Shabunin 9 years ago
commit dc4c0bb0e2
  1. 2
      modules/structured_light/CMakeLists.txt
  2. 11
      modules/structured_light/include/opencv2/structured_light/graycodepattern.hpp
  3. 10
      modules/structured_light/src/graycodepattern.cpp

@ -1,2 +1,2 @@
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 @@
#define __OPENCV_GRAY_CODE_PATTERN_HPP__
#include "opencv2/core.hpp"
#include "opencv2/structured_light/structured_light.hpp"
namespace cv {
namespace structured_light {
@ -72,22 +73,22 @@ class CV_EXPORTS_W GrayCodePattern : public StructuredLightPattern
* @param width Projector's width. Default value is 1024.
* @param height Projector's height. Default value is 768.
*/
struct CV_EXPORTS_W_SIMPLE Params
struct CV_EXPORTS Params
{
CV_WRAP
Params();
CV_PROP_RW
int width;
CV_PROP_RW
int height;
};
/** @brief Constructor
@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() );
// 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.
*
* @return The number of pattern images needed for the graycode pattern.

@ -471,5 +471,15 @@ Ptr<GrayCodePattern> GrayCodePattern::create( const GrayCodePattern::Params& par
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 );
}
}
}

Loading…
Cancel
Save