The convolution Theorem of the Hartley Transform is given by

$$ Y_{Ha}(k) = X_{Ha}(k)H_{Ha}^{e}(k) + X_{Ha}(-k)H_{Ha}^{o}(k) $$


$$ H_{Ha}^{e}(k) = \frac{H_{Ha}(k) + H_{Ha}(-k)}{2} $$ $$ H_{Ha}^{o}(k) = \frac{H_{Ha}(k) - H_{Ha}(-k)}{2} $$

I tried the following implementation in Python,

HIMG_ = np.flip(np.flip(HIMG, -1), -2)
HKERNEL_ = np.flip(np.flip(HKERNEL, -1), -2)


ya_hartley_1 = HT((HIMG * HKERNEL_e) + (HIMG_ * HKERNEL_o))

And this was the output,

Convolution using the Hartley Transform

This is the output if convolution is done on spatial or Fourier domain,

enter image description here

The complete code is available on a kernel on Kaggle

Here is my question,

What is wrong with it? Why the output is not the same as the spatial or FFT convolution?

  • $\begingroup$ Why do you expect them to be the same? $\endgroup$ – MBaz Jan 29 at 23:50
  • $\begingroup$ Because I think this is what the convolution theorem is about. The convolution in the frequency domain should be equivalente to the convolution on the spatial domain. $\endgroup$ – Eduardo Reis Jan 30 at 3:50
  • $\begingroup$ But you do seem to be getting the same result on spatial and Fourier (your last image). It's when you use the Hartley transform that you get a different result, right? I know very little about image processing, but I know that the Hartley transform is not the same as Fourier (though they're closely related), so you'll get different results if you use it. $\endgroup$ – MBaz Jan 30 at 15:11
  • $\begingroup$ Think on this way, convolution is a spatial operation. But it has its equivalency on the Fourier space, which is given by the convolutional theorem of the Fourier Transform. The Hartley Transform also has its own convolutional Theorem. By definition, the result of both convolution in the Fourier Domain, as the convolution in the Hartley domain, after applying their respective inverse transform, should be the same as the result of the convolution in the spatial domain. $\endgroup$ – Eduardo Reis Jan 30 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.