I have two rgb images of same size, and I would like to compute a similarity metric. I thought of starting out with euclidean distance:

```
import scipy.spatial.distance as dist
import cv2

im1 = cv2.imread("im1.jpg")
im2 = cv2.imread("im2.jpg")

>> im1.shape
(820, 740, 3)

>> dist.euclidean(im1,im2)

ValueError: Input vector should be 1-D.

```

I know that `dist.euclidean` expects a 1-D array and `im1` and `im2` are 3-D, but is there a function that will work with 3-D arrays, or is it possible to transform `im1` and `im2` into a 1-D array that preserves the information in the images?