Community
cancel
Showing results for 
Search instead for 
Did you mean: 
bibi88
Beginner
56 Views

Segmentation using labels

Hello,

I wanted to do a function that segment a grayscale image, but it seems that the number of resulting labels is always 1 for my function. I think the problem comes from the fact that I have only a few '0' in my grayscale source image. Does it means that I need to preprocess my picture before segmenting with IPP? How have I done an error?

Here is my code:

IplImage* Segmentation(IplImage* pcv_GrayImg)
{
CvSize cv_Size;
IppiSize RoiSize;
int bufferSize, numLabels;
int minLabel = 1;
int maxLabel = 254;

cv_Size.height = pcv_GrayImg->height;
cv_Size.width = pcv_GrayImg->width;
IplImage* pcv_SegImg = cvCreateImage( cv_Size, 8, 1 );

RoiSize.width = pcv_GrayImg->width;
RoiSize.height = pcv_GrayImg->height;
ippiLabelMarkersGetBufferSize_8u_C1R(RoiSize, &bufferSize);

Ipp8u* buffer = ippsMalloc_8u(bufferSize);
ippiLabelMarkers_8u_C1IR((Ipp8u*) pcv_GrayImg->imageData, pcv_GrayImg->widthStep, RoiSize, minLabel, maxLabel, ippiNormInf, &numLabels, buffer);
printf("Numlabels: %d\\n",numLabels);

...
}

Thanks for your help!
0 Kudos
1 Reply
PaulF_IntelCorp
Employee
56 Views

Please take a look at this thread, similar problem.
http://software.intel.com/en-us/forums/showthread.php?t=65142
Reply