Here are a few ideas for improving mahotas.
These can be very complex as they require an understanding of the inner workings of mahotas, but that does appeal to a certain personality.
write a tight inner loop in one dimension:
void multiply(floating* r, const floating* f, const floating a, const int n, const int r_step, const int f_step) {
for (int i = 0; i != n; ++i) {
*r += a * *f;
r += r_step;
f += f_step;
}
}
to implement:
r[row] += a* f[row+offset]
and you can call this with all the different values of a and offset that make up your filter. This would be useful for Guassian filtering.
Mahotas has very good API documentation, but not so many start to finish tutorials which touch several parts of it (and even other packages, the ability to seamlessly use other packages in Python is, of course, a good reason to use it).