39 int id = rhs[0].toInt();
40 string method(rhs[1].toString());
43 if (method ==
"new") {
46 rhs[2].toString(), rhs.
begin() + 3, rhs.
end());
52 else if (method ==
"focalsFromHomography") {
62 "Estimated focal length along X-axis failed");
67 "Estimated focal length along Y-axis failed");
73 else if (method ==
"estimateFocal") {
82 else if (method ==
"calibrateRotatingCamera") {
97 "Calibrating rotating Camera failed");
106 if (method ==
"delete") {
111 else if (method ==
"typeid") {
113 plhs[0] =
MxArray(
string(
typeid(*obj).name()));
115 else if (method ==
"estimate") {
120 bool success = obj->operator()(features, pairwise_matches, cameras);
129 "Unrecognized operation %s", method.
c_str());
bool calibrateRotatingCamera(const std::vector< Mat > &Hs, Mat &K)
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>
cv::Ptr< cv::detail::Estimator > createEstimator(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of Estimator using options in arguments.
struct mxArray_tag mxArray
Forward declaration for mxArray.
MxArray toStruct(const std::vector< cv::ml::DTrees::Node > &nodes)
Convert tree nodes to struct array.
void focalsFromHomography(const Mat &H, double &f0, double &f1, bool &f0_ok, bool &f1_ok)
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.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
Global constant definitions.
int last_id
Last object id to allocate.
map< int, Ptr< Estimator > > obj_
Object container.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
void estimateFocal(const std::vector< ImageFeatures > &features, const std::vector< MatchesInfo > &pairwise_matches, std::vector< double > &focals)
std::vector< cv::detail::ImageFeatures > MxArrayToVectorImageFeatures(const MxArray &arr)
Convert MxArray std::vector<cv::details::ImageFeatures>