- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
when i use opencv and with ipp 2018
and found ippiHaarClassifierInit_32f would return -8 error. code like this.
......................
#ifdef HAVE_IPP
int can_use_ipp = !out->has_tilted_features && !out->is_tree && out->isStumpBased;
if( can_use_ipp )
{
int ipp_datasize = cascade->count*sizeof(out->ipp_stages[0]);
float ipp_weight_scale=(float)(1./((orig_window_size.width-icv_object_win_border*2)*
(orig_window_size.height-icv_object_win_border*2)));
out->ipp_stages = (void**)cvAlloc( ipp_datasize );
memset( out->ipp_stages, 0, ipp_datasize );
ipp_features = (CvRect*)cvAlloc( max_count*3*sizeof(ipp_features[0]) );
ipp_weights = (float*)cvAlloc( max_count*3*sizeof(ipp_weights[0]) );
ipp_thresholds = (float*)cvAlloc( max_count*sizeof(ipp_thresholds[0]) );
ipp_val1 = (float*)cvAlloc( max_count*sizeof(ipp_val1[0]) );
ipp_val2 = (float*)cvAlloc( max_count*sizeof(ipp_val2[0]) );
ipp_counts = (int*)cvAlloc( max_count*sizeof(ipp_counts[0]) );
for( i = 0; i < cascade->count; i++ )
{
CvHaarStageClassifier* stage_classifier = cascade->stage_classifier + i;
for( j = 0, k = 0; j < stage_classifier->count; j++ )
{
CvHaarClassifier* classifier = stage_classifier->classifier + j;
int rect_count = 2 + (classifier->haar_feature->rect[2].r.width != 0);
ipp_thresholds
ipp_val1
ipp_val2
ipp_counts
for( l = 0; l < rect_count; l++, k++ )
{
ipp_features
//ipp_features
ipp_weights
}
}
returnVal = ippiHaarClassifierInit_32f((IppiHaarClassifier_32f*)out->ipp_stages,
(const IppiRect*)ipp_features, ipp_weights, ipp_thresholds,
ipp_val1, ipp_val2, ipp_counts, stage_classifier->count);
if(returnVal < 0 )
break;
}
if( i < cascade->count )
{
for( j = 0; j < i; j++ )
if( out->ipp_stages )
ippFree( (IppiHaarClassifier_32f*)out->ipp_stages );
cvFree( &out->ipp_stages );
}
}
#endif
...........................
but if i change ipp version to 6.1
the code just like this
.........................
#ifdef HAVE_IPP
int can_use_ipp = !out->has_tilted_features && !out->is_tree && out->isStumpBased;
if( can_use_ipp )
{
int ipp_datasize = cascade->count*sizeof(out->ipp_stages[0]);
float ipp_weight_scale=(float)(1./((orig_window_size.width-icv_object_win_border*2)*
(orig_window_size.height-icv_object_win_border*2)));
out->ipp_stages = (void**)cvAlloc( ipp_datasize );
memset( out->ipp_stages, 0, ipp_datasize );
ipp_features = (CvRect*)cvAlloc( max_count*3*sizeof(ipp_features[0]) );
ipp_weights = (float*)cvAlloc( max_count*3*sizeof(ipp_weights[0]) );
ipp_thresholds = (float*)cvAlloc( max_count*sizeof(ipp_thresholds[0]) );
ipp_val1 = (float*)cvAlloc( max_count*sizeof(ipp_val1[0]) );
ipp_val2 = (float*)cvAlloc( max_count*sizeof(ipp_val2[0]) );
ipp_counts = (int*)cvAlloc( max_count*sizeof(ipp_counts[0]) );
for( i = 0; i < cascade->count; i++ )
{
CvHaarStageClassifier* stage_classifier = cascade->stage_classifier + i;
for( j = 0, k = 0; j < stage_classifier->count; j++ )
{
CvHaarClassifier* classifier = stage_classifier->classifier + j;
int rect_count = 2 + (classifier->haar_feature->rect[2].r.width != 0);
ipp_thresholds
ipp_val1
ipp_val2
ipp_counts
for( l = 0; l < rect_count; l++, k++ )
{
ipp_features
//ipp_features
ipp_weights
}
}
if( ippiHaarClassifierInitAlloc_32f( (IppiHaarClassifier_32f**)&out->ipp_stages,
(const IppiRect*)ipp_features, ipp_weights, ipp_thresholds,
ipp_val1, ipp_val2, ipp_counts, stage_classifier->count ) < 0 )
break;
}
if( i < cascade->count )
{
for( j = 0; j < i; j++ )
if( out->ipp_stages )
ippiHaarClassifierFree_32f( (IppiHaarClassifier_32f*)out->ipp_stages );
cvFree( &out->ipp_stages );
}
}
#endif
............................................
it would work well. the different between above code is ippiHaarClassifierInitAlloc_32f and ippiHaarClassifierInit_32f
so i'm not sure what's the problem with 2018 ipp. please help, or any one can send me a example code to use ippiHaarClassifierInit_32f
thank 's a lot.
- Tags:
- Development Tools
- General Support
- Intel® Integrated Performance Primitives
- Parallel Computing
- Vectorization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
The function ippiHaarClassifierInitAlloc_32f has been removed from IPP9.0. As workaround, please use ippiHaarClassifierGetSize + ippMalloc + ippiHaarClassifierInit_32f to replace the function ippiHaarClassifierInitAlloc_32f .
Regards,
Ruqiu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RUQIU C. (Intel) wrote:Hello,
The function ippiHaarClassifierInitAlloc_32f has been removed from IPP9.0. As workaround, please use ippiHaarClassifierGetSize + ippMalloc + ippiHaarClassifierInit_32f to replace the function ippiHaarClassifierInitAlloc_32f .
Regards,
Ruqiu
thank you
and can you send me an example for how to use ippiHaarClassifierGetSize + ippMalloc + ippiHaarClassifierInit_32f
i could not find such things from the documentation
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page