def _compute_histos_matrix_by_frame(self, histo_type):
        """Same as get_histo_matrix but averages histograms
           from the same frame.
        """
        # Index of first histogram of each frame
        idx_fst = np.cumsum([len(f.views) for f in self.frames])
        idx_fst = np.roll(idx_fst, 1)
        idx_fst[0] = 0
        # Collect only first histo of each frame
        orig_histos = self.get_histos_matrix(histo_type).tocsc()
        histos = orig_histos[idx_fst, :].tolil()
        # Collect and average other histos by frame
        for i, (j, f) in zip(idx_fst, enumerate(self.frames)):
            if len(f.views) > 1:
                new_histo = orig_histos[i:(i + len(f.views)), :].mean(axis=0)
                histos[j, :] = new_histo
        self.histos_by_frame[FEATURES_INDEX[histo_type]] = histos.tocsc()
dataset/ETHPy150Open omangin/multimodal/multimodal/db/models/objects.py/ObjectDB._compute_histos_matrix_by_frame/original