summaryrefslogtreecommitdiff
path: root/ext/opencv
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-12-13 22:39:01 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-12-13 22:39:01 +0200
commit5c99f9cf37bab8dfb61296f15a602571846ae6d9 (patch)
treed411d862457dd46c216201e2564152ce6c0ca5a5 /ext/opencv
parent788bb676396a28bed4a6a423500a96a913708ed0 (diff)
downloadgstreamer-plugins-bad-5c99f9cf37bab8dfb61296f15a602571846ae6d9.tar.gz
gst: Don't declare variables inside the for loop header
This is a C99 feature.
Diffstat (limited to 'ext/opencv')
-rw-r--r--ext/opencv/MotionCells.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/opencv/MotionCells.h b/ext/opencv/MotionCells.h
index c858d8739..6c060a9ee 100644
--- a/ext/opencv/MotionCells.h
+++ b/ext/opencv/MotionCells.h
@@ -214,8 +214,10 @@ private:
bool getIsNonZero (IplImage * img)
{
- for (int lin = 0; lin < img->height; lin++)
- for (int col = 0; col < img->width; col++) {
+ int lin, col;
+
+ for (lin = 0; lin < img->height; lin++)
+ for (col = 0; col < img->width; col++) {
if ((((uchar *) (img->imageData + img->widthStep * lin))[col]) > 0)
return true;
}
@@ -224,15 +226,17 @@ private:
void setMotionCells (int p_frameWidth, int p_frameHeight)
{
+ int i, j;
+
m_cellwidth = (double) p_frameWidth / (double) m_gridx;
m_cellheight = (double) p_frameHeight / (double) m_gridy;
m_pCells = new Cell *[m_gridy];
- for (int i = 0; i < m_gridy; i++)
+ for (i = 0; i < m_gridy; i++)
m_pCells[i] = new Cell[m_gridx];
//init cells
- for (int i = 0; i < m_gridy; i++)
- for (int j = 0; j < m_gridx; j++) {
+ for (i = 0; i < m_gridy; i++)
+ for (j = 0; j < m_gridx; j++) {
m_pCells[i][j].MotionArea = 0;
m_pCells[i][j].CellArea = 0;
m_pCells[i][j].MotionPercent = 0;