1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

fixed many warnings from GCC 4.6.1

This commit is contained in:
Vadim Pisarevsky
2012-03-17 09:22:31 +00:00
parent 4985c1b632
commit 846e37ded5
34 changed files with 84 additions and 147 deletions
+2 -4
View File
@@ -1249,13 +1249,11 @@ CvBoost::update_weights( CvBoostTree* tree )
// recent weak classifier we know the responses. For other samples we need to compute them
if( have_subsample )
{
float* values0, *values = (float*)cur_buf_pos;
float* values = (float*)cur_buf_pos;
cur_buf_pos = (uchar*)(values + data->buf->step);
uchar* missing0, *missing = cur_buf_pos;
uchar* missing = cur_buf_pos;
cur_buf_pos = missing + data->buf->step;
CvMat _sample, _mask;
values0 = values;
missing0 = missing;
// invert the subsample mask
cvXorS( subsample_mask, cvScalar(1.), subsample_mask );
+2 -12
View File
@@ -697,28 +697,18 @@ float CvRTrees::predict( const CvMat* sample, const CvMat* missing ) const
float CvRTrees::predict_prob( const CvMat* sample, const CvMat* missing) const
{
double result = -1;
int k;
if( nclasses == 2 ) //classification
{
int max_nvotes = 0;
cv::AutoBuffer<int> _votes(nclasses);
int* votes = _votes;
memset( votes, 0, sizeof(*votes)*nclasses );
for( k = 0; k < ntrees; k++ )
for( int k = 0; k < ntrees; k++ )
{
CvDTreeNode* predicted_node = trees[k]->predict( sample, missing );
int nvotes;
int class_idx = predicted_node->class_idx;
CV_Assert( 0 <= class_idx && class_idx < nclasses );
nvotes = ++votes[class_idx];
if( nvotes > max_nvotes )
{
max_nvotes = nvotes;
result = predicted_node->value;
}
++votes[class_idx];
}
return float(votes[1])/ntrees;
-1
View File
@@ -391,7 +391,6 @@ float ann_calc_error( CvANN_MLP* ann, CvMLData* _data, map<int, int>& cls_map, i
int cls_count = (int)cls_map.size();
Mat output( 1, cls_count, CV_32FC1 );
CvMat _output = CvMat(output);
map<int, int>::iterator b_it = cls_map.begin();
for( int i = 0; i < sample_count; i++ )
{
CvMat sample;