Lines Matching defs:cascade
138 /*CvHidHaarClassifierCascade* cascade = *_cascade;
139 if( cascade->ipp_stages && icvHaarClassifierFree_32f_p )
142 for( i = 0; i < cascade->count; i++ )
144 if( cascade->ipp_stages[i] )
145 icvHaarClassifierFree_32f_p( cascade->ipp_stages[i] );
148 cvFree( &cascade->ipp_stages );*/
153 /* create more efficient internal representation of haar classifier cascade */
155 myicvCreateHidHaarClassifierCascade( CvHaarClassifierCascade* cascade )
178 if( !CV_IS_HAAR_CLASSIFIER(cascade) )
179 CV_ERROR( !cascade ? CV_StsNullPtr : CV_StsBadArg, "Invalid classifier pointer" );
181 if( cascade->hid_cascade )
184 if( !cascade->stage_classifier )
187 if( cascade->count <= 0 )
188 CV_ERROR( CV_StsOutOfRange, "Negative number of cascade stages" );
190 orig_window_size = cascade->orig_window_size;
193 internal representation of the classifier cascade */
194 for( i = 0; i < cascade->count; i++ )
196 CvHaarStageClassifier* stage_classifier = cascade->stage_classifier + i;
234 "the reference (original) cascade window", k, j, i );
243 // this is an upper boundary for the whole hidden cascade size
245 sizeof(MyCvHidHaarStageClassifier)*cascade->count +
254 out->count = cascade->count;
256 haar_classifier_ptr = (MyCvHidHaarClassifier*)(out->stage_classifier + cascade->count);
264 for( i = 0; i < cascade->count; i++ )
266 CvHaarStageClassifier* stage_classifier = cascade->stage_classifier + i;
329 int ipp_datasize = cascade->count*sizeof(out->ipp_stages[0]);
343 for( i = 0; i < cascade->count; i++ )
345 CvHaarStageClassifier* stage_classifier = cascade->stage_classifier + i;
370 if( i < cascade->count )
380 cascade->hid_cascade = (CvHidHaarClassifierCascade*)out;
487 MyCvHidHaarClassifierCascade* cascade;
490 CV_ERROR( !_cascade ? CV_StsNullPtr : CV_StsBadArg, "Invalid cascade pointer" );
492 cascade = (MyCvHidHaarClassifierCascade*)_cascade->hid_cascade;
493 if( !cascade )
494 CV_ERROR( CV_StsNullPtr, "Hidden cascade has not been created.\n"
498 pt.x + _cascade->real_window_size.width >= cascade->sum.width-2 ||
499 pt.y + _cascade->real_window_size.height >= cascade->sum.height-2 )
502 p_offset = pt.y * (cascade->sum.step/sizeof(sumtype)) + pt.x;
503 pq_offset = pt.y * (cascade->sqsum.step/sizeof(sqsumtype)) + pt.x;
504 mean = calc_sum(*cascade,p_offset) * cascade->inv_window_area;
505 pq0 = cascade->pq0[pq_offset];
506 pq1 = cascade->pq1[pq_offset];
507 pq2 = cascade->pq2[pq_offset];
508 pq3 = cascade->pq3[pq_offset];
510 variance_norm_factor = variance_norm_factor * cascade->inv_window_area - mean * mean;
516 // if( cascade->is_tree )
522 // ptr = cascade->stage_classifier;
550 // else if( cascade->is_stump_based )
552 for( i = start_stage; i < cascade->count; i++ )
556 if( cascade->stage_classifier[i].two_rects )
558 for( j = 0; j < cascade->stage_classifier[i].count; j++ )
560 MyCvHidHaarClassifier* classifier = cascade->stage_classifier[i].classifier + j;
570 for( j = 0; j < cascade->stage_classifier[i].count; j++ )
572 MyCvHidHaarClassifier* classifier = cascade->stage_classifier[i].classifier + j;
584 if( stage_sum < cascade->stage_classifier[i].threshold )
593 // for( i = start_stage; i < cascade->count; i++ )
597 // for( j = 0; j < cascade->stage_classifier[i].count; j++ )
600 // cascade->stage_classifier[i].classifier + j,
604 // if( stage_sum < cascade->stage_classifier[i].threshold )
640 MyCvHidHaarClassifierCascade* cascade;
669 cascade = (MyCvHidHaarClassifierCascade*)_cascade->hid_cascade;
671 if( cascade->has_tilted_features )
685 cascade->tilted = *tilted;
692 cascade->sum = *sum;
693 cascade->sqsum = *sqsum;
699 cascade->inv_window_area = weight_scale;
701 cascade->p0 = sum_elem_ptr(*sum, equ_rect.y, equ_rect.x);
702 cascade->p1 = sum_elem_ptr(*sum, equ_rect.y, equ_rect.x + equ_rect.width );
703 cascade->p2 = sum_elem_ptr(*sum, equ_rect.y + equ_rect.height, equ_rect.x );
704 cascade->p3 = sum_elem_ptr(*sum, equ_rect.y + equ_rect.height,
707 cascade->pq0 = sqsum_elem_ptr(*sqsum, equ_rect.y, equ_rect.x);
708 cascade->pq1 = sqsum_elem_ptr(*sqsum, equ_rect.y, equ_rect.x + equ_rect.width );
709 cascade->pq2 = sqsum_elem_ptr(*sqsum, equ_rect.y + equ_rect.height, equ_rect.x );
710 cascade->pq3 = sqsum_elem_ptr(*sqsum, equ_rect.y + equ_rect.height,
723 for( j = 0; j < cascade->stage_classifier[i].count; j++ )
725 for( l = 0; l < cascade->stage_classifier[i].classifier[j].count; l++ )
730 cascade->stage_classifier[i].classifier + j; */
732 &cascade->stage_classifier[i].classifier[j].node[l].feature;
873 CvHaarClassifierCascade* cascade,
902 if( !CV_IS_HAAR_CLASSIFIER(cascade) )
903 CV_ERROR( !cascade ? CV_StsNullPtr : CV_StsBadArg, "Invalid classifier cascade" );
932 if( !cascade->hid_cascade )
933 CV_CALL( myicvCreateHidHaarClassifierCascade(cascade) );
935 if( ((MyCvHidHaarClassifierCascade*)cascade->hid_cascade)->has_tilted_features )
965 // CvSize win_size0 = cascade->orig_window_size;
966 // /*int use_ipp = cascade->hid_cascade->ipp_stages != 0 &&
1019 // cvSetImagesForHaarClassifierCascade( cascade, &sum1, &sqsum1, 0, 1. );
1064 // for( int j = 0; j < cascade->count; j++ )
1070 // cascade->hid_cascade->stage_classifier[j].threshold,
1071 // cascade->hid_cascade->ipp_stages[j]) < 0 )
1086 // mycvRunHaarClassifierCascade( cascade, cvPoint(x,y), 0 ) > 0;
1135 if( (unsigned)split_stage >= (unsigned)cascade->count ||
1136 ((MyCvHidHaarClassifierCascade*)cascade->hid_cascade)->is_tree )
1138 split_stage = cascade->count;
1143 factor*cascade->orig_window_size.width < img->cols - 10 &&
1144 factor*cascade->orig_window_size.height < img->rows - 10;
1160 CvSize win_size = { cvRound( cascade->orig_window_size.width * factor ),
1161 cvRound( cascade->orig_window_size.height * factor )};
1177 mycvSetImagesForHaarClassifierCascade( cascade, sum, sqsum, tilted, factor );
1212 ((MyCvHidHaarClassifierCascade*)cascade->hid_cascade)->count = split_stage;
1247 result = mycvRunHaarClassifierCascade( cascade, cvPoint(ix,iy), 0 );
1263 int result = mycvRunHaarClassifierCascade( cascade, cvPoint(ix,iy),
1278 stage_offset = ((MyCvHidHaarClassifierCascade*)cascade->hid_cascade)->count;
1279 ((MyCvHidHaarClassifierCascade*)cascade->hid_cascade)->count = cascade->count;