From: ssnover95 Date: Tue, 13 Nov 2018 15:23:10 +0000 (-0500) Subject: doc(tutorial_py_fourier_transform): Correct errors in tutorial for integer division... X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1^2~430^2~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b24a815ac1c3bd0b0f090cea381593ed0b3babaf;p=platform%2Fupstream%2Fopencv.git doc(tutorial_py_fourier_transform): Correct errors in tutorial for integer division and filter symmetry --- diff --git a/doc/py_tutorials/py_imgproc/py_transforms/py_fourier_transform/py_fourier_transform.markdown b/doc/py_tutorials/py_imgproc/py_transforms/py_fourier_transform/py_fourier_transform.markdown index 3993790..44b08d5 100644 --- a/doc/py_tutorials/py_imgproc/py_transforms/py_fourier_transform/py_fourier_transform.markdown +++ b/doc/py_tutorials/py_imgproc/py_transforms/py_fourier_transform/py_fourier_transform.markdown @@ -79,11 +79,11 @@ using **np.ifft2()** function. The result, again, will be a complex number. You absolute value. @code{.py} rows, cols = img.shape -crow,ccol = rows/2 , cols/2 -fshift[crow-30:crow+30, ccol-30:ccol+30] = 0 +crow,ccol = rows//2 , cols//2 +fshift[crow-30:crow+31, ccol-30:ccol+31] = 0 f_ishift = np.fft.ifftshift(fshift) img_back = np.fft.ifft2(f_ishift) -img_back = np.abs(img_back) +img_back = np.real(img_back) plt.subplot(131),plt.imshow(img, cmap = 'gray') plt.title('Input Image'), plt.xticks([]), plt.yticks([])