-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can i do spectral reconstruction using this package? #137
Comments
Hey @nkraicer, thanks for your interest! We didn't develop SpectralDiffuserCam, so I'm not completely familiar with their implementation. How many channels does your PSF have? The one place where I think Once those are fixed for multichannel not having to be 3, I would start off trying the ADMM script with your PSF and measurement to see if you get an expected reconstruction. Let me know if that's unclear or if I missed something! |
@nkraicer I took a closer look at how the original authors pose the image recovery and it's not assuming a unique PSF per channel so I guess you also have a single channel PSF? In that case So one option would be to make a new
def _grad(self):
# make sure to sum on correct axis, and apply mask on correct dimensions
diff = np.sum(self.mask * self._convolver.convolve(self._image_est), 2) - self._data # (H, W, 1)
return self._convolver.deconvolve(diff * self.mask) # (H, W, C) where C is number of hyperspectral channels You could also replace proj with one of their methods. |
Hi,
I used your old ver of SpectralDiffuserCam
I want to use all of the provided reconstruction methods adding a mask
Is it straight forward to somehow change your rfft_convovle.py with these from spectraldiffusercam?
def Hpower(self, x):
x = np.fft.ifft2(self.H* np.fft.fft2(np.expand_dims(x,-1), axes = (0,1)), axes = (0,1))
x = np.sum(self.mask* self.crop(np.real(x)), 2)
x = self.pad(x)
return x
Any other major changes that should be taken into consideration?
Thanks!
The text was updated successfully, but these errors were encountered: