The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
I suggest you read the documentation on AcquireKernelInfo(). The source code for that function explains the parameter. See also http://www.imagemagick.org/Usage/morphology/ for a fuller description.
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
If you need iterations of -1 at the command line, I expect you need -1 in the call to MagickMorphologyImage. But I haven't tested this, and "-1" probably has no effect for "Distance".
To check your code, you can test whether the code gives the same result as the command line.
I forgot to note that the code I wrote used IM version 6.9.7. It appears that the code you are using is IM v7 - I need to get around to upgrading!
In V7 the signature is:
Other than that, I agree with @snibgo that if the command line version needed -1, then the code should use -1 too, although it is possible that -1 and 1 would give the same result in your case.
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.