Skip to content
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

Direct FFT method: resolve image boundary condition #105

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

antonysigma
Copy link
Collaborator

@antonysigma antonysigma commented Sep 20, 2024

When FFT's target width and height are larger than the image size, pad the space with zeros. Also, if shiftx and shifty are non-zeros, resolve the W-by-H tile with cyclic boundary condition.

Typical use-case:

# Note the size difference between the input image and the blur kernel
input_image = np.empty((1024, 1024), dtype=np.float32, order='F')
blur_kernel = np.ones((3,3)) / 9.0
alpha = 1e-3

u = Variable((1024, 1024))
problem = Problem(
  sum_squares( conv(blur_kernel, u) - input_image ) + alpha * group_norm1( grad(u) ),
  implem='halide',
)

problem.solve()

When FFT's W/H are larger than the image size, pad the space with zeros.
Also, if shiftx and shifty are non-zeros, resolve the W-by-H tile with
cyclic boundary condition.
@antonysigma antonysigma merged commit d88d402 into comp-imaging:master Sep 24, 2024
@antonysigma antonysigma deleted the zeropad-fft-direct branch September 24, 2024 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant