static char mc_version[] = "MATLAB Compiler 1.2 Jan 17 1998 infun"; /* * MATLAB Compiler: 1.2 * Date: Jan 17 1998 * Arguments: vision_engine_b */ #ifndef ARRAY_ACCESS_INLINING #error You must use the -inline option when compiling MATLAB compiler generated code with MEX or MBUILD #endif #ifndef MATLAB_COMPILER_GENERATED_CODE #define MATLAB_COMPILER_GENERATED_CODE #endif #include #include "mex.h" #include "mcc.h" static void vision_engine_b_color_b(mxArray *, mxArray *); /* static array S0_ (3 x 3) int, line 74 */ static int S0r_[] = { 2, 1, 8, 3, 0, 7, 4, 5, 6, }; static mxArray S0_ = mccCINIT( mccINT, 3, 3, S0r_, 0 ); /* static array S1_ (1 x 3) int, line 76 */ static int S1r_[] = { -1, 0, 1, }; static mxArray S1_ = mccCINIT( mccINT, 1, 3, S1r_, 0 ); /* static array S2_ (8 x 2) int, line 78 */ static int S2r_[] = { 0, -1, -1, -1, 0, 1, 1, 1, -1, -1, 0, 1, 1, 1, 0, -1, }; static mxArray S2_ = mccCINIT( mccINT, 8, 2, S2r_, 0 ); /* static array S3_ (1 x 2) int, line 89 */ static int S3r_[] = { 1, 1, }; static mxArray S3_ = mccCINIT( mccINT, 1, 2, S3r_, 0 ); /* static array S4_ (1 x 5) text, line 12: 'close' */ static unsigned short S4__r_[] = { 99, 108, 111, 115, 101, }; static mxArray S4_ = mccCINIT( mccTEXT, 1, 5, S4__r_, 0); /* static array S5_ (1 x 4) text, line 13: 'fill' */ static unsigned short S5__r_[] = { 102, 105, 108, 108, }; static mxArray S5_ = mccCINIT( mccTEXT, 1, 4, S5__r_, 0); /* static array S6_ (1 x 4) text, line 14: 'spur' */ static unsigned short S6__r_[] = { 115, 112, 117, 114, }; static mxArray S6_ = mccCINIT( mccTEXT, 1, 4, S6__r_, 0); /* static array S7_ (1 x 5) text, line 15: 'clean' */ static unsigned short S7__r_[] = { 99, 108, 101, 97, 110, }; static mxArray S7_ = mccCINIT( mccTEXT, 1, 5, S7__r_, 0); /* static array S8_ (1 x 50) text, line 38: 'number of topological com...' */ static unsigned short S8__r_[] = { 110, 117, 109, 98, 101, 114, 32, 111, 102, 32, 116, 111, 112, 111, 108, 111, 103, 105, 99, 97, 108, 32, 99, 111, 109, 112, 111, 110, 101, 110, 116, 115, 32, 105, 110, 32, 111, 98, 115, 101, 114, 118, 101, 100, 32, 105, 109, 97, 103, 101, }; static mxArray S8_ = mccCINIT( mccTEXT, 1, 50, S8__r_, 0); /* static array S9_ (1 x 4) text, line 49: 'spur' */ static unsigned short S9__r_[] = { 115, 112, 117, 114, }; static mxArray S9_ = mccCINIT( mccTEXT, 1, 4, S9__r_, 0); /* static array S10_ (1 x 5) text, line 54: 'image' */ static unsigned short S10__r_[] = { 105, 109, 97, 103, 101, }; static mxArray S10_ = mccCINIT( mccTEXT, 1, 5, S10__r_, 0); /* static array S11_ (1 x 14) text, line 55: 'OBSERVED IMAGE' */ static unsigned short S11__r_[] = { 79, 66, 83, 69, 82, 86, 69, 68, 32, 73, 77, 65, 71, 69, }; static mxArray S11_ = mccCINIT( mccTEXT, 1, 14, S11__r_, 0); /* static array S12_ (1 x 5) text, line 59: 'image' */ static unsigned short S12__r_[] = { 105, 109, 97, 103, 101, }; static mxArray S12_ = mccCINIT( mccTEXT, 1, 5, S12__r_, 0); /* static array S13_ (1 x 13) text, line 60: 'CURRENT FOVEA' */ static unsigned short S13__r_[] = { 67, 85, 82, 82, 69, 78, 84, 32, 70, 79, 86, 69, 65, }; static mxArray S13_ = mccCINIT( mccTEXT, 1, 13, S13__r_, 0); /* static array S14_ (1 x 22) text, line 64: 'Please wait a while...' */ static unsigned short S14__r_[] = { 80, 108, 101, 97, 115, 101, 32, 119, 97, 105, 116, 32, 97, 32, 119, 104, 105, 108, 101, 46, 46, 46, }; static mxArray S14_ = mccCINIT( mccTEXT, 1, 22, S14__r_, 0); /* static array S15_ (1 x 23) text, line 117: 'chaincoding boundary...' */ static unsigned short S15__r_[] = { 99, 104, 97, 105, 110, 99, 111, 100, 105, 110, 103, 32, 98, 111, 117, 110, 100, 97, 114, 121, 46, 46, 46, }; static mxArray S15_ = mccCINIT( mccTEXT, 1, 23, S15__r_, 0); /* static array S16_ (1 x 22) text, line 166: 'computing curvature...' */ static unsigned short S16__r_[] = { 99, 111, 109, 112, 117, 116, 105, 110, 103, 32, 99, 117, 114, 118, 97, 116, 117, 114, 101, 46, 46, 46, }; static mxArray S16_ = mccCINIT( mccTEXT, 1, 22, S16__r_, 0); /* static array S17_ (1 x 33) text, line 206: 'dynamic programming, back...' */ static unsigned short S17__r_[] = { 100, 121, 110, 97, 109, 105, 99, 32, 112, 114, 111, 103, 114, 97, 109, 109, 105, 110, 103, 44, 32, 98, 97, 99, 107, 119, 97, 114, 100, 115, 46, 46, 46, }; static mxArray S17_ = mccCINIT( mccTEXT, 1, 33, S17__r_, 0); /* static array S18_ (1 x 148) text, line 228: 'Function zeros being call...' */ static unsigned short S18__r_[] = { 70, 117, 110, 99, 116, 105, 111, 110, 32, 122, 101, 114, 111, 115, 32, 98, 101, 105, 110, 103, 32, 99, 97, 108, 108, 101, 100, 32, 105, 110, 99, 111, 114, 114, 101, 99, 116, 108, 121, 46, 32, 32, 69, 105, 116, 104, 101, 114, 32, 116, 111, 111, 32, 109, 97, 110, 121, 32, 105, 110, 112, 117, 116, 32, 111, 114, 32, 111, 117, 116, 112, 117, 116, 32, 97, 114, 103, 117, 109, 101, 110, 116, 115, 32, 97, 114, 101, 32, 98, 101, 105, 110, 103, 32, 112, 97, 115, 115, 101, 100, 32, 111, 114, 32, 116, 104, 101, 32, 97, 114, 103, 117, 109, 101, 110, 116, 115, 32, 97, 114, 101, 32, 105, 110, 118, 97, 108, 105, 100, 32, 102, 111, 114, 32, 116, 104, 105, 115, 32, 102, 117, 110, 99, 116, 105, 111, 110, 46, }; static mxArray S18_ = mccCINIT( mccTEXT, 1, 148, S18__r_, 0); /* static array S19_ (1 x 28) text, line 267: 'dynamic programming, forw...' */ static unsigned short S19__r_[] = { 100, 121, 110, 97, 109, 105, 99, 32, 112, 114, 111, 103, 114, 97, 109, 109, 105, 110, 103, 44, 32, 102, 111, 114, 119, 97, 114, 100, }; static mxArray S19_ = mccCINIT( mccTEXT, 1, 28, S19__r_, 0); /* static array S20_ (1 x 15) text, line 295: 'Recognized arcs' */ static unsigned short S20__r_[] = { 82, 101, 99, 111, 103, 110, 105, 122, 101, 100, 32, 97, 114, 99, 115, }; static mxArray S20_ = mccCINIT( mccTEXT, 1, 15, S20__r_, 0); /* static array S21_ (1 x 5) text, line 296: 'image' */ static unsigned short S21__r_[] = { 105, 109, 97, 103, 101, }; static mxArray S21_ = mccCINIT( mccTEXT, 1, 5, S21__r_, 0); /* static array S22_ (1 x 5) text, line 302: 'image' */ static unsigned short S22__r_[] = { 105, 109, 97, 103, 101, }; static mxArray S22_ = mccCINIT( mccTEXT, 1, 5, S22__r_, 0); /* static array S23_ (1 x 29) text, line 303: 'Estimated deformation of ...' */ static unsigned short S23__r_[] = { 69, 115, 116, 105, 109, 97, 116, 101, 100, 32, 100, 101, 102, 111, 114, 109, 97, 116, 105, 111, 110, 32, 111, 102, 32, 97, 114, 99, 115, }; static mxArray S23_ = mccCINIT( mccTEXT, 1, 29, S23__r_, 0); /* static array S24_ (3 x 3) int, line 74 */ static int S24r_[] = { 2, 1, 8, 3, 0, 7, 4, 5, 6, }; static mxArray S24_ = mccCINIT( mccINT, 3, 3, S24r_, 0 ); /* static array S25_ (1 x 3) int, line 76 */ static int S25r_[] = { -1, 0, 1, }; static mxArray S25_ = mccCINIT( mccINT, 1, 3, S25r_, 0 ); /* static array S26_ (8 x 2) int, line 78 */ static int S26r_[] = { 0, -1, -1, -1, 0, 1, 1, 1, -1, -1, 0, 1, 1, 1, 0, -1, }; static mxArray S26_ = mccCINIT( mccINT, 8, 2, S26r_, 0 ); /* static array S27_ (1 x 2) int, line 89 */ static int S27r_[] = { 1, 1, }; static mxArray S27_ = mccCINIT( mccINT, 1, 2, S27r_, 0 ); /* static array S28_ (1 x 5) text, line 12: 'close' */ static unsigned short S28__r_[] = { 99, 108, 111, 115, 101, }; static mxArray S28_ = mccCINIT( mccTEXT, 1, 5, S28__r_, 0); /* static array S29_ (1 x 4) text, line 13: 'fill' */ static unsigned short S29__r_[] = { 102, 105, 108, 108, }; static mxArray S29_ = mccCINIT( mccTEXT, 1, 4, S29__r_, 0); /* static array S30_ (1 x 4) text, line 14: 'spur' */ static unsigned short S30__r_[] = { 115, 112, 117, 114, }; static mxArray S30_ = mccCINIT( mccTEXT, 1, 4, S30__r_, 0); /* static array S31_ (1 x 5) text, line 15: 'clean' */ static unsigned short S31__r_[] = { 99, 108, 101, 97, 110, }; static mxArray S31_ = mccCINIT( mccTEXT, 1, 5, S31__r_, 0); /* static array S32_ (1 x 50) text, line 38: 'number of topological com...' */ static unsigned short S32__r_[] = { 110, 117, 109, 98, 101, 114, 32, 111, 102, 32, 116, 111, 112, 111, 108, 111, 103, 105, 99, 97, 108, 32, 99, 111, 109, 112, 111, 110, 101, 110, 116, 115, 32, 105, 110, 32, 111, 98, 115, 101, 114, 118, 101, 100, 32, 105, 109, 97, 103, 101, }; static mxArray S32_ = mccCINIT( mccTEXT, 1, 50, S32__r_, 0); /* static array S33_ (1 x 4) text, line 49: 'spur' */ static unsigned short S33__r_[] = { 115, 112, 117, 114, }; static mxArray S33_ = mccCINIT( mccTEXT, 1, 4, S33__r_, 0); /* static array S34_ (1 x 5) text, line 54: 'image' */ static unsigned short S34__r_[] = { 105, 109, 97, 103, 101, }; static mxArray S34_ = mccCINIT( mccTEXT, 1, 5, S34__r_, 0); /* static array S35_ (1 x 14) text, line 55: 'OBSERVED IMAGE' */ static unsigned short S35__r_[] = { 79, 66, 83, 69, 82, 86, 69, 68, 32, 73, 77, 65, 71, 69, }; static mxArray S35_ = mccCINIT( mccTEXT, 1, 14, S35__r_, 0); /* static array S36_ (1 x 5) text, line 59: 'image' */ static unsigned short S36__r_[] = { 105, 109, 97, 103, 101, }; static mxArray S36_ = mccCINIT( mccTEXT, 1, 5, S36__r_, 0); /* static array S37_ (1 x 13) text, line 60: 'CURRENT FOVEA' */ static unsigned short S37__r_[] = { 67, 85, 82, 82, 69, 78, 84, 32, 70, 79, 86, 69, 65, }; static mxArray S37_ = mccCINIT( mccTEXT, 1, 13, S37__r_, 0); /* static array S38_ (1 x 22) text, line 64: 'Please wait a while...' */ static unsigned short S38__r_[] = { 80, 108, 101, 97, 115, 101, 32, 119, 97, 105, 116, 32, 97, 32, 119, 104, 105, 108, 101, 46, 46, 46, }; static mxArray S38_ = mccCINIT( mccTEXT, 1, 22, S38__r_, 0); /* static array S39_ (1 x 23) text, line 117: 'chaincoding boundary...' */ static unsigned short S39__r_[] = { 99, 104, 97, 105, 110, 99, 111, 100, 105, 110, 103, 32, 98, 111, 117, 110, 100, 97, 114, 121, 46, 46, 46, }; static mxArray S39_ = mccCINIT( mccTEXT, 1, 23, S39__r_, 0); /* static array S40_ (1 x 22) text, line 166: 'computing curvature...' */ static unsigned short S40__r_[] = { 99, 111, 109, 112, 117, 116, 105, 110, 103, 32, 99, 117, 114, 118, 97, 116, 117, 114, 101, 46, 46, 46, }; static mxArray S40_ = mccCINIT( mccTEXT, 1, 22, S40__r_, 0); /* static array S41_ (1 x 33) text, line 206: 'dynamic programming, back...' */ static unsigned short S41__r_[] = { 100, 121, 110, 97, 109, 105, 99, 32, 112, 114, 111, 103, 114, 97, 109, 109, 105, 110, 103, 44, 32, 98, 97, 99, 107, 119, 97, 114, 100, 115, 46, 46, 46, }; static mxArray S41_ = mccCINIT( mccTEXT, 1, 33, S41__r_, 0); /* static array S42_ (1 x 148) text, line 228: 'Function zeros being call...' */ static unsigned short S42__r_[] = { 70, 117, 110, 99, 116, 105, 111, 110, 32, 122, 101, 114, 111, 115, 32, 98, 101, 105, 110, 103, 32, 99, 97, 108, 108, 101, 100, 32, 105, 110, 99, 111, 114, 114, 101, 99, 116, 108, 121, 46, 32, 32, 69, 105, 116, 104, 101, 114, 32, 116, 111, 111, 32, 109, 97, 110, 121, 32, 105, 110, 112, 117, 116, 32, 111, 114, 32, 111, 117, 116, 112, 117, 116, 32, 97, 114, 103, 117, 109, 101, 110, 116, 115, 32, 97, 114, 101, 32, 98, 101, 105, 110, 103, 32, 112, 97, 115, 115, 101, 100, 32, 111, 114, 32, 116, 104, 101, 32, 97, 114, 103, 117, 109, 101, 110, 116, 115, 32, 97, 114, 101, 32, 105, 110, 118, 97, 108, 105, 100, 32, 102, 111, 114, 32, 116, 104, 105, 115, 32, 102, 117, 110, 99, 116, 105, 111, 110, 46, }; static mxArray S42_ = mccCINIT( mccTEXT, 1, 148, S42__r_, 0); /* static array S43_ (1 x 28) text, line 267: 'dynamic programming, forw...' */ static unsigned short S43__r_[] = { 100, 121, 110, 97, 109, 105, 99, 32, 112, 114, 111, 103, 114, 97, 109, 109, 105, 110, 103, 44, 32, 102, 111, 114, 119, 97, 114, 100, }; static mxArray S43_ = mccCINIT( mccTEXT, 1, 28, S43__r_, 0); /* static array S44_ (1 x 15) text, line 295: 'Recognized arcs' */ static unsigned short S44__r_[] = { 82, 101, 99, 111, 103, 110, 105, 122, 101, 100, 32, 97, 114, 99, 115, }; static mxArray S44_ = mccCINIT( mccTEXT, 1, 15, S44__r_, 0); /* static array S45_ (1 x 5) text, line 296: 'image' */ static unsigned short S45__r_[] = { 105, 109, 97, 103, 101, }; static mxArray S45_ = mccCINIT( mccTEXT, 1, 5, S45__r_, 0); /* static array S46_ (1 x 5) text, line 302: 'image' */ static unsigned short S46__r_[] = { 105, 109, 97, 103, 101, }; static mxArray S46_ = mccCINIT( mccTEXT, 1, 5, S46__r_, 0); /* static array S47_ (1 x 29) text, line 303: 'Estimated deformation of ...' */ static unsigned short S47__r_[] = { 69, 115, 116, 105, 109, 97, 116, 101, 100, 32, 100, 101, 102, 111, 114, 109, 97, 116, 105, 111, 110, 32, 111, 102, 32, 97, 114, 99, 115, }; static mxArray S47_ = mccCINIT( mccTEXT, 1, 29, S47__r_, 0); /* static array S48_ (1 x 2) text, line 392: 'on' */ static unsigned short S48__r_[] = { 111, 110, }; static mxArray S48_ = mccCINIT( mccTEXT, 1, 2, S48__r_, 0); /* static array S49_ (1 x 3) text, line 394: 'off' */ static unsigned short S49__r_[] = { 111, 102, 102, }; static mxArray S49_ = mccCINIT( mccTEXT, 1, 3, S49__r_, 0); /***************** Compiler Assumptions **************** * * B complex vector/matrix * BC complex vector/matrix * BM0_ boolean vector/matrix temporary * BM1_ boolean vector/matrix temporary * BM2_ boolean vector/matrix temporary * BM3_ boolean vector/matrix temporary * Bframe complex vector/matrix * C0_ complex scalar temporary * C1_ complex scalar temporary * C2_ complex scalar temporary * C3_ complex scalar temporary * CM0_ complex vector/matrix temporary * CM1_ complex vector/matrix temporary * CM2_ complex vector/matrix temporary * CM3_ complex vector/matrix temporary * CM4_ complex vector/matrix temporary * CM5_ complex vector/matrix temporary * CM6_ complex vector/matrix temporary * I boolean vector/matrix * I0_ integer scalar temporary * I1_ integer scalar temporary * I2_ integer scalar temporary * I3_ integer scalar temporary * ID real vector/matrix * ID complex vector/matrix => ID_1 * IM0_ integer vector/matrix temporary * IM1_ integer vector/matrix temporary * IM2_ integer vector/matrix temporary * IM3_ integer vector/matrix temporary * I complex vector/matrix => I_1 * Itemps complex vector/matrix * M integer vector/matrix * M complex vector/matrix => M_1 * Neigh complex vector/matrix * R0_ real scalar temporary * R1_ real scalar temporary * RM0_ real vector/matrix temporary * RM1_ real vector/matrix temporary * RM2_ real vector/matrix temporary * RM3_ real vector/matrix temporary * RM4_ real vector/matrix temporary * RM5_ real vector/matrix temporary * S0_ * S1_ * S2_ * S3_ * U complex vector/matrix * V complex vector/matrix * W integer vector/matrix * Y integer vector/matrix * Z complex vector/matrix * a real scalar * a real vector/matrix => a_1 * abs * alpha integer scalar * alphas integer vector/matrix * analysis integer vector/matrix * any * asin * attention integer vector/matrix * axis * b real vector/matrix * bwlabel * bwmorph * bwperim * c1 complex vector/matrix * chaincode complex vector/matrix * close * code complex vector/matrix * colindex integer vector/matrix * compnumber integer scalar * cost complex vector/matrix * cost1 complex vector/matrix * cuml real vector/matrix * cumsum * d integer scalar * diffs real vector/matrix * dl integer scalar * double * dphis complex vector/matrix * elastc real scalar * error * fft * floor * fovea boolean vector/matrix * i integer scalar * i integer vector/matrix => i_1 * ifft * image * incr integer vector/matrix * jumpc real scalar * kron * l integer scalar * l1 integer scalar * l2 integer scalar * labels complex vector/matrix * length * lengths real vector/matrix * m real scalar * m integer vector/matrix => m_1 * max * maxatt integer vector/matrix * min * mod * n integer scalar * n integer vector/matrix => n_1 * nalpha integer scalar * ncomp integer scalar * next integer vector/matrix * norm * off integer vector/matrix * ones * p real scalar * pause * pi * plot * r complex scalar * real * reshape * rhos complex vector/matrix * rowindex integer vector/matrix * size * spline * sqrt * start integer vector/matrix * sum * t integer scalar * t1 integer scalar * templs complex vector/matrix * title * tmax integer scalar * ts integer vector/matrix * u complex vector/matrix * u integer vector/matrix => u_1 * uhat complex vector/matrix * v boolean vector/matrix * v real vector/matrix => v_1 * v integer vector/matrix => v_2 * vision_engine_b * vision_engine_b/color_b * w complex vector/matrix * x real scalar * x1shat complex vector/matrix * x2shat complex vector/matrix * x complex vector/matrix => x_1 * xs real vector/matrix * y real scalar * y1 real vector/matrix * y2 real vector/matrix * y complex scalar => y_1 * y complex vector/matrix => y_2 * ys real vector/matrix * zeros *******************************************************/ void mexFunction( int nlhs_, mxArray *plhs_[], int nrhs_, const mxArray *prhs_[] ) { int ci_; int i_; mxArray *Mplhs_[3]; mxArray *Mprhs_[17]; if (nrhs_ > 3 ) { mexErrMsgTxt( "Too many input arguments." ); } if (nlhs_ > 6 ) { mexErrMsgTxt( "Too many output arguments." ); } for (ci_=i_=0; i_0) ? prhs_[0] : 0), 0, 0); mccComplexInit(Itemps); mccImport(&Itemps, ((nrhs_>1) ? prhs_[1] : 0), 0, 0); mccComplexInit(templs); mccImport(&templs, ((nrhs_>2) ? prhs_[2] : 0), 0, 0); mccComplexInit(B); mccComplexInit(BC); mccComplexInit(rhos); mccIntInit(analysis); mccRealInit(xs); mccRealInit(ys); mccBoolInit(I); mccComplexInit(I_1); mccComplexInit(labels); mccIntInit(attention); mccIntInit(maxatt); mccIntInit(i_1); mccBoolInit(fovea); mccBoolInit(v); mccIntInit(Y); mccIntInit(colindex); mccComplexInit(Z); mccIntInit(rowindex); mccIntInit(start); mccIntInit(W); mccIntInit(off); mccIntInit(incr); mccComplexInit(Bframe); mccComplexInit(Neigh); mccComplexInit(chaincode); mccComplexInit(code); mccIntInit(next); mccRealInit(v_1); mccComplexInit(w); mccComplexInit(u); mccComplexInit(uhat); mccComplexInit(x1shat); mccComplexInit(x2shat); mccRealInit(lengths); mccRealInit(cuml); mccComplexInit(dphis); mccRealInit(a_1); mccRealInit(b); mccRealInit(M_y1); mccRealInit(y2); mccIntInit(alphas); mccIntInit(ts); mccIntInit(M); mccComplexInit(ID_1); mccIntInit(u_1); mccIntInit(v_2); mccRealInit(diffs); mccComplexInit(M_1); mccComplexInit(x_1); mccIntInit(m_1); mccIntInit(n_1); mccComplexInit(cost); mccComplexInit(cost1); mccComplexInit(c1); mccComplexInit(U); mccComplexInit(V); mccComplexInit(y_2); mccComplexInit(CM0_); mccComplexInit(CM1_); mccBoolInit(BM0_); mccIntInit(IM0_); mccIntInit(IM1_); mccComplexInit(CM2_); mccIntInit(IM2_); mccIntInit(IM3_); mccRealInit(RM0_); mccRealInit(RM1_); mccComplexInit(CM3_); mccComplexInit(CM4_); mccRealInit(RM2_); mccRealInit(RM3_); mccRealInit(RM4_); mccRealInit(RM5_); mccBoolInit(BM1_); mccBoolInit(BM2_); mccBoolInit(BM3_); mccComplexInit(CM5_); mccComplexInit(CM6_); /* % executes inference engine in Strategies for Seeing, Experiment 2 */ /* % where generators are arcs */ /* % ID=oberved image */ /* % Itemps =matrix of templates extended periodically to length tmax */ /* % templs =vector of template lengths */ /* % 1.ENTER. */ /* % make image binary by thresholding */ /* I=ID>200; */ if(mccNOTSET(&ID)) { mexErrMsgTxt( "variable ID undefined, line 10" ); } { int i_, j_; int m_=1, n_=1, cx_ = 0; unsigned short *p_I; int I_I=1; double *p_ID; int I_ID=1; m_ = mcmCalcResultSize(m_, &n_, mccM(&ID), mccN(&ID)); mccAllocateMatrix(&I, m_, n_); I_I = (mccM(&I) != 1 || mccN(&I) != 1); p_I = mccSPR(&I); I_ID = (mccM(&ID) != 1 || mccN(&ID) != 1); p_ID = mccPR(&ID); if (m_ != 0) { for (j_=0; j_ 200) && !mccREL_NAN(*p_ID) ); } } } } /* % regularize image */ /* I=bwmorph(I,'close'); */ Mprhs_[0] = &I; Mprhs_[1] = &S4_; Mplhs_[0] = &I_1; mccCallMATLAB(1, Mplhs_, 2, Mprhs_, "bwmorph", 12); /* I=bwmorph(I,'fill'); */ Mprhs_[0] = &I_1; Mprhs_[1] = &S5_; Mplhs_[0] = &I_1; mccCallMATLAB(1, Mplhs_, 2, Mprhs_, "bwmorph", 13); /* I=bwmorph(I,'spur'); */ Mprhs_[0] = &I_1; Mprhs_[1] = &S6_; Mplhs_[0] = &I_1; mccCallMATLAB(1, Mplhs_, 2, Mprhs_, "bwmorph", 14); /* I=bwmorph(I,'clean'); */ Mprhs_[0] = &I_1; Mprhs_[1] = &S7_; Mplhs_[0] = &I_1; mccCallMATLAB(1, Mplhs_, 2, Mprhs_, "bwmorph", 15); /* I=double(I); */ Mprhs_[0] = &I_1; Mplhs_[0] = &I_1; mccCallMATLAB(1, Mplhs_, 1, Mprhs_, "double", 16); /* % opening frames */ /* % page1 */ /* % pause(1) */ /* % close */ /* % page2 */ /* % pause(1) */ /* % close */ /* % page3b */ /* % pause(1) */ /* % close */ /* % 2. SACCADIC SEARCH FOR FOVEAS */ /* % find the ncomp topological components and their sizes */ /* labels=bwlabel(I); */ Mprhs_[0] = &I_1; Mplhs_[0] = &labels; mccCallMATLAB(1, Mplhs_, 1, Mprhs_, "bwlabel", 32); /* ncomp=max(max(labels)); */ Mprhs_[0] = &labels; Mplhs_[0] = &CM0_; mccCallMATLAB(1, Mplhs_, 1, Mprhs_, "max", 33); Mprhs_[0] = &CM0_; Mplhs_[0] = &CM1_; mccCallMATLAB(1, Mplhs_, 1, Mprhs_, "max", 33); ncomp = (mccGetRealVectorElement(&CM1_, mccRint(1))); /* attention=zeros(1,ncomp); */ mccZerosMN(&attention, 1, ncomp); /* for i=1:ncomp */ for (I0_ = 1; I0_ <= ncomp; I0_ = I0_ + 1) { i = I0_; /* attention(i)=sum(sum(labels==i)); */ { int i_, j_; int m_=1, n_=1, cx_ = 0; unsigned short *p_BM0_; int I_BM0_=1; double *p_labels; int I_labels=1; double *q_labels; m_ = mcmCalcResultSize(m_, &n_, mccM(&labels), mccN(&labels)); mccAllocateMatrix(&BM0_, m_, n_); I_BM0_ = (mccM(&BM0_) != 1 || mccN(&BM0_) != 1); p_BM0_ = mccSPR(&BM0_); I_labels = (mccM(&labels) != 1 || mccN(&labels) != 1); p_labels = mccPR(&labels); q_labels = mccPI(&labels); if (m_ != 0) { for (j_=0; j_100 */ while (1) { { int i_, j_; int m_=1, n_=1, cx_ = 0; unsigned short *p_BM0_; int I_BM0_=1; int *p_maxatt; int I_maxatt=1; m_ = mcmCalcResultSize(m_, &n_, mccM(&maxatt), mccN(&maxatt)); mccAllocateMatrix(&BM0_, m_, n_); I_BM0_ = (mccM(&BM0_) != 1 || mccN(&BM0_) != 1); p_BM0_ = mccSPR(&BM0_); I_maxatt = (mccM(&maxatt) != 1 || mccN(&maxatt) != 1); p_maxatt = mccIPR(&maxatt); if (m_ != 0) { for (j_=0; j_ 100); } } } } if (!(mccIfCondition(&BM0_))) break; /* fovea=labels==i; */ { int i_, j_; int m_=1, n_=1, cx_ = 0; unsigned short *p_fovea; int I_fovea=1; double *p_labels; int I_labels=1; double *q_labels; int *p_i_1; int I_i_1=1; m_ = mcmCalcResultSize(m_, &n_, mccM(&labels), mccN(&labels)); m_ = mcmCalcResultSize(m_, &n_, mccM(&i_1), mccN(&i_1)); mccAllocateMatrix(&fovea, m_, n_); I_fovea = (mccM(&fovea) != 1 || mccN(&fovea) != 1); p_fovea = mccSPR(&fovea); I_labels = (mccM(&labels) != 1 || mccN(&labels) != 1); p_labels = mccPR(&labels); q_labels = mccPI(&labels); I_i_1 = (mccM(&i_1) != 1 || mccN(&i_1) != 1); p_i_1 = mccIPR(&i_1); if (m_ != 0) { for (j_=0; j_1 */ while (1) { { int i_, j_; int m_=1, n_=1, cx_ = 0; int *p_IM3_; int I_IM3_=1; int *p_next; int I_next=1; int *p_start; int I_start=1; m_ = mcmCalcResultSize(m_, &n_, mccM(&next), mccN(&next)); m_ = mcmCalcResultSize(m_, &n_, mccM(&start), mccN(&start)); mccAllocateMatrix(&IM3_, m_, n_); I_IM3_ = (mccM(&IM3_) != 1 || mccN(&IM3_) != 1); p_IM3_ = mccIPR(&IM3_); I_next = (mccM(&next) != 1 || mccN(&next) != 1); p_next = mccIPR(&next); I_start = (mccM(&start) != 1 || mccN(&start) != 1); p_start = mccIPR(&start); if (m_ != 0) { for (j_=0; j_ 1); } } } } if (!(mccIfCondition(&BM0_))) break; /* Neigh=Bframe(next(1)+off,next(2)+off); */ I1_ = ((int)mccGetRealVectorElement(&next, mccRint(1))); { int i_, j_; int m_=1, n_=1, cx_ = 0; int *p_IM0_; int I_IM0_=1; int *p_off; int I_off=1; m_ = mcmCalcResultSize(m_, &n_, mccM(&off), mccN(&off)); mccAllocateMatrix(&IM0_, m_, n_); I_IM0_ = (mccM(&IM0_) != 1 || mccN(&IM0_) != 1); p_IM0_ = mccIPR(&IM0_); I_off = (mccM(&off) != 1 || mccN(&off) != 1); p_off = mccIPR(&off); if (m_ != 0) { for (j_=0; j_=0)*asin(y/r)+(x<0)*(pi-asin(y/r)); */ { double t_ = mcmDivideRealpart(y, 0., r_r, r_i); C0__i = mcmDivideImagPart(y, 0., r_r, r_i); C0__r = t_; } Mprhs_[0] = mccTempMatrix(C0__r, C0__i, mccCX, 0 ); Mplhs_[0] = &CM3_; mccCallMATLAB(1, Mplhs_, 1, Mprhs_, "asin", 191); C1__r = (mccGetRealVectorElement(&CM3_, mccRint(1))); C1__i = mccGetImagVectorElement(&CM3_, mccRint(1)); R0_ = mcmPi(); { double t_ = mcmDivideRealpart(y, 0., r_r, r_i); C2__i = mcmDivideImagPart(y, 0., r_r, r_i); C2__r = t_; } Mprhs_[0] = mccTempMatrix(C2__r, C2__i, mccCX, 0 ); Mplhs_[0] = &CM4_; mccCallMATLAB(1, Mplhs_, 1, Mprhs_, "asin", 191); C3__r = (mccGetRealVectorElement(&CM4_, mccRint(1))); C3__i = mccGetImagVectorElement(&CM4_, mccRint(1)); mccSetVectorElement(&dphis, mccRint(t), ((( (x >= 0) && !mccREL_NAN(x) ) * C1__r) + (( (x < 0) && !mccREL_NAN(x) ) * (R0_ - C3__r))), ((( (x >= 0) && !mccREL_NAN(x) ) * C1__i) + (( (x < 0) && !mccREL_NAN(x) ) * (0. - C3__i)))); /* rhos(t)=2*dphis(t)/(norm(xs(mod(t+3,m)+1,:)-xs(t,:))+norm(xs(t,:)-xs(mod(t-5,m)+1,:))); */ Mprhs_[0] = mccTempMatrix((t + 3), 0., mccINT, 0 ); Mprhs_[1] = mccTempMatrix(m, 0., mccREAL, 0 ); Mplhs_[0] = &RM1_; mccCallMATLAB(1, Mplhs_, 2, Mprhs_, "mod", 192); { int i_, j_; int m_=1, n_=1, cx_ = 0; double *p_RM0_; int I_RM0_=1; double *p_RM1_; int I_RM1_=1; m_ = mcmCalcResultSize(m_, &n_, mccM(&RM1_), mccN(&RM1_)); mccAllocateMatrix(&RM0_, m_, n_); I_RM0_ = (mccM(&RM0_) != 1 || mccN(&RM0_) != 1); p_RM0_ = mccPR(&RM0_); I_RM1_ = (mccM(&RM1_) != 1 || mccN(&RM1_) != 1); p_RM1_ = mccPR(&RM1_); if (m_ != 0) { for (j_=0; j_