I, too, find it hard to understand what you're trying to do given the odd relation between the sizes of your inputs, combined with the "shift 3" requirement, resulting in the non-intuitive size of your output.
On Wed, May 30, 2012 at 10:23 AM, Raul Miller <rauldmil...@gmail.com> wrote: > On Wed, May 30, 2012 at 12:29 AM, Alexander Mikhailov <avm...@yahoo.com> > wrote: >> I'm playing with some image processing, and not sure how to do >> a rather basic thing. >> >> It actually even applicable to 1D arrays. Suppose we have a >> picture, a 2D array of floating point brightness values in the >> range from 0 to 1. Suppose we want to superimpose another >> array on top of that, with some function for how to merge >> brightness from two sources in the same place. For 1D, an >> example could be "merge i. 5 with 2 * i. 4 where the second >> array is shifted 3 values from the beginning of the first one >> and merging values are averaged". I.e. >> >> 0 1 2 3 4 "merge with shift 3 and averaging" 0 2 4 6 >> -> >> 0 1 2 1.5 3 4 6 > > Here you are combining a five element list with a four element list > and producing a seven element list. If this were image manipulation, > you would be combining layers of different sizes and getting a new > layer which was a different size from either of the original sizes. I > have never seen any image manipulation application which works like > this. ... >> Am I missing some known J patterns? > > I need to understand what you mean by "merge" before I can comment on that. > > -- > Raul > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm -- Devon McCormick, CFA ^me^ at acm. org is my preferred e-mail ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm