- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm doing a C# application for visual computing - and needs a RGB thresholding.
Id like to set the RGB24 pixel to e.g. (255,255,255) when the thresholding condition is true. For this I tried the ippiThreshold_Val() function, like below:
unsafe private ipp.IppStatus ThresholdVal(byte* pSrc, byte* pDst, int Width, int Height, int bytePerPixel, byte[] thresholdValues, System.Drawing.Color objCol, ipp.IppCmpOp cmdOp)
{
ipp.IppStatus st = ipp.IppStatus.ippStsNoErr;
int Stride = bytePerPixel * Width;
ipp.IppiSize roi = new ipp.IppiSize(Width, Height);
byte[] objectValues = new byte[3] { objCol.B, objCol.G, objCol.R };
fixed (byte* fixThresholdValues = thresholdValues)
fixed (byte* fixObjectValues = objectValues)
{
if (pSrc == pDst)
{
st = ipp.ip.ippiThreshold_Val_8u_C3IR(pSrc, Stride, roi, fixThresholdValues, fixObjectValues, cmdOp);
// st = ipp.ip.ippiThreshold_8u_C3IR(pSrc, Stride, roi, fixThresholdValues, cmdOp);
}
else
{
st = ipp.ip.ippiThreshold_Val_8u_C3R(pSrc, Stride, pDst, Stride, roi, fixThresholdValues, fixObjectValues, cmdOp);
// st = ipp.ip.ippiThreshold_8u_C3R(pSrc, Stride, pDst, Stride, roi, fixThresholdValues, cmdOp);
}
}
return st;
}
But to my surprise it doesnt work at all seems that nothing happens?
Using the ippiThreshold() instead works better. A threshold is done, but the pixel is not set to the value Im wanting?
Furthermore ultmately I would like the thresholding conditon to be true only if all three thresholding channel criterias are meet, i.e only modify the pixel if e.g. ((PixRedChannel < PixRedThreshold) && (PixGreenChannel < PixGreenThreshold) && (PixBlueChannel < PixBlueThreshold)), is this possible with the IPP?
Thanks,
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'll move this to our Intel Integrated Performance Primitives forum, where our Technical Consulting Engineers can assist you.
Best regards,
==
Aubrey W.
Intel Software Network Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page