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

## Problem with ippiDilate_16u_C1IR

Beginner
498 Views

#include

#include "ippdefs.h"

#include "ippi.h"

// Create a disk (circular) structuring element

{

size_t nKernel = 2 * radius + 1;

std::vector disk(nKernel * nKernel, 0);

for (size_t iRow = 0; iRow < nKernel; ++iRow)

{

int dR = (int)radius - (int)iRow;

for (size_t iCol = 0; iCol < nKernel; ++iCol)

{

int dC = (int)radius - (int)iCol;

if (dR * dR + dC * dC <= rSquared)

disk[iRow * nKernel + iCol] = 1;

}

}

return disk;

}

// Verify that the dilation of a single point centered in an image

// of the appropriate size matches the mask.

{

// Construct a circular mask of the specified size.

// Create an Ipp image to perform the dilation in.

int stepBytes = 0;

size_t stepElements = (size_t)stepBytes / sizeof(Ipp16u);

// Set the ROI to the entire image and then set the image to 0.

Ipp16u* roiStart = data;

ippiSet_16u_C1R(0, roiStart, stepBytes, roiSize);

// Set the roi to a centered square of the same size as the mask.

// Set the center pixel of the image to 1.

// Dilate the image using the mask.

// Check that each pixel in the roi matches the mask.

bool good = true;

for (size_t iRow = 0; iRow < maskSize; ++iRow)

{

for (size_t iCol = 0; iCol < maskSize; ++iCol)

{

if (mask[iRow * maskSize + iCol] != roiStart[iRow * stepElements + iCol])

{

good = false;

}

}

}

// Cleanup

if (data != 0)

{

ippiFree(data);

data = 0;

roiStart = 0;

}

return good;

}

3 Replies
Employee
498 Views
Hello,
could you please specify what IPP version and what platform do you use?
Regards,

Beginner
498 Views
Quoting - vdudnik
Hello,
could you please specify what IPP version and what platform do you use?
Regards,

We are using IPP version 5.3.85 on Windows XP SP2

Employee
498 Views
Thanks, we've successfully run your test against IPP 6.0 on Intel Core2 processor. Please note that there were several updates for IPP 5.3, the latest one was update 4, where this issue might be resolved.
Regards,