0

I have this piece of code

from scipy import misc
from numpy import fft

orig = misc.imread('lena256.png')
blur = misc.imread('lena256blur.png')
orig_f = fft.rfft2(orig)
blur_f = fft.rfft2(blur)

kernel_f = blur_f / orig_f         # do the deconvolution    

From another question here on stackoverflow (Link). But I know nothing about python. What is this line kernel_f = blur_f / orig_f supposed to do ? Is it dividing element by element or its matrix division, that can be "rewritten" using matrix inverse ? I tried google that, but found nothing usefull. If someone could post me code in C that do the same (I am using alglib for mathematic, but there is no division of matrices, afaik).

Community
  • 1
  • 1
Martin Perry
  • 9,232
  • 8
  • 46
  • 114

1 Answers1

1

This is elementwise division. See NumPy for Matlab Users in the category of ndarray operators. ndarray: All operations (*, /, +, ** etc.) are elementwise

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Bort
  • 2,423
  • 14
  • 22