NPP: nppiCopyConstBorder_8u_C1R() bug?

I’m using the NPP library (1.0) under Ubuntu 9.10. I’m experiencing some strange results when using the nppiCopyConstBorder_8u_C1R() function to create a border around my picture.

If I use a nLeftBorderWidth parameter to the function that is a multiple of 4 and a image with a width that is a multiple of 4 the first nTopBorderHeight rows in the new picture, except for the left and right pixels also in the left and right borders, which should contain the borders are the same as the top row in the original image. They are not the color which I specify with the nValue parameter.

If this wasn’t clear I have included 3 pictures, one which is the original 100x100, one which should have a 4 pixel border around the picture, and one that has a five pixel border on the sides and 4 pixel ontop and in the bottom. They where both created the same way except for changing the nLeftBorderWidth parameter.

Original picture (100x100)

original.jpg

Image supposed to have a 4 pixel border (108x108):

4pixel_width.jpg

Image created exactly the same way expect for the 5 pixels to left and right instead of 4 pixels (110x108):

5pixel_width.jpg

Has anyone experienced the same results or is it just me that is using this function in the wrong way?
5pixel_width.jpg
4pixel_width.jpg
original.jpg

Hi Henrik,

at first glance I’d say you’ve probably hit on a bug here. Would it be possible for you to send me a copy of your test program? I’d like to be able to repro this here. It would probably also be ok if you just sent me the exact parameters you’re passing for the erroneous case.

–Frank

This bug is fixed in the next release of NPP. That release will happen at the same time as the CUDA 3.2 release.