- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, say I have an Ipp32s* image array. I want to apply the signum function, which will return -1 for negative pixel values, 1 for positive pixel values, and zero for zero-valued image pixels? I couldn't find a specific IPP function for signum.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It could be done like this:
Ipp32s*pSrc; // source image
Ipp32s*pDst; // result image
ippsThreshold_LT_32s_I(pSrc, pDst, len, -1); // replace all values < -1 with -1
ippsThreshold_GT_32s_I(pDst, len, 1); // replace all values > 1 with 1
or if original image doesn't need anymore:
Ipp32s*pSrcDst; // source and result
ippsThreshold_LT_32s_I(pSrcDst, len, -1); // replace all values < -1 with -1
ippsThreshold_GT_32s_I(pSrcDst, len, 1); // replace all values > 1 with 1
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