def _extract_rgb(self, rgb):
        self._prepare_templates(rgb.shape)

        r = rgb[:, :, 0].astype(np.float).ravel()
        g = rgb[:, :, 1].astype(np.float).ravel()
        rnorm = r / np.maximum(r.sum(), 1)
        gnorm = g / np.maximum(g.sum(), 1)
        result = np.hstack([np.dot(r, self.rings),
                            np.dot(g, self.rings),
                            np.dot(r, self.rings) - np.dot(g, self.rings),
                            np.dot(rnorm, self.rings),
                            np.dot(gnorm, self.rings),
                            np.dot(rnorm - gnorm, self.rings)])
        return result.reshape(1, -1)
dataset/ETHPy150Open ChrisBeaumont/brut/bubbly/extractors.py/RingExtractor._extract_rgb/original