- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
is there a simple way to convert a 16s image to 16u , without going creating temporary 32s
image and adding 32768 to each pixel ?
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
Forrange shift (16s => 16u) you can use function ippiXorC_16u_C1IR:
ippiXorC_16u_C1IR(0x8000, (Ipp16u *)pSrcDst, srcDstStep, roiSize).
Data are converted:
-32768 -> 0,
-32767 -> 1,
...
-1 -> 32767,
0 -> 32768,
1 -> 32769,
...
32767 -> 65536.
For processing of images with 3, 4 channels use similar functions with suffixesC3, C4.
I hope you are finding it.
Forrange shift (16s => 16u) you can use function ippiXorC_16u_C1IR:
ippiXorC_16u_C1IR(0x8000, (Ipp16u *)pSrcDst, srcDstStep, roiSize).
Data are converted:
-32768 -> 0,
-32767 -> 1,
...
-1 -> 32767,
0 -> 32768,
1 -> 32769,
...
32767 -> 65536.
For processing of images with 3, 4 channels use similar functions with suffixesC3, C4.
I hope you are finding it.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
IPP v7.0 contain appropriate convertion functions in image processing domain
IPPAPI ( IppStatus, ippiConvert_16s16u_C1Rs,
(const Ipp16s* pSrc, int srcStep, Ipp16u* pDst, int dstStep,
IppiSize roi))
Although, it is implemented asdst = (src>0)?(Ipp16u)src:0; that might be not what you are looking for
Regards,
Vladimir
IPP v7.0 contain appropriate convertion functions in image processing domain
IPPAPI ( IppStatus, ippiConvert_16s16u_C1Rs,
(const Ipp16s* pSrc, int srcStep, Ipp16u* pDst, int dstStep,
IppiSize roi))
Although, it is implemented asdst
Regards,
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yeah witht aht conversion i would lose all the pixels with negative value , definetly not what i want :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
Forrange shift (16s => 16u) you can use function ippiXorC_16u_C1IR:
ippiXorC_16u_C1IR(0x8000, (Ipp16u *)pSrcDst, srcDstStep, roiSize).
Data are converted:
-32768 -> 0,
-32767 -> 1,
...
-1 -> 32767,
0 -> 32768,
1 -> 32769,
...
32767 -> 65536.
For processing of images with 3, 4 channels use similar functions with suffixesC3, C4.
I hope you are finding it.
Forrange shift (16s => 16u) you can use function ippiXorC_16u_C1IR:
ippiXorC_16u_C1IR(0x8000, (Ipp16u *)pSrcDst, srcDstStep, roiSize).
Data are converted:
-32768 -> 0,
-32767 -> 1,
...
-1 -> 32767,
0 -> 32768,
1 -> 32769,
...
32767 -> 65536.
For processing of images with 3, 4 channels use similar functions with suffixesC3, C4.
I hope you are finding it.
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