I am using NPP 10.2.1 to apply Gaussian blur on 8-bit grayscale image.
Everything works perfectly when nFilterTaps <= 99.
But nppiFilterGaussAdvancedBorder_8u_C1R returns NPP_MASK_SIZE_ERROR for nFilterTaps > 99
I tried this with images of different sizes (from small to large) - behavior is the same.
Is this some kind of filter length limitation in NPP? I couldn’t find this in documentation.
Would appreciate any help.
The maximum gaussian filter size is 99. Can you share the application use case where
nFilterTap higher than 99?
Thank you for your reply.
I think restriction on filter length is very important information and it deserves to be included in documentation.
One application of long Gaussian filters is global brightness correction.
We subtract (very) blurred image from itself and shift brightness to the desired level. This gives us image with uniform brightness and preserved details regardless of uneven lighting in original one. This is more or less standard technique in scientific applications.
This application naturally requires very long Gaussian filters and GPU is apparently nice platform for this.
Now I downscale images to smaller size, apply box filter several times (~equivalent to Gaussian), upscale and use it as blurred image.
We will document the limitation in the future release.
Additionally, you can use nppiFilter32f and nppiFilter32fBorder functions do NOT restrict the number of coefficients. If you pass the filter kernel what size of the image and uses Gaussian coefficients it will work but there is NO guarantee of good performance with large filter size.
There are even nppiFilter32fColumn and nppi32fFilter32fRow functions which would allow you to do a 2-pass algorithm if he wants to do so. Since the filter kernel will overlap image boundaries the filter border versions of these functions are necessary, there is no significant performance difference between border and non-border versions of the functions.