Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Median filter 7x7

Gilad_D_Intel
Employee
525 Views

I'm trying to convert the following code from Matlab to c++

 

function data = process(data)
    data = medfilt2(data, [7 7], 'symmetric');
    mask = fspecial('gaussian', [35 35], 12);
    data = imfilter(data, mask, 'replicate', 'same');
    maximum = max(data(:));
    data = 1 ./ ( data/maximum );
    data(data > 10) = 16;
end

I'm trying to understand if Intel IPP support median filter for uint16

I have looked here 

https://software.intel.com/en-us/node/502283

and here

https://software.intel.com/en-us/node/504137

and here

https://software.intel.com/en-us/articles/intel-integrated-performance-primitives-documentation

and i'm kinda confued...

this is what my function signature looks like 

void Preprocessor::Process(uint16_t*& data, int width, int height)
{    
    Ipp16u* src = new Ipp16u[width * height];
    Ipp16u* dst = new Ipp16u[width * height];
    for (int i = 0; i < width*height; i++)
    {
        src = data;
    }
    IppiSize mask = {7,7};
    IppiSize roiSize = {width, height};
    IppiPoint anchorPoint = {0,0};
    IppStatus status = ippiFilterMedian_16u_C1R(src,width,dst,width,roiSize,mask,anchorPoint);

}

Where can I find an example of how to apply a 2d median filter? 

how Can I know if IPP support 7x7 mask size?

Thanks

 

 

 

0 Kudos
1 Reply
Chao_Y_Intel
Moderator
525 Views

Hello, 

For the 7x7 mask size, can you check the general filter function: 
https://software.intel.com/en-us/node/504150

An example on this function can be found here:  https://software.intel.com/en-us/node/599810

Thanks,
Chao

0 Kudos
Reply