def __getitem__(self, idx):
        """Returns the requested frame from the video in gray scale"""
        cap = self.video_handle
        cellimg = cap.get_data(idx)
        if np.all(cellimg == 0):
            cellimg = self._get_image_workaround_seek(idx)
        # Convert to grayscale
        if len(cellimg.shape) == 3:
            cellimg = np.array(cellimg[:, :, 0])
        return cellimg
def __getitem__ ( self , idx ) : cap = self . video_handle cellimg = cap . get_data ( idx ) if np . all ( cellimg == 0 ) : cellimg = self . _get_image_workaround_seek ( idx ) if len ( cellimg . shape ) == 3 : cellimg = np . array ( cellimg [ : , : , 0 ] ) return cellimg
Returns the requested frame from the video in gray scale