'Turn input types in a common form used by the rest of the class -- a
4-bit shifted list of unique colors'

def _makeCanonical(self, data):

    ret = ''
    if (data.__class__.__name__ == 'Image'):
        ret = data.getNumpy().reshape((-1), 3)
    elif (data.__class__.__name__ == 'cvmat'):
        ret = np.array(data).reshape((-1), 3)
    elif (data.__class__.__name__ == 'list'):
        temp = []
        for d in data:
            t = (d[2], d[1], d[0])
            temp.append(t)
        ret = np.array(temp, dtype='uint8')
    elif (data.__class__.__name__ == 'tuple'):
        ret = np.array((data[2], data[1], data[0]), 'uint8')
    elif (data.__class__.__name__ == 'np.array'):
        ret = data
    else:
        logger.warning('ColorModel:    color    is    not    in    an    accepted    format!')
        return None
    rs = np.right_shift(ret, self.mBits)
    if (len(rs.shape) > 1):
        uniques = np.unique(rs.view(([('', rs.dtype)] * rs.shape[1]))).view(rs.dtype).reshape((-1), 3)
    else:
        uniques = [rs]
    return dict.fromkeys(map(np.ndarray.tostring, uniques), 1)
