- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am new to this morphological operation function, ippiMorphOpenBorder. Does anyone knows how to use it?
My attempt to this is as follows:
IppiSize imgSz = { 320, 240 };
IppiSize maskSz = { 3, 3 };
IppiPoint anchorPt = { 1, 1 };
int buffer1Step, buffer2Step;
int dx, dy;
dx = maskSz.width - anchorPt.x;
dy = maskSz.height - anchorPt.y;
IppiSize imgBorderSz = { imgSz.width + dx + dx, imgSz.height + dy + dy };
buffer1Step = buffer2Step = (imgSz.width + dx + dx) * sizeof(Ipp32f);
Ipp8u* pMask = ippsMalloc_8u(maskSz.width * maskSz.height);
Ipp32f* pBuffer1 = ippsMalloc_32f((imgSz.width + dx) * (imgSz.height + dy));
IppiMorphAdvState* pState = NULL;
IppStatus stat = ippiSet_32f_C1IR(1.5f, pBuffer1, buffer1Step, imgBorderSz);
// I got ippStsMemAllocErr error over here.
// I am not sure about this error (error on the pMask or pState?).
stat = ippiMorphAdvInitAlloc_32f_C1R(&pState, imgSz, pMask, maskSz, anchorPt);
stat = ippiCopyReplicateBorder_32f_C1IR(pBuffer1, buffer1Step, imgSz, imgBorderSz, anchorPt.x, anchorPt.y);
stat = ippiMorphOpenBorder_32f_C1R(pBuffer1, buffer1Step, buffer2, buffer2Step, imgSz, ippBorderRepl, pState);
Regards,
I2R D&T Team
I am new to this morphological operation function, ippiMorphOpenBorder. Does anyone knows how to use it?
My attempt to this is as follows:
IppiSize imgSz = { 320, 240 };
IppiSize maskSz = { 3, 3 };
IppiPoint anchorPt = { 1, 1 };
int buffer1Step, buffer2Step;
int dx, dy;
dx = maskSz.width - anchorPt.x;
dy = maskSz.height - anchorPt.y;
IppiSize imgBorderSz = { imgSz.width + dx + dx, imgSz.height + dy + dy };
buffer1Step = buffer2Step = (imgSz.width + dx + dx) * sizeof(Ipp32f);
Ipp8u* pMask = ippsMalloc_8u(maskSz.width * maskSz.height);
Ipp32f* pBuffer1 = ippsMalloc_32f((imgSz.width + dx) * (imgSz.height + dy));
IppiMorphAdvState* pState = NULL;
IppStatus stat = ippiSet_32f_C1IR(1.5f, pBuffer1, buffer1Step, imgBorderSz);
// I got ippStsMemAllocErr error over here.
// I am not sure about this error (error on the pMask or pState?).
stat = ippiMorphAdvInitAlloc_32f_C1R(&pState, imgSz, pMask, maskSz, anchorPt);
stat = ippiCopyReplicateBorder_32f_C1IR(pBuffer1, buffer1Step, imgSz, imgBorderSz, anchorPt.x, anchorPt.y);
stat = ippiMorphOpenBorder_32f_C1R(pBuffer1, buffer1Step, buffer2, buffer2Step, imgSz, ippBorderRepl, pState);
Regards,
I2R D&T Team
Link Copied
0 Replies

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