Commit 4009fb64 authored by Vladislav Sovrasov's avatar Vladislav Sovrasov

structured light: wrap create method of the SinusoidalPattern class

parent 54d65f9d
...@@ -79,17 +79,17 @@ public: ...@@ -79,17 +79,17 @@ public:
* @param setMarkers Allow to set markers on the patterns. * @param setMarkers Allow to set markers on the patterns.
* @param markersLocation vector used to store markers location on the patterns. * @param markersLocation vector used to store markers location on the patterns.
*/ */
struct CV_EXPORTS Params struct CV_EXPORTS_W Params
{ {
Params(); CV_WRAP Params();
int width; CV_PROP_RW int width;
int height; CV_PROP_RW int height;
int nbrOfPeriods; CV_PROP_RW int nbrOfPeriods;
float shiftValue; CV_PROP_RW float shiftValue;
int methodId; CV_PROP_RW int methodId;
int nbrOfPixelsBetweenMarkers; CV_PROP_RW int nbrOfPixelsBetweenMarkers;
bool horizontal; CV_PROP_RW bool horizontal;
bool setMarkers; CV_PROP_RW bool setMarkers;
std::vector<Point2f> markersLocation; std::vector<Point2f> markersLocation;
}; };
/** /**
...@@ -97,8 +97,8 @@ public: ...@@ -97,8 +97,8 @@ public:
* @param parameters SinusoidalPattern parameters SinusoidalPattern::Params: width, height of the projector and patterns parameters. * @param parameters SinusoidalPattern parameters SinusoidalPattern::Params: width, height of the projector and patterns parameters.
* *
*/ */
static Ptr<SinusoidalPattern> create( const SinusoidalPattern::Params &parameters = CV_WRAP static Ptr<SinusoidalPattern> create( Ptr<SinusoidalPattern::Params> parameters =
SinusoidalPattern::Params() ); makePtr<SinusoidalPattern::Params>() );
/** /**
* @brief Compute a wrapped phase map from sinusoidal patterns. * @brief Compute a wrapped phase map from sinusoidal patterns.
* @param patternImages Input data to compute the wrapped phase map. * @param patternImages Input data to compute the wrapped phase map.
......
...@@ -103,7 +103,8 @@ int main(int argc, char **argv) ...@@ -103,7 +103,8 @@ int main(int argc, char **argv)
String outputUnwrappedPhasePath = parser.get<String>(9); String outputUnwrappedPhasePath = parser.get<String>(9);
String reliabilitiesPath = parser.get<String>(10); String reliabilitiesPath = parser.get<String>(10);
Ptr<structured_light::SinusoidalPattern> sinus = structured_light::SinusoidalPattern::create(params); Ptr<structured_light::SinusoidalPattern> sinus =
structured_light::SinusoidalPattern::create(makePtr<structured_light::SinusoidalPattern::Params>(params));
Ptr<phase_unwrapping::HistogramPhaseUnwrapping> phaseUnwrapping; Ptr<phase_unwrapping::HistogramPhaseUnwrapping> phaseUnwrapping;
vector<Mat> patterns; vector<Mat> patterns;
...@@ -332,4 +333,4 @@ int main(int argc, char **argv) ...@@ -332,4 +333,4 @@ int main(int argc, char **argv)
} }
} }
return 0; return 0;
} }
\ No newline at end of file
...@@ -911,9 +911,9 @@ void SinusoidalPatternProfilometry_Impl::convertToAbsolutePhaseMap( InputArrayOf ...@@ -911,9 +911,9 @@ void SinusoidalPatternProfilometry_Impl::convertToAbsolutePhaseMap( InputArrayOf
computeCorrespondEpilines(params.markersLocation, 2, fundamental, epilines); computeCorrespondEpilines(params.markersLocation, 2, fundamental, epilines);
} }
Ptr<SinusoidalPattern> SinusoidalPattern::create( const SinusoidalPattern::Params &params ) Ptr<SinusoidalPattern> SinusoidalPattern::create( Ptr<SinusoidalPattern::Params> params )
{ {
return makePtr<SinusoidalPatternProfilometry_Impl>(params); return makePtr<SinusoidalPatternProfilometry_Impl>(*params);
}
} }
} }
}
\ No newline at end of file
...@@ -54,10 +54,13 @@ TEST( SinusoidalPattern, unwrapPhaseMap ) ...@@ -54,10 +54,13 @@ TEST( SinusoidalPattern, unwrapPhaseMap )
{ {
string folder = cvtest::TS::ptr()->get_data_path() + "/" + STRUCTURED_LIGHT_DIR + "/" + FOLDER_DATA + "/"; string folder = cvtest::TS::ptr()->get_data_path() + "/" + STRUCTURED_LIGHT_DIR + "/" + FOLDER_DATA + "/";
structured_light::SinusoidalPattern::Params paramsPsp, paramsFtp, paramsFaps; Ptr<structured_light::SinusoidalPattern::Params> paramsPsp, paramsFtp, paramsFaps;
paramsFtp.methodId = 0; paramsPsp = makePtr<structured_light::SinusoidalPattern::Params>();
paramsPsp.methodId = 1; paramsFtp = makePtr<structured_light::SinusoidalPattern::Params>();
paramsFaps.methodId = 2; paramsFaps = makePtr<structured_light::SinusoidalPattern::Params>();
paramsFtp->methodId = 0;
paramsPsp->methodId = 1;
paramsFaps->methodId = 2;
Ptr<structured_light::SinusoidalPattern> sinusPsp = structured_light::SinusoidalPattern::create(paramsPsp); Ptr<structured_light::SinusoidalPattern> sinusPsp = structured_light::SinusoidalPattern::create(paramsPsp);
Ptr<structured_light::SinusoidalPattern> sinusFtp = structured_light::SinusoidalPattern::create(paramsFtp); Ptr<structured_light::SinusoidalPattern> sinusFtp = structured_light::SinusoidalPattern::create(paramsFtp);
......
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