From 7cf5de0ed09cfc3740488b72d0f4b5f378021f2f Mon Sep 17 00:00:00 2001 From: laurentBerger Date: Sat, 16 May 2015 19:29:12 +0200 Subject: [PATCH] trailing whitespace and some bracket --- samples/cpp/detect_mser.cpp | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/samples/cpp/detect_mser.cpp b/samples/cpp/detect_mser.cpp index 934817d..8631cb7 100644 --- a/samples/cpp/detect_mser.cpp +++ b/samples/cpp/detect_mser.cpp @@ -34,7 +34,7 @@ static void help() " ./detect_mser \n" "Press esc key when image window is active to change descriptor parameter\n"; "Press 2, 8, 4, 6, +,- or 5 keys in openGL windows to change view or use mouse\n"; - } +} struct MSERParams { @@ -158,7 +158,7 @@ static void onMouse(int event, int x, int y, int flags, void*) prevPhi = -1000; } if (prevTheta != -1000) - { + { if (x - prevTheta<0) { thetaObs +=(float)0.02; @@ -179,23 +179,33 @@ static void onMouse(int event, int x, int y, int flags, void*) prevPhi = y; } if (event==EVENT_MOUSEWHEEL) + { if (getMouseWheelDelta(flags)>0) rObs += (float)0.1; else rObs -= (float)0.1; - float pi = (float)acos(-1.0); + } + float pi = (float)acos(-1.0); if (thetaObs>pi) - { + { thetaObs = -2 * pi + thetaObs; - } + } if (thetaObs<-pi) + { thetaObs = 2 * pi + thetaObs; + } if (phiObs>pi / 2) + { phiObs = pi / 2 - (float)0.0001; + } if (phiObs<-pi / 2) + { phiObs = -pi / 2 + (float)0.00001; + } if (rObs<0) + { rObs = 0; + } } @@ -360,17 +370,15 @@ Mat MakeSyntheticImage() p0 = Point(600, 600); for (int i = 0; i<13; i++) - { + { circle(img, p0, width[i] / 2, Scalar(color[i]), 1); floodFill(img, p0, Scalar(color[i])); - - } + } int histSize = 256; float range[] = { 0, 256 }; const float* histRange[] = { range }; Mat hist; - // we compute the histogram - + // we compute the histogram calcHist(&img, 1, 0, Mat(), hist, 1, &histSize, histRange, true, false); cout << "****************Maximal region************************\n"; for (int i = 0; i < hist.rows ; i++) @@ -478,7 +486,7 @@ int main(int argc, char *argv[]) plan.push_back(img); merge(plan,result); } - try + try { // We can detect regions using detectRegions method vector keyImg; @@ -518,7 +526,3 @@ int main(int argc, char *argv[]) } return 0; } - - - - -- 2.7.4