summaryrefslogtreecommitdiff
path: root/cvaux/src/cvcalibfilter.cpp
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2014-11-14 14:14:17 -0800
committerChih-Hung Hsieh <chh@google.com>2014-11-14 14:14:17 -0800
commit43970ad94d9b2631dc2ebe470e2a256264657b20 (patch)
tree1fb06045310a781f7b3e05562763b1a03c18f28c /cvaux/src/cvcalibfilter.cpp
parent4a99e243b42afcb885d036bb451eb3c2739275b6 (diff)
downloadopencv-43970ad94d9b2631dc2ebe470e2a256264657b20.tar.gz
Fix clang compiler warnings.
* Assigning to temp3 in two sub-expressions is incorrectly depending on evaluation order. * Comparing array to null is always true. Change-Id: I095a395995917a0f281b1ea582e9d7eddd23a2ff
Diffstat (limited to 'cvaux/src/cvcalibfilter.cpp')
-rw-r--r--cvaux/src/cvcalibfilter.cpp91
1 files changed, 44 insertions, 47 deletions
diff --git a/cvaux/src/cvcalibfilter.cpp b/cvaux/src/cvcalibfilter.cpp
index e6c4fc8..bc8f821 100644
--- a/cvaux/src/cvcalibfilter.cpp
+++ b/cvaux/src/cvcalibfilter.cpp
@@ -518,64 +518,61 @@ void CvCalibFilter::DrawPoints( CvMat** dstarr )
return;
}
- if( latestCounts )
+ for( i = 0; i < cameraCount; i++ )
{
- for( i = 0; i < cameraCount; i++ )
+ if( dstarr[i] && latestCounts[i] )
{
- if( dstarr[i] && latestCounts[i] )
- {
- CvMat dst_stub, *dst;
- int count = 0;
- bool found = false;
- CvPoint2D32f* pts = 0;
+ CvMat dst_stub, *dst;
+ int count = 0;
+ bool found = false;
+ CvPoint2D32f* pts = 0;
- GetLatestPoints( i, &pts, &count, &found );
+ GetLatestPoints( i, &pts, &count, &found );
- dst = cvGetMat( dstarr[i], &dst_stub );
+ dst = cvGetMat( dstarr[i], &dst_stub );
- static const CvScalar line_colors[] =
- {
- {{0,0,255}},
- {{0,128,255}},
- {{0,200,200}},
- {{0,255,0}},
- {{200,200,0}},
- {{255,0,0}},
- {{255,0,255}}
- };
-
- const int colorCount = sizeof(line_colors)/sizeof(line_colors[0]);
- const int r = 4;
- CvScalar color = line_colors[0];
- CvPoint prev_pt = { 0, 0};
-
- for( j = 0; j < count; j++ )
- {
- CvPoint pt;
- pt.x = cvRound(pts[j].x);
- pt.y = cvRound(pts[j].y);
+ static const CvScalar line_colors[] =
+ {
+ {{0,0,255}},
+ {{0,128,255}},
+ {{0,200,200}},
+ {{0,255,0}},
+ {{200,200,0}},
+ {{255,0,0}},
+ {{255,0,255}}
+ };
+
+ const int colorCount = sizeof(line_colors)/sizeof(line_colors[0]);
+ const int r = 4;
+ CvScalar color = line_colors[0];
+ CvPoint prev_pt = { 0, 0};
+
+ for( j = 0; j < count; j++ )
+ {
+ CvPoint pt;
+ pt.x = cvRound(pts[j].x);
+ pt.y = cvRound(pts[j].y);
- if( found )
- {
- if( etalonType == CV_CALIB_ETALON_CHESSBOARD )
- color = line_colors[(j/cvRound(etalonParams[0]))%colorCount];
- else
- color = CV_RGB(0,255,0);
+ if( found )
+ {
+ if( etalonType == CV_CALIB_ETALON_CHESSBOARD )
+ color = line_colors[(j/cvRound(etalonParams[0]))%colorCount];
+ else
+ color = CV_RGB(0,255,0);
- if( j != 0 )
- cvLine( dst, prev_pt, pt, color, 1, CV_AA );
- }
+ if( j != 0 )
+ cvLine( dst, prev_pt, pt, color, 1, CV_AA );
+ }
- cvLine( dst, cvPoint( pt.x - r, pt.y - r ),
- cvPoint( pt.x + r, pt.y + r ), color, 1, CV_AA );
+ cvLine( dst, cvPoint( pt.x - r, pt.y - r ),
+ cvPoint( pt.x + r, pt.y + r ), color, 1, CV_AA );
- cvLine( dst, cvPoint( pt.x - r, pt.y + r),
- cvPoint( pt.x + r, pt.y - r), color, 1, CV_AA );
+ cvLine( dst, cvPoint( pt.x - r, pt.y + r),
+ cvPoint( pt.x + r, pt.y - r), color, 1, CV_AA );
- cvCircle( dst, pt, r+1, color, 1, CV_AA );
+ cvCircle( dst, pt, r+1, color, 1, CV_AA );
- prev_pt = pt;
- }
+ prev_pt = pt;
}
}
}