|
|
|
|
|
by aktiur
3936 days ago
|
|
More generally, for an image im with shape (width, height, channels) and a square transformation matrix M of shape (channels, channels), you can do : res = np.dot(im, M.T)
It will work with affine transformation as well if you add a 1 component to every pixel. It will also work with higher dimensional images if I'm not mistaken. |
|
Would you believe that Numba is 4 times faster for the sort of simple transformations described in the blog post?
(See aktiur's response below, some performance gains come from avoiding a copy)