Skip to content

Commit

Permalink
Handle APGD grasycale.
Browse files Browse the repository at this point in the history
  • Loading branch information
ebezzam committed Apr 25, 2023
1 parent c75e682 commit c08c1ee
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lensless/rfft_convolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ def __init__(self, psf, dtype=None, pad=True, norm="ortho", **kwargs):
self.is_torch = True

# prepare shapes for reconstruction
self._is_rgb = len(psf.shape) == 3
if self._is_rgb:
self._is_rgb = False
if len(psf.shape) == 3:
if psf.shape[2] == 3:
self._is_rgb = True
self._psf = psf
self._n_channels = 3
else:
self._psf = psf[:, :, None]
self._n_channels = 1
self._n_channels = self._psf.shape[2]
self._psf_shape = np.array(self._psf.shape)

# set dtype
Expand Down

0 comments on commit c08c1ee

Please sign in to comment.