def rgb_to_hsv(rgb):
<EOL>rgb = rgb.astype('<STR_LIT:float>')<EOL>hsv = np.zeros_like(rgb)<EOL>hsv[..., <NUM_LIT:3>:] = rgb[..., <NUM_LIT:3>:]<EOL>r, g, b = rgb[..., <NUM_LIT:0>], rgb[..., <NUM_LIT:1>], rgb[..., <NUM_LIT:2>]<EOL>maxc = np.max(rgb[..., :<NUM_LIT:3>], axis=-<NUM_LIT:1>)<EOL>minc = np.min(rgb[..., :<NUM_LIT:3>], axis=-<NUM_LIT:1>)<EOL>hsv[..., <NUM_LIT:2>] = maxc<EOL>mask = maxc != minc<EOL>hsv[mask, <NUM_LIT:1>] = (maxc - minc)[mask] / maxc[mask]<EOL>rc = np.zeros_like(r)<EOL>gc = np.zeros_like(g)<EOL>bc = np.zeros_like(b)<EOL>rc[mask] = (maxc - r)[mask] / (maxc - minc)[mask]<EOL>gc[mask] = (maxc - g)[mask] / (maxc - minc)[mask]<EOL>bc[mask] = (maxc - b)[mask] / (maxc - minc)[mask]<EOL>hsv[..., <NUM_LIT:0>] = np.select([r == maxc, g == maxc], [bc - gc, <NUM_LIT> + rc - bc], default=<NUM_LIT> + gc - rc)<EOL>hsv[..., <NUM_LIT:0>] = (hsv[..., <NUM_LIT:0>] / <NUM_LIT>) % <NUM_LIT:1.0><EOL>return hsv<EOL>
Input RGB image [0~255] return HSV image [0~1].

    Parameters
    ------------
    rgb : numpy.array
        An image with values between 0 and 255.

    Returns
    -------
    numpy.array
        A processed image.