Hello, I'm trying to get an image sharpening function with parameters working (apart from the fixed FilterSharpen call). I can't figure out why the code is bombing at the ippiConvFull_32f call below.
1. Could some kind soul please look over the routine below and see if anything is amiss? 2. Does the function look like it is properly constructed to perform sharpening? The end goal is to have a sharpen function with variable strength...
You take care of almost all of things for filter:image size, rowStrides, image border, components.
About failedat the function // apply filter retval = ippiConvFull_32f_C3R( &scratch.pixels[scratch.StepBytes/sizeof(Ipp32f) * border + border * 3], scratch.StepBytes, dims,//scratch.dims, krnl.pixels, krnl.StepBytes, krnl.dims, input32f.pixels, input32f.StepBytes);
I guess, it is because the size of your filter result image ( input32f) is not expected. let's assume youroriginalimage pImageP is 100x20, thus the input32f is 100x20 32f image. your kernal image is 3x3 32f image
Srcath image is your temp image with border (6), it is 100+2x6, 20+2x6 112x32 32f image. according to your input, (here enter dim is right than scratch.dims) and the ConvFull Result should be Mh = Mf + Mg - 1 and Nh = Nf + Ng - 1, youwillget adim (100x20)+ kernal(3x3)-1 = 102x22 image. But the image input32 is only 100x20. So the memory access will invalid. If you want to the result is100x20, then you may considerchange the parameter dim,setroiDim=98x18.
But why youperfer touse ippiConvFulto implement the filter?Besides the functionippiFilterShapen, there are general filter functions such as ippiFilter_32f_C3R()/ippiFilter32f_8u_C3R () and so on. The functions allow youto set anykernal and kernal size, dst size.You may check them in ipp manual ippiman.pdf and see if they can meet your request.