ippiConv and ROI help

ippiConv and ROI help

I'm attempting to do what I would have thought to be fairly straightforward.
I need to perform iterative convolutions of an image with a filter. The image (512x512) needs to be convoluted with a filter (3x3).

Here's what I've more or less figured out so far:

To prevent edge exceptions, I used ippiCopyReplicateBorder to create a larger image with padded borders. I want to work with type FLOAT but since there is no ReplicateBorder for float I started with SHORTs. That's ok as my original image is of type SHORT.

Here's where things get dicey. After padding and converting to float I've been
using ippiConvValid. This appears to chop off the padding and results in a usable image.

The problem. With the padding gone, I need to repad for the next iteration.
To do this, I need to convert back to short, pad and then back to float again.
Not desirable or entirely accurate.

The real meat of the question: If I don't use ConvValid, I can use ConvFull or maybe just ippiFilter. Except, then I end up with an image larger than my desired 512x512. I've been attempting to pick my 512x512 out of the padding using ippiCopy and an ROI but that doesn't appear to be correct AND it gives me exceptions.

Any help or samples would be greatly appreciated.

Thank you
Steven

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Do you want to do this flow?

1.create buffer (buffer size = source size + border size)

2.copy source to buffer roi
3.replicate border of buffer
4.filter buffer roi to destination

5.copy destination to buffer roi
6.replicate border of buffer
7.filter buffer roi to destination

8.free buffer

IPP did not have ReplicateBorder function in old IPP1.0.
I think that you can make ippiCopyReplicateBorder_32f yourself.
I have made the similar one in the past.
But, my code is Delphi(pascal) and 8u_C1R type.

Leave a Comment

Please sign in to add a comment. Not a member? Join today