38 int id = rhs[0].toInt();
39 string method(rhs[1].toString());
42 if (method ==
"new") {
45 rhs[2].toString(), rhs.
begin() + 3, rhs.
end());
51 else if (method ==
"waveCorrect") {
54 for (
int i=3; i<nrhs; i+=2) {
55 string key(rhs[i].toString());
60 "Unrecognized option %s", key.
c_str());
78 if (method ==
"delete") {
83 else if (method ==
"typeid") {
85 plhs[0] =
MxArray(
string(
typeid(*obj).name()));
87 else if (method ==
"refine") {
92 bool success = obj->operator()(features, pairwise_matches, cameras);
99 else if (method ==
"get") {
101 string prop(rhs[2].toString());
102 if (prop ==
"ConfThresh")
104 else if (prop ==
"RefinementMask")
106 else if (prop ==
"TermCriteria")
110 "Unrecognized property %s", prop.
c_str());
112 else if (method ==
"set") {
114 string prop(rhs[2].toString());
115 if (prop ==
"ConfThresh")
117 else if (prop ==
"RefinementMask")
119 else if (prop ==
"TermCriteria")
123 "Unrecognized property %s", prop.
c_str());
127 "Unrecognized operation %s", method.
c_str());
void waveCorrect(std::vector< Mat > &rmats, WaveCorrectKind kind)
Common definitions for the stitching module.
LIBMWMEX_API_EXTERN_C void mexLock(void)
Lock a MEX-function so that it cannot be cleared from memory.
std::vector< cv::detail::MatchesInfo > MxArrayToVectorMatchesInfo(const MxArray &arr)
Convert MxArray to std::vector<cv::details::MatchesInfo>
double confThresh() const
std::vector< cv::detail::CameraParams > MxArrayToVectorCameraParams(const MxArray &arr)
Convert MxArray to std::vector<cv::details::CameraParams>
struct mxArray_tag mxArray
Forward declaration for mxArray.
MxArray toStruct(const std::vector< cv::ml::DTrees::Node > &nodes)
Convert tree nodes to struct array.
int last_id
Last object id to allocate.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
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...
void setTermCriteria(const TermCriteria &term_criteria)
void setConfThresh(double conf_thresh)
LIBMWMEX_API_EXTERN_C void mexUnlock(void)
Unlock a locked MEX-function so that it can be cleared from memory.
void setRefinementMask(const Mat &mask)
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
const ConstMap< std::string, cv::detail::WaveCorrectKind > WaveCorrectionMap
wave correction kinds
Global constant definitions.
map< int, Ptr< BundleAdjusterBase > > obj_
Object container.
TermCriteria termCriteria()
std::vector< cv::detail::ImageFeatures > MxArrayToVectorImageFeatures(const MxArray &arr)
Convert MxArray std::vector<cv::details::ImageFeatures>
const Mat refinementMask() const
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.