average value with threshold

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
PSan
Posts: 1
Joined: 2012-09-23T00:07:11-07:00
Authentication code: 67789

average value with threshold

Post by PSan »

Hi

I wanted to carry out image processing on an image where I want to get an average value of the RGB channel .
I understand that the identify -verbose command can give me the mean values for the RGB channel.


However, in the calculation of the average value of each chanel, I want to ignore any pixel value which are below a certain value and ignore pixel values which are saturated.

Is there a way to do this?

Thank you.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: average value with threshold

Post by fmw42 »

You would have to create a binary mask showing the values you want to average as white an the rest black. Then see my example for processing to get the mean value of a grayscale image ellipse at http://www.fmwconcepts.com/imagemagick/ ... shape_mean
Post Reply