magick++ --medianFilter

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
mlin@pelmorex.com

magick++ --medianFilter

Post by mlin@pelmorex.com »

hi,

any suggestion on the following issue? Thanks
I used Magick++ and medianFilter as follows:
#include <Magick++.h>
image.read(srcimage);
image.medianFilter(3.0);
image.sample("500x500");
image.write(output);

but the valgrind complains the following error:
==25070== Thread 8:
==25070== Use of uninitialised value of size 8
==25070== at 0x3CDD0C7A15: (within /usr/lib64/libMagickCore.so.3.0.0)
==25070== by 0x3CDCC07F51: (within /usr/lib64/libgomp.so.1.0.0)
==25070== by 0x37404061B4: start_thread (in /lib64/libpthread-2.5.so)
==25070== by 0x373F8CD36C: clone (in /lib64/libc-2.5.so)
==25070==
==25070== Use of uninitialised value of size 8
==25070== at 0x3CDD0BC58C: (within /usr/lib64/libMagickCore.so.3.0.0)
==25070== by 0x3CDD0C7ADF: (within /usr/lib64/libMagickCore.so.3.0.0)
==25070== by 0x3CDCC07F51: (within /usr/lib64/libgomp.so.1.0.0)
==25070== by 0x37404061B4: start_thread (in /lib64/libpthread-2.5.so)
==25070== by 0x373F8CD36C: clone (in /lib64/libc-2.5.so)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: magick++ --medianFilter

Post by magick »

Your code snippet worked for us with ImageMagick-6.6.4-9, the current release. For your release, try changing sample() to resize(). If that fails, you may have a buggy libgomp. Rebuild ImageMagick without OpenMP, add --disable-openmp to your configure script command line and then rebuild and reinstall ImageMagick.
mlin@pelmorex.com

Re: magick++ --medianFilter

Post by mlin@pelmorex.com »

Thanks.
I found the reason. It was because the call of image.medianFilter should not before sample

Best regards
Post Reply