Skip to content

Commit 291dbdf

Browse files
committed
Merge pull request opencv#19336 from kyshel:patch-1
2 parents 6ce9bb6 + 321f26f commit 291dbdf

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

doc/py_tutorials/py_imgproc/py_pyramids/py_pyramids.markdown

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,27 +88,27 @@ B = cv.imread('orange.jpg')
8888
# generate Gaussian pyramid for A
8989
G = A.copy()
9090
gpA = [G]
91-
for i in xrange(6):
91+
for i in range(6):
9292
G = cv.pyrDown(G)
9393
gpA.append(G)
9494

9595
# generate Gaussian pyramid for B
9696
G = B.copy()
9797
gpB = [G]
98-
for i in xrange(6):
98+
for i in range(6):
9999
G = cv.pyrDown(G)
100100
gpB.append(G)
101101

102102
# generate Laplacian Pyramid for A
103103
lpA = [gpA[5]]
104-
for i in xrange(5,0,-1):
104+
for i in range(5,0,-1):
105105
GE = cv.pyrUp(gpA[i])
106106
L = cv.subtract(gpA[i-1],GE)
107107
lpA.append(L)
108108

109109
# generate Laplacian Pyramid for B
110110
lpB = [gpB[5]]
111-
for i in xrange(5,0,-1):
111+
for i in range(5,0,-1):
112112
GE = cv.pyrUp(gpB[i])
113113
L = cv.subtract(gpB[i-1],GE)
114114
lpB.append(L)
@@ -122,7 +122,7 @@ for la,lb in zip(lpA,lpB):
122122

123123
# now reconstruct
124124
ls_ = LS[0]
125-
for i in xrange(1,6):
125+
for i in range(1,6):
126126
ls_ = cv.pyrUp(ls_)
127127
ls_ = cv.add(ls_, LS[i])
128128

doc/py_tutorials/py_imgproc/py_thresholding/py_thresholding.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ret,thresh5 = cv.threshold(img,127,255,cv.THRESH_TOZERO_INV)
4747
titles = ['Original Image','BINARY','BINARY_INV','TRUNC','TOZERO','TOZERO_INV']
4848
images = [img, thresh1, thresh2, thresh3, thresh4, thresh5]
4949

50-
for i in xrange(6):
50+
for i in range(6):
5151
plt.subplot(2,3,i+1),plt.imshow(images[i],'gray',vmin=0,vmax=255)
5252
plt.title(titles[i])
5353
plt.xticks([]),plt.yticks([])
@@ -98,7 +98,7 @@ titles = ['Original Image', 'Global Thresholding (v = 127)',
9898
'Adaptive Mean Thresholding', 'Adaptive Gaussian Thresholding']
9999
images = [img, th1, th2, th3]
100100

101-
for i in xrange(4):
101+
for i in range(4):
102102
plt.subplot(2,2,i+1),plt.imshow(images[i],'gray')
103103
plt.title(titles[i])
104104
plt.xticks([]),plt.yticks([])
@@ -153,7 +153,7 @@ titles = ['Original Noisy Image','Histogram','Global Thresholding (v=127)',
153153
'Original Noisy Image','Histogram',"Otsu's Thresholding",
154154
'Gaussian filtered Image','Histogram',"Otsu's Thresholding"]
155155

156-
for i in xrange(3):
156+
for i in range(3):
157157
plt.subplot(3,3,i*3+1),plt.imshow(images[i*3],'gray')
158158
plt.title(titles[i*3]), plt.xticks([]), plt.yticks([])
159159
plt.subplot(3,3,i*3+2),plt.hist(images[i*3].ravel(),256)
@@ -196,7 +196,7 @@ bins = np.arange(256)
196196
fn_min = np.inf
197197
thresh = -1
198198

199-
for i in xrange(1,256):
199+
for i in range(1,256):
200200
p1,p2 = np.hsplit(hist_norm,[i]) # probabilities
201201
q1,q2 = Q[i],Q[255]-Q[i] # cum sum of classes
202202
if q1 < 1.e-6 or q2 < 1.e-6:

doc/py_tutorials/py_imgproc/py_transforms/py_fourier_transform/py_fourier_transform.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ fft_filters = [np.fft.fft2(x) for x in filters]
268268
fft_shift = [np.fft.fftshift(y) for y in fft_filters]
269269
mag_spectrum = [np.log(np.abs(z)+1) for z in fft_shift]
270270

271-
for i in xrange(6):
271+
for i in range(6):
272272
plt.subplot(2,3,i+1),plt.imshow(mag_spectrum[i],cmap = 'gray')
273273
plt.title(filter_name[i]), plt.xticks([]), plt.yticks([])
274274

doc/py_tutorials/py_photo/py_non_local_means/py_non_local_means.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ from matplotlib import pyplot as plt
108108
cap = cv.VideoCapture('vtest.avi')
109109

110110
# create a list of first 5 frames
111-
img = [cap.read()[1] for i in xrange(5)]
111+
img = [cap.read()[1] for i in range(5)]
112112

113113
# convert all to grayscale
114114
gray = [cv.cvtColor(i, cv.COLOR_BGR2GRAY) for i in img]

0 commit comments

Comments
 (0)