From 26c215cf182f61361909b5c465829b3b81180d5b Mon Sep 17 00:00:00 2001 From: Zachary Steinberg Date: Tue, 10 Feb 2026 17:22:29 -0500 Subject: [PATCH 1/2] Remove python 2 syntax --- .DS_Store | Bin 0 -> 10244 bytes edgedetection.py | 12 ++++++------ grayscale.py | 6 +++--- opencvfundamentals.py | 16 ++++++++-------- threshold.py | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b3d7666b5987c81ea611f627ca848e424939028e GIT binary patch literal 10244 zcmeHMO>Y`85PjR`kSYk}lAc#R^-@SqZBL~Uxs|AD+Mc_CEznRvd{m+*etO=F?IbF@ zOOT?<5@X4p#hx+qo@Z^w07%Z4y)z&MaL6k1xW=ZS$hg#v^33I!Zp4n0kkDRpD7%&Emfjb6de@IzHw!BLa+;xm*)znylesv~JR zX{|9}3~VwWxqF=%`vfD_hxz*q4QBJJ>Eim+a=w^R?*p!|!W;``_rKA^cePsbIcIMZ zZDbtF`1FmRbIvBcf4#*JV_a)*Uo|?^Z{h-%_>2zT;uL49oza^CpK|I?Irlq`yvJAe zZ1?oids>Nz^Bi;b9{Sqmil@tVNIc^RQ9s7pfPAYi(VyJ09=Meim31AG?@W1V;1}8N zN45I9`5hS9!HV3}h<-*6B+k2(BQg`;dr;+Nz+I|Cl&^>@W30}6g2!B4U{CV!dknPc58M~t-i_&niCKi==a z+74Fa<^{fRC;G^9phMXpC%vfln_~Y0)`C%Ds&h5v%^GrTS9+4=Y;Pi5;ccDoCqx?G$x-fOKv|+ed^O@5@JtYl1L7M+x&Kvp88DXWXxzHfKi89CO02p5 zB8zWls&hT$Tq^T4psmy+Vk^dgF<=brF9XjV^i=NuFUtS_-(P|ZxiPQ@3?v8btM)m8 z`n&ZF$a2@7vi@L|B6@2l)r5^+$5ZNcJU_^F{A*UxJrya1&n++4PO^vPzyBE^H-E)9 e8sXQY<^Pud7i9Rnp9m3BFv?J_%$8%i-M9r{aITyH literal 0 HcmV?d00001 diff --git a/edgedetection.py b/edgedetection.py index 3dd93f9..de25159 100644 --- a/edgedetection.py +++ b/edgedetection.py @@ -21,8 +21,8 @@ else: f = np.append(f, 100 + np.random.normal(0,1)) -print f.shape -print index.shape +print(f.shape) +print(index.shape) plt.figure(2) plt.plot(index, f, 'r-') @@ -50,7 +50,7 @@ x = np.arange(-20, 20, 0.1) kernel = (1/(std*np.sqrt(2*np.pi)))*np.exp(-np.square((x-mean)/std)/2) -print kernel.shape +print(kernel.shape) plt.figure(4) plt.plot(x, kernel, 'b-') @@ -62,7 +62,7 @@ # Convolve original image signal with Gaussian filter smoothed = np.convolve(kernel, f, 'same') -print smoothed.shape +print(smoothed.shape) plt.figure(5) plt.plot(smoothed, 'r-') @@ -96,7 +96,7 @@ # Convolve original image signal with Gaussian filter smoothed = np.convolve(first_diff, f, 'same') -print smoothed.shape +print(smoothed.shape) plt.figure(8) plt.plot(smoothed, 'r-') @@ -119,7 +119,7 @@ # Convolve original image signal with Gaussian filter smoothed = np.convolve(laplacian, f, 'same') -print smoothed.shape +print(smoothed.shape) plt.figure(10) plt.plot(smoothed, 'r-') diff --git a/grayscale.py b/grayscale.py index bd79813..2921e82 100644 --- a/grayscale.py +++ b/grayscale.py @@ -6,7 +6,7 @@ import cv2 import imutils -print "All packages imported properly!" +print("All packages imported properly!") # Load & show original image image = cv2.imread("testudo.jpg") @@ -14,8 +14,8 @@ cv2.imshow("Original Image", image) -print "height: %d" % (image.shape[0]) -print "width: %d" % (image.shape[1]) +print("height: %d" % (image.shape[0])) +print("width: %d" % (image.shape[1])) x_lim = image.shape[0] y_lim = image.shape[1] diff --git a/opencvfundamentals.py b/opencvfundamentals.py index 41338fe..c4ab219 100644 --- a/opencvfundamentals.py +++ b/opencvfundamentals.py @@ -3,7 +3,7 @@ import cv2 import imutils -print "All packages imported properly!" +print("All packages imported properly!") # Displaying & resizing images image = cv2.imread("testudo.jpg") @@ -20,18 +20,18 @@ cv2.imwrite("testimage.jpg", image) # Image shape (dimensions) -print image.shape -print "height: %d" % (image.shape[0]) -print "width: %d" % (image.shape[1]) -print "channels: %d" % (image.shape[2]) +print(image.shape) +print("height: %d" % (image.shape[0])) +print("width: %d" % (image.shape[1])) +print("channels: %d" % (image.shape[2])) # Pixel operations & image slicing (b, g, r) = image[0, 0] -print "Pixel at (0, 0) - Red: %d, Green: %d, Blue: %d" % (r, g, b) +print("Pixel at (0, 0) - Red: %d, Green: %d, Blue: %d" % (r, g, b)) # image[0, 0] = (0, 0, 255) (b, g, r) = image[0, 0] -print "Pixel at (0, 0) - Red: %d, Green: %d, Blue: %d" % (r, g, b) +print("Pixel at (0, 0) - Red: %d, Green: %d, Blue: %d" % (r, g, b)) corner = image[0:100, 0:100] cv2.imshow("Corner", corner) @@ -96,7 +96,7 @@ white = (255, 255, 255) -for r in xrange(0, 275, 25): +for r in range(0, 275, 25): cv2.circle(canvas, (centerX, centerY), r, white) cv2.imshow("Concentric Circles", canvas) cv2.waitKey(0) diff --git a/threshold.py b/threshold.py index 2a6216b..8ce32ec 100644 --- a/threshold.py +++ b/threshold.py @@ -6,7 +6,7 @@ import cv2 import imutils -print "All packages imported properly!" +print("All packages imported properly!") # Load & show original image image = cv2.imread("testudo.jpg") From e6e7a87a257ac785082113bfaed53ceca8399955 Mon Sep 17 00:00:00 2001 From: Zachary Steinberg Date: Tue, 10 Feb 2026 17:23:33 -0500 Subject: [PATCH 2/2] Remove .DS_StorE --- .DS_Store | Bin 10244 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index b3d7666b5987c81ea611f627ca848e424939028e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10244 zcmeHMO>Y`85PjR`kSYk}lAc#R^-@SqZBL~Uxs|AD+Mc_CEznRvd{m+*etO=F?IbF@ zOOT?<5@X4p#hx+qo@Z^w07%Z4y)z&MaL6k1xW=ZS$hg#v^33I!Zp4n0kkDRpD7%&Emfjb6de@IzHw!BLa+;xm*)znylesv~JR zX{|9}3~VwWxqF=%`vfD_hxz*q4QBJJ>Eim+a=w^R?*p!|!W;``_rKA^cePsbIcIMZ zZDbtF`1FmRbIvBcf4#*JV_a)*Uo|?^Z{h-%_>2zT;uL49oza^CpK|I?Irlq`yvJAe zZ1?oids>Nz^Bi;b9{Sqmil@tVNIc^RQ9s7pfPAYi(VyJ09=Meim31AG?@W1V;1}8N zN45I9`5hS9!HV3}h<-*6B+k2(BQg`;dr;+Nz+I|Cl&^>@W30}6g2!B4U{CV!dknPc58M~t-i_&niCKi==a z+74Fa<^{fRC;G^9phMXpC%vfln_~Y0)`C%Ds&h5v%^GrTS9+4=Y;Pi5;ccDoCqx?G$x-fOKv|+ed^O@5@JtYl1L7M+x&Kvp88DXWXxzHfKi89CO02p5 zB8zWls&hT$Tq^T4psmy+Vk^dgF<=brF9XjV^i=NuFUtS_-(P|ZxiPQ@3?v8btM)m8 z`n&ZF$a2@7vi@L|B6@2l)r5^+$5ZNcJU_^F{A*UxJrya1&n++4PO^vPzyBE^H-E)9 e8sXQY<^Pud7i9Rnp9m3BFv?J_%$8%i-M9r{aITyH