I have a `[m,m]` numpy array with element in `{0, 1, 2, ..., 24}`, now I want separate each number in a third dimension to get a `[m,m,24]` array. 

a simple example, `[5,5]` array with element in `{0, 1, 2, 3}`

```
[0 0 1 0 0
 2 0 3 0 1
 0 2 3 1 0
 0 0 1 0 0
 1 0 2 0 1]

```

Now I need get a `[5,5,3]` array

```
[[0 0 1 0 0
  0 0 0 0 1
  0 0 0 1 0
  0 0 1 0 0
  1 0 0 0 1]
 [0 0 0 0 0
  2 0 0 0 0
  0 2 0 0 0
  0 0 0 0 0
  0 0 2 0 0]
 [0 0 0 0 0
  0 0 3 0 0
  0 0 3 0 0
  0 0 0 0 0
  0 0 0 0 0]]

```

Currently I have a simple method, but it's very computational expensive. Because I need to do this operation frequently.

```
img = np.expand_dims(img, axis=2)
for i in range(24):
    img_norm[..., i] = (img[..., 0] == (i + np.ones(shape=img[..., 0].shape)))

```

For `64` array with size `[224,224]` and element in `{0, 1, 2, ..., 24}`, The code above takes about `5s`.

Is there a faster way to do it?