Permalink
Browse files

Makefile update; Style update

  • Loading branch information...
1 parent 61aaeee commit b61aaad213b31a23aa6cb74eea2156e6ee9359b8 @kyamagu committed Dec 1, 2013
Showing with 6 additions and 10 deletions.
  1. +1 −1 Makefile
  2. +5 −9 src/+cv/pointPolygonTest.cpp
View
@@ -37,4 +37,4 @@ doc:
$(DOXYGEN) Doxyfile
test:
- $(MATLAB) -nodisplay -r "cd test;try,UnitTest;catch e,disp(e.getReport);end;exit;"
+ $(MATLAB) -nodisplay -r "addpath(pwd);cd test;try,UnitTest;catch e,disp(e.getReport);end;exit;"
@@ -2,7 +2,7 @@
* @file pointPolygonTest.cpp
* @brief mex interface for pointPolygonTest
* @author Kota Yamaguchi
- * @date 2011
+ * @date 2013
*/
#include "mexopencv.hpp"
using namespace std;
@@ -28,24 +28,20 @@ void mexFunction( int nlhs, mxArray *plhs[],
Point2f pt(rhs[1].toPoint_<float>());
bool measureDist=false;
- for (int i=2; i<nrhs; i+=2)
- {
+ for (int i=2; i<nrhs; i+=2) {
string key(rhs[i].toString());
if (key=="MeasureDist")
measureDist = rhs[i+1].toBool();
else
mexErrMsgIdAndTxt("mexopencv:error","Wrong number of arguments");
}
- if (rhs[0].isNumeric())
- {
+ if (rhs[0].isNumeric()) {
Mat contour(rhs[0].toMat(CV_32F));
plhs[0] = MxArray(pointPolygonTest(contour,pt,measureDist));
}
- else if (rhs[0].isCell()) {
-
+ else if (rhs[0].isCell()) {
vector<Point2f> contour(rhs[0].toVector<Point2f>());
plhs[0] = MxArray(pointPolygonTest(contour,pt,measureDist));
- }
-
+ }
}

0 comments on commit b61aaad

Please sign in to comment.