From 75a65542ba1c605a1feaf69b00e5abdc6452f2e7 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Wed, 25 Mar 2015 17:17:06 +0300 Subject: [PATCH] Reduce variables scope --- modules/core/src/pca.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/core/src/pca.cpp b/modules/core/src/pca.cpp index 95efd57185..85ba443245 100644 --- a/modules/core/src/pca.cpp +++ b/modules/core/src/pca.cpp @@ -66,7 +66,7 @@ PCA& PCA::operator()(InputArray _data, InputArray __mean, int flags, int maxComp { Mat data = _data.getMat(), _mean = __mean.getMat(); int covar_flags = CV_COVAR_SCALE; - int i, len, in_count; + int len, in_count; Size mean_sz; CV_Assert( data.channels() == 1 ); @@ -131,6 +131,7 @@ PCA& PCA::operator()(InputArray _data, InputArray __mean, int flags, int maxComp eigenvectors = evects1; // normalize eigenvectors + int i; for( i = 0; i < out_count; i++ ) { Mat vec = eigenvectors.row(i); @@ -202,7 +203,7 @@ PCA& PCA::operator()(InputArray _data, InputArray __mean, int flags, double reta { Mat data = _data.getMat(), _mean = __mean.getMat(); int covar_flags = CV_COVAR_SCALE; - int i, len, in_count; + int len, in_count; Size mean_sz; CV_Assert( data.channels() == 1 ); @@ -266,6 +267,7 @@ PCA& PCA::operator()(InputArray _data, InputArray __mean, int flags, double reta eigenvectors = evects1; // normalize all eigenvectors + int i; for( i = 0; i < eigenvectors.rows; i++ ) { Mat vec = eigenvectors.row(i);