def _extract_rgb(self, rgb):
        r = rgb[:, :, 0].astype(np.float).ravel()
        g = rgb[:, :, 1].astype(np.float).ravel()
        r[~np.isfinite(r)] = 0
        g[~np.isfinite(g)] = 0
        sums = np.array([r.sum(), g.sum()])
        ps = [1, 3, 5, 10, 50, 90, 95, 97, 99]
        rper = np.array(np.percentile(r, ps))
        gper = np.array(np.percentile(g, ps))
        rdiff = rper[[5, 6, 7, 8]] - rper[[0, 1, 2, 3]]
        gdiff = gper[[0, 1, 2, 3]] - gper[[5, 6, 7, 8]]

        return np.hstack([sums, rper, gper, rdiff, gdiff]).reshape(1, -1)
dataset/ETHPy150Open ChrisBeaumont/brut/bubbly/extractors.py/RawStatsExtractor._extract_rgb/swapped operands of `-`