- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
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!
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please take a look at this thread, similar problem.
http://software.intel.com/en-us/forums/showthread.php?t=65142
http://software.intel.com/en-us/forums/showthread.php?t=65142
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page