Wrong order of argument

Wrong order of argument

Hello,

I'm using some morphological operations and, after looking for ippiMorphAdvInitAlloc in the manual (Volume 2 of the book, page 534), I noticed that the presented order of arguments is not the same that what is presented at page 557, in the example of the same function.
More precisely, on page 534, ppState is the first argument, but on page 557, it is put in the last place.
Moreover, when I run this example code, it give me an Illegal instruction.

The example code that the manual shows is:

IppiMorphState* ppState;
IppiSize roiSize = {5, 5};
Ipp8u pMask[3*3] = {1, 1, 1,
1, 0, 1,
1, 1, 1};
IppiSize maskSize = {3, 3};
IppiPoint anchor = {1, 1};
Ipp8u pSrc[5*5] = { 1, 2, 4, 1, 2,
5, 1, 2, 1, 2,
1, 2, 1, 2, 1,
2, 1, 5, 1, 2};
int srcStep = 5;
int dstStep = 5;
Ipp8u pDst[5*5];
int dstSize = 5;
ippiMorphologyInitAlloc_8u_C1R( roiSize.width, pMask, maskSize, anchor, &ppState);
ippiDilateBorderReplicate_8u_C1R( pSrc, srcStep, pDst, dstStep, roiSize, ippBorderRepl, ppState);
ippiMorphologyFree(ppState);

Do you have any idea why I get an Illegal instruction fault?

Thanks in advance!

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello,

I'm not sure what version of IPP you refer to, but for the latest version, IPP 7.0, the documentation is available online, and from what I can see in online documentation, it seems there is no that mistake with order of function parameters.

MorphologyInitAlloc fnction description

Example "Using Morphology functions"

could you please check this with the latest version of IPP?

Regards,
Vladimir

Hello Vladimir,

I'm using the version 6.1.6.063. Checking on your html manual, I've found the same error (in ADVANCE Morphology Alloc):
Here are the details:
1) Go on http://software.intel.com/sites/products/documentation/hpc/composerxe/en...
2) You can find the following prototype: IppStatus ippiMorphAdvInitAlloc_(IppiMorphAdvState** ppState, IppiSize
roiSize, const Ipp8u* pMask, IppiSize maskSize, IppiPoint anchor);
3) Go in the example section of http://software.intel.com/sites/products/documentation/hpc/composerxe/en...
4) The prototype is now ippiMorphAdvInitAlloc_8u_C1R(roi, mask, msize, anchor, &state)

The first argument is not the same.

Another problem: running Example "Using Morphology functions",
I get an illegal instruction error. I suppose this library is not well linked in my IDE. Where is this library in /opt/intel/ipp/6.1.6.063/em64t/sharedlib ?

Regards

I'm sorry but I was not able to find any mistakes in documentation by your link in step 1. The syntax of function is described as the following and this seems to be correct

Syntax

IppStatus ippiMorphologyInitAlloc_(int roiWidth, const Ipp8u* pMask, IppiSize maskSize, IppiPoint anchor, IppiMorphState** ppState);

I did not find prototype you refer to
IppStatus ippiMorphAdvInitAlloc_(IppiMorphAdvState** ppState, IppiSize
roiSize, const Ipp8u* pMask, IppiSize maskSize, IppiPoint anchor);

Vladimir

I had some trouble with cut and paste...sorry. here is the link I was talking about:

http://software.intel.com/sites/products/documentation/studio/composer/e...

Ops, I think I've found what you mean. The function ippiMorphAdvInitAlloc is implemented in ippcv library and declared in ippcv.h file. It differ from similar function ippiMorphologyInitAlloc which implemented in ippi library and declared in ippi.h file.

You need to use appropriate functons either from image processing or from computer vision domain. It is not expected you will initialize state structure with function from one domain and use this state structure with functrion from other domain.

And I see your point, functionality is similar but API design is different.

Vladimir

Leave a Comment

Please sign in to add a comment. Not a member? Join today