ls,
I've a small grey-value bitmap (gamma) and a given class assignment (g),
see below. I need to compute the class means, but sorted in normal
order: first class 0, then 1 ...
In the example below I assume 4 classes.

mean=:+/%#

g=:4|>:i.2 3    NB. sample quantisation states
gamma=:?2 3$255 NB. sample grey-value bitmap

mu=:(/:~.,g){(,g)mean/.,gamma

Is there a nice tacit solution for these means (mu)?
Thanks in advance,
Jan.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to