@jni : It is indeed ugly and unPythonic but it will be tranferred to an auxiliary Cython file like in the ORB descriptor(https://github.com/scikit-image/scikit-image/pull/699/files#L7R47), and hence should be ok. What do you think?