Yes, that’s my point exactly - not surprising, because it’s mathematically not separable when the window sizes are arbitrary. With 2D summed area the problem goes away - so I’ll work on that approach later. It’s easy, but boundary handling is the main issue there (also an issue for separated, but my 1D filter handles it). An approximate separated method is still useful, but I’d like a correct reference version too!
Edit: thanks for the 2D version to use as a starting point. If the reference/guidance image (the gradient part) is replaced by +f 10
to simulate a normal box filter, the edges problem will be visible (it’s also apparent mathematically).
Edit2: after some scribbled drawings, it’s definitely possible to handle boundaries in 2D summed area (without a horrible extend-the-image hack). Mostly just finding edge sums and multiplying by distance and sign(x*y). It’s tricky but hopefully reducable. Not sure if I’ll complete it before next weekend though.