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