Skip to content

Commit

Permalink
python binding for HistogramPhaseUnwrapping::Params to use HistogramP…
Browse files Browse the repository at this point in the history
…haseUnwrapping::create
  • Loading branch information
r2d3 committed Mar 12, 2020
1 parent 74e62b3 commit a275f8b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,28 +75,24 @@ class CV_EXPORTS_W HistogramPhaseUnwrapping : public PhaseUnwrapping
* @param nbrOfSmallBins Number of bins between 0 and "histThresh". Default value is 10.
* @param nbrOfLargeBins Number of bins between "histThresh" and 32*pi*pi (highest edge reliability value). Default value is 5.
*/
struct CV_EXPORTS Params
struct CV_EXPORTS_W_SIMPLE Params
{
Params();
int width;
int height;
float histThresh;
int nbrOfSmallBins;
int nbrOfLargeBins;
CV_WRAP Params();
CV_PROP_RW int width;
CV_PROP_RW int height;
CV_PROP_RW float histThresh;
CV_PROP_RW int nbrOfSmallBins;
CV_PROP_RW int nbrOfLargeBins;
};
/**
* @brief Constructor
* @param parameters HistogramPhaseUnwrapping parameters HistogramPhaseUnwrapping::Params: width,height of the phase map and histogram characteristics.
*/
CV_WRAP
static Ptr<HistogramPhaseUnwrapping> create( const HistogramPhaseUnwrapping::Params &parameters =
HistogramPhaseUnwrapping::Params() );

// alias for scripting
CV_WRAP
static Ptr<HistogramPhaseUnwrapping> create( int width, int height, float histThresh = static_cast<float>(3 * CV_PI * CV_PI),
int nbrOfSmallBins = 10, int nbrOfLargeBins = 5);

/**
* @brief Get the reliability map computed from the wrapped phase map.
Expand All @@ -109,4 +105,4 @@ class CV_EXPORTS_W HistogramPhaseUnwrapping : public PhaseUnwrapping
//! @}
}
}
#endif
#endif
12 changes: 0 additions & 12 deletions modules/phase_unwrapping/src/histogramphaseunwrapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,17 +782,5 @@ Ptr<HistogramPhaseUnwrapping> HistogramPhaseUnwrapping::create( const HistogramP
return makePtr<HistogramPhaseUnwrapping_Impl>(params);
}

Ptr<HistogramPhaseUnwrapping> HistogramPhaseUnwrapping::create( int width, int height, float histThresh,
int nbrOfSmallBins, int nbrOfLargeBins )
{
HistogramPhaseUnwrapping::Params params;
params.width = width;
params.height = height;
params.histThresh = histThresh;
params.nbrOfSmallBins = nbrOfSmallBins;
params.nbrOfLargeBins = nbrOfLargeBins;
return makePtr<HistogramPhaseUnwrapping_Impl>(params);
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#ifdef HAVE_OPENCV_STRUCTURED_LIGHT
typedef cv::phase_unwrapping::HistogramPhaseUnwrapping::Params HistogramPhaseUnwrapping_Params;
#endif

0 comments on commit a275f8b

Please sign in to comment.