On Mon, Jan 19, 2009 at 10:52 AM, Anthony Thyssen <a.thys...@griffith.edu.au> wrote: > > Looking at the changes as a result of this patch > http://www.imagemagick.org/Usage/compare/#type_bw > > Channel statistics: > gray: > min: 0 (0) > max: 127 (0.498039) > mean: 9.7071 (0.0380671) > standard deviation: 23.4909 (0.0921213) > kurtosis: 8.75478 > skewness: 3.02607 > Image statistics: > OverAll: > min: 0 (0) > max: 127 (0.498039) > mean: 7.28032 (0.0285503) > standard deviation: 20.7734 (0.0814645) > kurtosis: 13.032 > skewness: 3.60838 > >
> > But as it is gray. how can it be that we get a different > result for gray colors when compared to overall? > Good point. > All that would happen in this case is that overall should have > the gray data repeated three times. The results in that case > should be the same set of statistics. But that is > obviously NOT the case! > > Something is definitely not right here! > I got the same results as you. On looking further, I got some interesting results . Try the following steps and see if the same thing happens. Please apply the patch at the following url: http://rapidshare.com/files/185869690/tmp_no_kurtosis.patch It changes magick/identify.c to remove any display of kurtosis and skewness for all channels, so the only statistics shown are min, max, mean and standard deviation, just like before I had ever posted anything to this list. What is new is the overall statistics. Also the calculation of kurtosis and skewness is removed from the function GetImageChannelStatistics in magick/statistic.c. In addition the kurtosis and skewness members are removed from the ChannelStatistics struct declared in magick/statistic.h. The file PerlMagick/magick.xs has also been changed to remove references to kurtosis and skewness. Please remember to apply this patch on TOP of the patch I sent at the beginning of this thread. When I do this, I get the following results: Channel statistics: gray: min: 0 (0) max: 127 (0.498039) mean: 9.7071 (0.0380671) standard deviation: 23.4909 (0.0921213) Image statistics: OverAll: min: 0 (0) max: 127 (0.498039) mean: 7.28032 (0.0285503) standard deviation: 20.7734 (0.0814645) So the problem remains even after removal of all references to kurtosis and skewness. I also hacked up a small C program based on the 'core.c' file given as a example for the MagickCore API. The file is located here: http://rapidshare.com/files/185870096/imgstats_for_mailing_list.c When compiled the program takes a single argument, the name of a file. Please look at the C file and check that everything is ok. Here is the output of running the program on the same image: channel=GrayChannel Calling GetImageChannelMean Gray Channel Mean: 9.7071 Gray Channel Standard Deviation: 23.4909 channel=AllChannels Calling GetImageChannelMean All Channels Mean: 7.28032 All Channels Standard Deviation: 20.7734 Calling GetImageMean Image Mean: 7.28032 Image Standard Deviation: 20.7734 Calling GetImageChannelStatistics Gray Channel Mean: 9.7071 Gray Channel Standard Deviation: 23.4909 All Channels Mean: 7.28032 All Channels Standard Deviation: 20.7734 I have never touched the functions GetImageChannelMean and GetImageMean, and yet we get identical results for mean and standard deviation, compared to the function GetImageChannelStatistics. So in conclusion I would say that the problem was not introduced by my patch but uncovered by it. Fixing is beyond my present skills. I'm sure someone else on the list can fix it though. Regards Amartyo _______________________________________________ Magick-developers mailing list Magick-developers@imagemagick.org http://studio.imagemagick.org/mailman/listinfo/magick-developers