46 int id = rhs[0].toInt();
47 string method(rhs[1].toString());
50 if (method ==
"new") {
51 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=1);
53 bool try_use_gpu =
false;
54 for (
int i=2; i<nrhs; i+=2) {
55 string key(rhs[i].toString());
57 mode =
ModesMap[rhs[i+1].toString()];
58 else if (key ==
"TryUseGPU")
59 try_use_gpu = rhs[i+1].toBool();
62 "Unrecognized option %s", key.
c_str());
74 if (method ==
"delete") {
79 else if (method ==
"stitch") {
80 nargchk((nrhs==3 || nrhs==4) && nlhs<=2);
88 &MxArray::toVector<Rect>)));
89 status = obj->
stitch(images, rois, pano);
92 status = obj->
stitch(images, pano);
100 else if (method ==
"estimateTransform") {
101 nargchk((nrhs==3 || nrhs==4) && nlhs<=1);
109 &MxArray::toVector<Rect>)));
120 else if (method ==
"composePanorama") {
121 nargchk((nrhs==2 || nrhs==3) && nlhs<=2);
137 else if (method ==
"setFeaturesFinder") {
140 rhs[2].toString(), rhs.
begin() + 3, rhs.
end());
143 else if (method ==
"setFeaturesMatcher") {
146 rhs[2].toString(), rhs.
begin() + 3, rhs.
end());
157 else if (method ==
"setBundleAdjuster") {
160 rhs[2].toString(), rhs.
begin() + 3, rhs.
end());
163 else if (method ==
"setWarper") {
166 rhs[2].toString(), rhs.
begin() + 3, rhs.
end());
169 else if (method ==
"setExposureCompensator") {
172 rhs[2].toString(), rhs.
begin() + 3, rhs.
end());
175 else if (method ==
"setSeamFinder") {
178 rhs[2].toString(), rhs.
begin() + 3, rhs.
end());
181 else if (method ==
"setBlender") {
184 rhs[2].toString(), rhs.
begin() + 3, rhs.
end());
187 else if (method ==
"getFeaturesFinder") {
192 else if (method ==
"getFeaturesMatcher") {
204 else if (method ==
"getBundleAdjuster") {
209 else if (method ==
"getWarper") {
214 else if (method ==
"getExposureCompensator") {
219 else if (method ==
"getSeamFinder") {
224 else if (method ==
"getBlender") {
229 else if (method ==
"component") {
234 else if (method ==
"cameras") {
239 else if (method ==
"workScale") {
244 else if (method ==
"getMatchingMask") {
249 else if (method ==
"setMatchingMask") {
254 else if (method ==
"get") {
256 string prop(rhs[2].toString());
257 if (prop ==
"RegistrationResol")
259 else if (prop ==
"SeamEstimationResol")
261 else if (prop ==
"CompositingResol")
263 else if (prop ==
"PanoConfidenceThresh")
265 else if (prop ==
"WaveCorrection")
267 else if (prop ==
"WaveCorrectKind")
271 "Unrecognized property %s", prop.
c_str());
273 else if (method ==
"set") {
275 string prop(rhs[2].toString());
276 if (prop ==
"RegistrationResol")
278 else if (prop ==
"SeamEstimationResol")
280 else if (prop ==
"CompositingResol")
283 else if (prop ==
"PanoConfidenceThresh")
285 else if (prop ==
"WaveCorrection")
287 else if (prop ==
"WaveCorrectKind")
291 "Unrecognized property %s", prop.
c_str());
295 "Unrecognized operation %s", method.
c_str());
cv::Ptr< cv::detail::FeaturesFinder > createFeaturesFinder(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of FeaturesFinder using options in arguments.
void setPanoConfidenceThresh(double conf_thresh)
const ConstMap< cv::detail::WaveCorrectKind, std::string > WaveCorrectionInvMap
inverse wave correction kinds
void setFeaturesFinder(Ptr< detail::FeaturesFinder > features_finder)
Common definitions for the stitching module.
void setWarper(Ptr< WarperCreator > creator)
LIBMWMEX_API_EXTERN_C void mexLock(void)
Lock a MEX-function so that it cannot be cleared from memory.
void setBlender(Ptr< detail::Blender > b)
cv::Ptr< cv::detail::ExposureCompensator > createExposureCompensator(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of ExposureCompensator using options in arguments.
Ptr< detail::Blender > blender()
double registrationResol() const
const ConstMap< string, Stitcher::Mode > ModesMap
stitching mode types
Ptr< detail::SeamFinder > seamFinder()
void setSeamEstimationResol(double resol_mpx)
void setSeamFinder(Ptr< detail::SeamFinder > seam_finder)
void setCompositingResol(double resol_mpx)
Status estimateTransform(InputArrayOfArrays images)
struct mxArray_tag mxArray
Forward declaration for mxArray.
void setMatchingMask(const cv::UMat &mask)
cv::Ptr< cv::detail::Blender > createBlender(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of Blender using options in arguments.
const ConstMap< string, int > ComposeResolMap
compositing resolution types
bool waveCorrection() const
MxArray toStruct(const std::vector< cv::ml::DTrees::Node > &nodes)
Convert tree nodes to struct array.
Mat getMat(int flags) const
Ptr< detail::ExposureCompensator > exposureCompensator()
Ptr< detail::FeaturesFinder > featuresFinder()
cv::Ptr< cv::detail::SeamFinder > createSeamFinder(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of SeamFinder using options in arguments.
std::vector< int > component() const
void setBundleAdjuster(Ptr< detail::BundleAdjusterBase > bundle_adjuster)
int last_id
Last object id to allocate.
LIBMWMEX_API_EXTERN_C void mexErrMsgIdAndTxt(const char *identifier, const char *err_msg,...)
Issue formatted error message with corresponding error identifier and return to MATLAB prompt...
LIBMWMEX_API_EXTERN_C void mexUnlock(void)
Unlock a locked MEX-function so that it can be cleared from memory.
double panoConfidenceThresh() const
mxArray object wrapper for data conversion and manipulation.
Status stitch(InputArrayOfArrays images, OutputArray pano)
void nargchk(bool cond)
Alias for input/output arguments number check.
void setWaveCorrection(bool flag)
const ConstMap< std::string, cv::detail::WaveCorrectKind > WaveCorrectionMap
wave correction kinds
cv::Ptr< cv::WarperCreator > createWarperCreator(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of WarperCreator using options in arguments.
void setFeaturesMatcher(Ptr< detail::FeaturesMatcher > features_matcher)
Global constant definitions.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
double compositingResol() const
Status composePanorama(OutputArray pano)
void setExposureCompensator(Ptr< detail::ExposureCompensator > exposure_comp)
Ptr< detail::BundleAdjusterBase > bundleAdjuster()
Ptr< detail::FeaturesMatcher > featuresMatcher()
std::vector< detail::CameraParams > cameras() const
UMat getUMat(int accessFlags, UMatUsageFlags usageFlags=USAGE_DEFAULT) const
const cv::UMat & matchingMask() const
double seamEstimationResol() const
std::map wrapper with one-line initialization and lookup method.
Ptr< WarperCreator > warper()
void setRegistrationResol(double resol_mpx)
cv::Ptr< cv::detail::FeaturesMatcher > createFeaturesMatcher(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of FeaturesMatcher using options in arguments.
detail::WaveCorrectKind waveCorrectKind() const
void create(int arows, int acols, int atype, Target target=ARRAY_BUFFER, bool autoRelease=false)
cv::Ptr< cv::detail::BundleAdjusterBase > createBundleAdjusterBase(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of BundleAdjusterBase using options in arguments.
map< int, Ptr< Stitcher > > obj_
Object container.
const ConstMap< cv::Stitcher::Status, std::string > StitcherStatusInvMap
Stitcher error status types.
void setWaveCorrectKind(detail::WaveCorrectKind kind)