Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
26 Views

ippiFilter + offset?

Hi,
Im trying to implement Emboss filter through ippiFilter, but I cannot find a way to use an offset value.
Imaging software like Photoshop or GIMP allows setting three parameters for custom filters: convolution matrix, scale and offset.
Is there something like "ippiFilter + offset" I can use for my purposes?
Best regards,
Evgeniy
0 Kudos
7 Replies
Highlighted
Employee
26 Views

Hello,

For the offset, do it mean that it only process part of the image? For ippiFilter_ function, you can set the pSrc to start of that part, and also the function set the ROI size for that part.

Thanks,
Chao

0 Kudos
Highlighted
Beginner
26 Views

Hi Chao,
Thanks for your reply.
I'm attaching two screenshots from Photoshop to illustrate what I mean.
"Offset" is not a buffer offset.
By applying kernel to source image we have some sum for one destination pixel. This sum is divided by divisor and placed to destination buffer and there is no way to add some fixed offset to this result. Some effects like emboss from my screenshots requires constant to be added.
In all imaging software offset is supported and I wonder is there any stuff for this in IPP?
Best regards,
Evgeniy
0 Kudos
Highlighted
Employee
26 Views

Hi Evgeniy,

After calling the filter, can this be done with calling ippiAddC_ ? That will add one const value to the image.

Thanks,
Chao

0 Kudos
Highlighted
Beginner
26 Views

No, it cannot be done.

ippiFilter_ will truncate negative values to zeros and effect will be wrong.

Let's say, for example, I need to implement color invertion with ippiFilter_.
In general it can be done with {0, 0, 0, 0, -1, 0, 0, 0, 0} 3x3 kernel + 255 offset.

Now ippiFilter_ gives me complete black destination buffer after applying kernel and there is nothing to add with constant.

Best regards,
Evgeniy
0 Kudos
Highlighted
Employee
26 Views

Evgeniy,

Thanks for input. I am tracking this function as feature request.

Thanks,
Chao
0 Kudos
Highlighted
Employee
26 Views

IPP 2107 added the following API, which can support this functionality now:

IPPAPI( IppStatus, ippiFilterBorderSetMode, (IppHintAlgorithm hint, int offset, IppiFilterBorderSpec* pSpec))

Thanks,
Chao

 

0 Kudos
Highlighted
Beginner
26 Views

Thank you, Chao.

I'll try it as soon as I can.

0 Kudos