• Home
  • Raw
  • Download

Lines Matching refs:cascade

128     CvHaarClassifierCascade* cascade = 0;  in icvCreateHaarClassifierCascade()  local
134 int block_size = sizeof(*cascade) + stage_count*sizeof(*cascade->stage_classifier); in icvCreateHaarClassifierCascade()
139 CV_CALL( cascade = (CvHaarClassifierCascade*)cvAlloc( block_size )); in icvCreateHaarClassifierCascade()
140 memset( cascade, 0, block_size ); in icvCreateHaarClassifierCascade()
142 cascade->stage_classifier = (CvHaarStageClassifier*)(cascade + 1); in icvCreateHaarClassifierCascade()
143 cascade->flags = CV_HAAR_MAGIC_VAL; in icvCreateHaarClassifierCascade()
144 cascade->count = stage_count; in icvCreateHaarClassifierCascade()
148 return cascade; in icvCreateHaarClassifierCascade()
156 CvHidHaarClassifierCascade* cascade = *_cascade; in icvReleaseHidHaarClassifierCascade() local
157 if( cascade->ipp_stages && icvHaarClassifierFree_32f_p ) in icvReleaseHidHaarClassifierCascade()
160 for( i = 0; i < cascade->count; i++ ) in icvReleaseHidHaarClassifierCascade()
162 if( cascade->ipp_stages[i] ) in icvReleaseHidHaarClassifierCascade()
163 icvHaarClassifierFree_32f_p( cascade->ipp_stages[i] ); in icvReleaseHidHaarClassifierCascade()
166 cvFree( &cascade->ipp_stages ); in icvReleaseHidHaarClassifierCascade()
173 icvCreateHidHaarClassifierCascade( CvHaarClassifierCascade* cascade ) in icvCreateHidHaarClassifierCascade() argument
196 if( !CV_IS_HAAR_CLASSIFIER(cascade) ) in icvCreateHidHaarClassifierCascade()
197 CV_ERROR( !cascade ? CV_StsNullPtr : CV_StsBadArg, "Invalid classifier pointer" ); in icvCreateHidHaarClassifierCascade()
199 if( cascade->hid_cascade ) in icvCreateHidHaarClassifierCascade()
202 if( !cascade->stage_classifier ) in icvCreateHidHaarClassifierCascade()
205 if( cascade->count <= 0 ) in icvCreateHidHaarClassifierCascade()
208 orig_window_size = cascade->orig_window_size; in icvCreateHidHaarClassifierCascade()
212 for( i = 0; i < cascade->count; i++ ) in icvCreateHidHaarClassifierCascade()
214 CvHaarStageClassifier* stage_classifier = cascade->stage_classifier + i; in icvCreateHidHaarClassifierCascade()
263 sizeof(CvHidHaarStageClassifier)*cascade->count + in icvCreateHidHaarClassifierCascade()
272 out->count = cascade->count; in icvCreateHidHaarClassifierCascade()
274 haar_classifier_ptr = (CvHidHaarClassifier*)(out->stage_classifier + cascade->count); in icvCreateHidHaarClassifierCascade()
282 for( i = 0; i < cascade->count; i++ ) in icvCreateHidHaarClassifierCascade()
284 CvHaarStageClassifier* stage_classifier = cascade->stage_classifier + i; in icvCreateHidHaarClassifierCascade()
347 int ipp_datasize = cascade->count*sizeof(out->ipp_stages[0]); in icvCreateHidHaarClassifierCascade()
361 for( i = 0; i < cascade->count; i++ ) in icvCreateHidHaarClassifierCascade()
363 CvHaarStageClassifier* stage_classifier = cascade->stage_classifier + i; in icvCreateHidHaarClassifierCascade()
388 if( i < cascade->count ) in icvCreateHidHaarClassifierCascade()
398 cascade->hid_cascade = out; in icvCreateHidHaarClassifierCascade()
441 CvHidHaarClassifierCascade* cascade; in cvSetImagesForHaarClassifierCascade() local
470 cascade = _cascade->hid_cascade; in cvSetImagesForHaarClassifierCascade()
472 if( cascade->has_tilted_features ) in cvSetImagesForHaarClassifierCascade()
486 cascade->tilted = *tilted; in cvSetImagesForHaarClassifierCascade()
493 cascade->sum = *sum; in cvSetImagesForHaarClassifierCascade()
494 cascade->sqsum = *sqsum; in cvSetImagesForHaarClassifierCascade()
500 cascade->inv_window_area = weight_scale; in cvSetImagesForHaarClassifierCascade()
502 cascade->p0 = sum_elem_ptr(*sum, equ_rect.y, equ_rect.x); in cvSetImagesForHaarClassifierCascade()
503 cascade->p1 = sum_elem_ptr(*sum, equ_rect.y, equ_rect.x + equ_rect.width ); in cvSetImagesForHaarClassifierCascade()
504 cascade->p2 = sum_elem_ptr(*sum, equ_rect.y + equ_rect.height, equ_rect.x ); in cvSetImagesForHaarClassifierCascade()
505 cascade->p3 = sum_elem_ptr(*sum, equ_rect.y + equ_rect.height, in cvSetImagesForHaarClassifierCascade()
508 cascade->pq0 = sqsum_elem_ptr(*sqsum, equ_rect.y, equ_rect.x); in cvSetImagesForHaarClassifierCascade()
509 cascade->pq1 = sqsum_elem_ptr(*sqsum, equ_rect.y, equ_rect.x + equ_rect.width ); in cvSetImagesForHaarClassifierCascade()
510 cascade->pq2 = sqsum_elem_ptr(*sqsum, equ_rect.y + equ_rect.height, equ_rect.x ); in cvSetImagesForHaarClassifierCascade()
511 cascade->pq3 = sqsum_elem_ptr(*sqsum, equ_rect.y + equ_rect.height, in cvSetImagesForHaarClassifierCascade()
524 for( j = 0; j < cascade->stage_classifier[i].count; j++ ) in cvSetImagesForHaarClassifierCascade()
526 for( l = 0; l < cascade->stage_classifier[i].classifier[j].count; l++ ) in cvSetImagesForHaarClassifierCascade()
533 &cascade->stage_classifier[i].classifier[j].node[l].feature; in cvSetImagesForHaarClassifierCascade()
700 CvHidHaarClassifierCascade* cascade; in cvRunHaarClassifierCascade() local
705 cascade = _cascade->hid_cascade; in cvRunHaarClassifierCascade()
706 if( !cascade ) in cvRunHaarClassifierCascade()
711 pt.x + _cascade->real_window_size.width >= cascade->sum.width-2 || in cvRunHaarClassifierCascade()
712 pt.y + _cascade->real_window_size.height >= cascade->sum.height-2 ) in cvRunHaarClassifierCascade()
715 p_offset = pt.y * (cascade->sum.step/sizeof(sumtype)) + pt.x; in cvRunHaarClassifierCascade()
716 pq_offset = pt.y * (cascade->sqsum.step/sizeof(sqsumtype)) + pt.x; in cvRunHaarClassifierCascade()
717 mean = calc_sum(*cascade,p_offset)*cascade->inv_window_area; in cvRunHaarClassifierCascade()
718 variance_norm_factor = cascade->pq0[pq_offset] - cascade->pq1[pq_offset] - in cvRunHaarClassifierCascade()
719 cascade->pq2[pq_offset] + cascade->pq3[pq_offset]; in cvRunHaarClassifierCascade()
720 variance_norm_factor = variance_norm_factor*cascade->inv_window_area - mean*mean; in cvRunHaarClassifierCascade()
726 if( cascade->is_tree ) in cvRunHaarClassifierCascade()
732 ptr = cascade->stage_classifier; in cvRunHaarClassifierCascade()
760 else if( cascade->is_stump_based ) in cvRunHaarClassifierCascade()
762 for( i = start_stage; i < cascade->count; i++ ) in cvRunHaarClassifierCascade()
766 if( cascade->stage_classifier[i].two_rects ) in cvRunHaarClassifierCascade()
768 for( j = 0; j < cascade->stage_classifier[i].count; j++ ) in cvRunHaarClassifierCascade()
770 CvHidHaarClassifier* classifier = cascade->stage_classifier[i].classifier + j; in cvRunHaarClassifierCascade()
784 for( j = 0; j < cascade->stage_classifier[i].count; j++ ) in cvRunHaarClassifierCascade()
786 CvHidHaarClassifier* classifier = cascade->stage_classifier[i].classifier + j; in cvRunHaarClassifierCascade()
802 if( stage_sum < cascade->stage_classifier[i].threshold ) in cvRunHaarClassifierCascade()
811 for( i = start_stage; i < cascade->count; i++ ) in cvRunHaarClassifierCascade()
815 for( j = 0; j < cascade->stage_classifier[i].count; j++ ) in cvRunHaarClassifierCascade()
818 cascade->stage_classifier[i].classifier + j, in cvRunHaarClassifierCascade()
822 if( stage_sum < cascade->stage_classifier[i].threshold ) in cvRunHaarClassifierCascade()
857 CvHaarClassifierCascade* cascade, in cvHaarDetectObjects() argument
883 if( !CV_IS_HAAR_CLASSIFIER(cascade) ) in cvHaarDetectObjects()
884 CV_ERROR( !cascade ? CV_StsNullPtr : CV_StsBadArg, "Invalid classifier cascade" ); in cvHaarDetectObjects()
904 if( !cascade->hid_cascade ) in cvHaarDetectObjects()
905 CV_CALL( icvCreateHidHaarClassifierCascade(cascade) ); in cvHaarDetectObjects()
907 if( cascade->hid_cascade->has_tilted_features ) in cvHaarDetectObjects()
937 CvSize win_size0 = cascade->orig_window_size; in cvHaarDetectObjects()
938 int use_ipp = cascade->hid_cascade->ipp_stages != 0 && in cvHaarDetectObjects()
991 cvSetImagesForHaarClassifierCascade( cascade, &sum1, &sqsum1, 0, 1. ); in cvHaarDetectObjects()
1036 for( j = 0; j < cascade->count; j++ ) in cvHaarDetectObjects()
1042 cascade->hid_cascade->stage_classifier[j].threshold, in cvHaarDetectObjects()
1043 cascade->hid_cascade->ipp_stages[j]) < 0 ) in cvHaarDetectObjects()
1058 cvRunHaarClassifierCascade( cascade, cvPoint(x,y), 0 ) > 0; in cvHaarDetectObjects()
1103 if( (unsigned)split_stage >= (unsigned)cascade->count || in cvHaarDetectObjects()
1104 cascade->hid_cascade->is_tree ) in cvHaarDetectObjects()
1106 split_stage = cascade->count; in cvHaarDetectObjects()
1111 factor*cascade->orig_window_size.width < img->cols - 10 && in cvHaarDetectObjects()
1112 factor*cascade->orig_window_size.height < img->rows - 10; in cvHaarDetectObjects()
1128 CvSize win_size = { cvRound( cascade->orig_window_size.width * factor ), in cvHaarDetectObjects()
1129 cvRound( cascade->orig_window_size.height * factor )}; in cvHaarDetectObjects()
1145 cvSetImagesForHaarClassifierCascade( cascade, sum, sqsum, tilted, factor ); in cvHaarDetectObjects()
1180 cascade->hid_cascade->count = split_stage; in cvHaarDetectObjects()
1215 result = cvRunHaarClassifierCascade( cascade, cvPoint(ix,iy), 0 ); in cvHaarDetectObjects()
1231 int result = cvRunHaarClassifierCascade( cascade, cvPoint(ix,iy), in cvHaarDetectObjects()
1246 stage_offset = cascade->hid_cascade->count; in cvHaarDetectObjects()
1247 cascade->hid_cascade->count = cascade->count; in cvHaarDetectObjects()
1539 CvHaarClassifierCascade* cascade = icvCreateHaarClassifierCascade(n); in icvLoadCascadeCART() local
1540 cascade->orig_window_size = orig_window_size; in icvLoadCascadeCART()
1557 cascade->stage_classifier[i].count = count; in icvLoadCascadeCART()
1558 cascade->stage_classifier[i].classifier = in icvLoadCascadeCART()
1559 (CvHaarClassifier*)cvAlloc( count*sizeof(cascade->stage_classifier[i].classifier[0])); in icvLoadCascadeCART()
1563 CvHaarClassifier* classifier = cascade->stage_classifier[i].classifier + j; in icvLoadCascadeCART()
1624 cascade->stage_classifier[i].threshold = threshold; in icvLoadCascadeCART()
1634 cascade->stage_classifier[i].parent = parent; in icvLoadCascadeCART()
1635 cascade->stage_classifier[i].next = next; in icvLoadCascadeCART()
1636 cascade->stage_classifier[i].child = -1; in icvLoadCascadeCART()
1638 if( parent != -1 && cascade->stage_classifier[parent].child == -1 ) in icvLoadCascadeCART()
1640 cascade->stage_classifier[parent].child = i; in icvLoadCascadeCART()
1644 return cascade; in icvLoadCascadeCART()
1655 CvHaarClassifierCascade *cascade = 0; in cvLoadHaarClassifierCascade() local
1687 CV_CALL( cascade = (CvHaarClassifierCascade*)cvLoad( directory )); in cvLoadHaarClassifierCascade()
1714 cascade = icvLoadCascadeCART( input_cascade, n, orig_window_size ); in cvLoadHaarClassifierCascade()
1722 cvReleaseHaarClassifierCascade( &cascade ); in cvLoadHaarClassifierCascade()
1724 return cascade; in cvLoadHaarClassifierCascade()
1734 CvHaarClassifierCascade* cascade = *_cascade; in cvReleaseHaarClassifierCascade() local
1736 for( i = 0; i < cascade->count; i++ ) in cvReleaseHaarClassifierCascade()
1738 for( j = 0; j < cascade->stage_classifier[i].count; j++ ) in cvReleaseHaarClassifierCascade()
1739 cvFree( &cascade->stage_classifier[i].classifier[j].haar_feature ); in cvReleaseHaarClassifierCascade()
1740 cvFree( &cascade->stage_classifier[i].classifier ); in cvReleaseHaarClassifierCascade()
1742 icvReleaseHidHaarClassifierCascade( &cascade->hid_cascade ); in cvReleaseHaarClassifierCascade()
1778 CvHaarClassifierCascade* cascade = NULL; in icvReadHaarClassifier() local
1798 CV_CALL( cascade = icvCreateHaarClassifierCascade(n) ); in icvReadHaarClassifier()
1807 cascade->orig_window_size.width = fn->data.i; in icvReadHaarClassifier()
1811 cascade->orig_window_size.height = fn->data.i; in icvReadHaarClassifier()
1835 CV_CALL( cascade->stage_classifier[i].classifier = in icvReadHaarClassifier()
1837 * sizeof( cascade->stage_classifier[i].classifier[0] ) ) ); in icvReadHaarClassifier()
1840 cascade->stage_classifier[i].classifier[j].haar_feature = NULL; in icvReadHaarClassifier()
1842 cascade->stage_classifier[i].count = trees_fn->data.seq->total; in icvReadHaarClassifier()
1852 classifier = &cascade->stage_classifier[i].classifier[j]; in icvReadHaarClassifier()
1938 || r.x + fn->data.i > cascade->orig_window_size.width ) in icvReadHaarClassifier()
1948 || r.y + fn->data.i > cascade->orig_window_size.height ) in icvReadHaarClassifier()
2088 cascade->stage_classifier[i].threshold = (float) fn->data.f; in icvReadHaarClassifier()
2095 || fn->data.i < -1 || fn->data.i >= cascade->count ) in icvReadHaarClassifier()
2103 || fn->data.i < -1 || fn->data.i >= cascade->count ) in icvReadHaarClassifier()
2110 cascade->stage_classifier[i].parent = parent; in icvReadHaarClassifier()
2111 cascade->stage_classifier[i].next = next; in icvReadHaarClassifier()
2112 cascade->stage_classifier[i].child = -1; in icvReadHaarClassifier()
2114 if( parent != -1 && cascade->stage_classifier[parent].child == -1 ) in icvReadHaarClassifier()
2116 cascade->stage_classifier[parent].child = i; in icvReadHaarClassifier()
2126 cvReleaseHaarClassifierCascade( &cascade ); in icvReadHaarClassifier()
2127 cascade = NULL; in icvReadHaarClassifier()
2130 return cascade; in icvReadHaarClassifier()
2143 const CvHaarClassifierCascade* cascade = (const CvHaarClassifierCascade*) struct_ptr; in icvWriteHaarClassifier() local
2150 CV_CALL( cvWriteInt( fs, NULL, cascade->orig_window_size.width ) ); in icvWriteHaarClassifier()
2151 CV_CALL( cvWriteInt( fs, NULL, cascade->orig_window_size.height ) ); in icvWriteHaarClassifier()
2155 for( i = 0; i < cascade->count; ++i ) in icvWriteHaarClassifier()
2163 for( j = 0; j < cascade->stage_classifier[i].count; ++j ) in icvWriteHaarClassifier()
2165 CvHaarClassifier* tree = &cascade->stage_classifier[i].classifier[j]; in icvWriteHaarClassifier()
2234 cascade->stage_classifier[i].threshold) ); in icvWriteHaarClassifier()
2237 cascade->stage_classifier[i].parent ) ); in icvWriteHaarClassifier()
2239 cascade->stage_classifier[i].next ) ); in icvWriteHaarClassifier()
2253 CvHaarClassifierCascade* cascade = NULL; in icvCloneHaarClassifier() local
2264 CV_CALL( cascade = icvCreateHaarClassifierCascade(n) ); in icvCloneHaarClassifier()
2265 cascade->orig_window_size = cascade_src->orig_window_size; in icvCloneHaarClassifier()
2269 cascade->stage_classifier[i].parent = cascade_src->stage_classifier[i].parent; in icvCloneHaarClassifier()
2270 cascade->stage_classifier[i].next = cascade_src->stage_classifier[i].next; in icvCloneHaarClassifier()
2271 cascade->stage_classifier[i].child = cascade_src->stage_classifier[i].child; in icvCloneHaarClassifier()
2272 cascade->stage_classifier[i].threshold = cascade_src->stage_classifier[i].threshold; in icvCloneHaarClassifier()
2274 cascade->stage_classifier[i].count = 0; in icvCloneHaarClassifier()
2275 CV_CALL( cascade->stage_classifier[i].classifier = in icvCloneHaarClassifier()
2277 * sizeof( cascade->stage_classifier[i].classifier[0] ) ) ); in icvCloneHaarClassifier()
2279 cascade->stage_classifier[i].count = cascade_src->stage_classifier[i].count; in icvCloneHaarClassifier()
2281 for( j = 0; j < cascade->stage_classifier[i].count; ++j ) in icvCloneHaarClassifier()
2283 cascade->stage_classifier[i].classifier[j].haar_feature = NULL; in icvCloneHaarClassifier()
2286 for( j = 0; j < cascade->stage_classifier[i].count; ++j ) in icvCloneHaarClassifier()
2291 &cascade->stage_classifier[i].classifier[j]; in icvCloneHaarClassifier()
2319 return cascade; in icvCloneHaarClassifier()