36 int id = rhs[0].toInt();
37 string method(rhs[1].toString());
40 if (method ==
"new") {
41 nargchk(nrhs>=4 && (nrhs%2)==0 && nlhs<=1);
43 for (
int i=4; i<nrhs; i+=2) {
44 string key(rhs[i].toString());
45 if (key ==
"DetectionSizes")
46 detectionSizes = rhs[i+1].toVector<
Size>();
49 "Unrecognized option %s", key.
c_str());
51 string modelArchFilename(rhs[2].toString()),
52 modelWeightsFilename(rhs[3].toString());
54 modelArchFilename, modelWeightsFilename, detectionSizes);
64 if (method ==
"delete") {
69 else if (method ==
"detect") {
74 obj->
detect(inputImage, bbox, confidence);
81 "Unrecognized operation %s", method.
c_str());
map< int, Ptr< TextDetectorCNN > > obj_
Object container.
int last_id
Last object id to allocate.
LIBMWMEX_API_EXTERN_C void mexLock(void)
Lock a MEX-function so that it cannot be cleared from memory.
struct mxArray_tag mxArray
Forward declaration for mxArray.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
virtual void detect(InputArray inputImage, std::vector< Rect > &Bbox, std::vector< float > &confidence)=0
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.
void create(int arows, int acols, int atype, Target target=ARRAY_BUFFER, bool autoRelease=false)