|
|
|
|
|
by dahart
3930 days ago
|
|
I haven't used Numba -- looks fast and easy! But am I missing something? Numpy has everything you need already, natively, no? Some slicing or a dot product should get you there... no need for ufuncs or einsum, I think... avg = (rgb[...,0]+rgb[...,1]+rgb[...,2]) * (1.0 / 3.0)
or better yet, gray = np.dot(rgb, [0.299, 0.587, 0.114])
|
|