├── .gitignore ├── README.md ├── Uygulama-010 └── Blending.py ├── Uygulama-1 ├── 001.py ├── 002.py └── esogu-eee.jpg ├── Uygulama-2 ├── video_yakala.py └── video_yakala_kaydet.py ├── Uygulama-3 ├── esogu-eee.jpg ├── geometrik_sekiller_1.py └── geometrik_sekiller_2.py ├── Uygulama-4 ├── Basit_Paint_Uyg.py └── daire_ciz.py ├── Uygulama-5 └── TrackBar.py ├── Uygulama-6 ├── Figure_1.png ├── opencv1.png └── padding.py ├── Uygulama-7 ├── görüntüEkleme.py └── görüntüde_bitWise.py ├── Uygulama-8 └── BRG2HSV_NesneTakibi.py └── Uygulama-9 ├── perspectiveTransformation.py ├── rotation(dondurme).py ├── scaling(olceklendirme).py └── translation(tasima).py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # dotenv 83 | .env 84 | 85 | # virtualenv 86 | .venv 87 | venv/ 88 | ENV/ 89 | 90 | # Spyder project settings 91 | .spyderproject 92 | .spyproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # mypy 101 | .mypy_cache/ 102 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Opencv-python-Uygulamaları 2 | -------------------------------------------------------------------------------- /Uygulama-010/Blending.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np,sys 3 | A = cv2.imread('elma.jpg') 4 | B = cv2.imread('portakal.jpg') 5 | # A için Gauss Piramidi 6 | G = A.copy() 7 | gpA = [G] 8 | for i in xrange(6): 9 | G = cv2.pyrDown(G) 10 | gpA.append(G) 11 | 12 | # B için Gauss Piramidi 13 | G = B.copy() 14 | gpB = [G] 15 | for i in xrange(6): 16 | G = cv2.pyrDown(G) 17 | gpB.append(G) 18 | # A için Laplace Piramidi 19 | lpA = [gpA[5]] 20 | for i in xrange(5,0,-1): 21 | GE = cv2.pyrUp(gpA[i]) 22 | L = cv2.subtract(gpA[i-1],GE) 23 | lpA.append(L) 24 | # B için Laplace Piramidi 25 | lpB = [gpB[5]] 26 | for i in xrange(5,0,-1): 27 | GE = cv2.pyrUp(gpB[i]) 28 | L = cv2.subtract(gpB[i-1],GE) 29 | lpB.append(L) 30 | # SAĞ Ve SOL Yarım Kürelerini Ekliyoruz 31 | LS = [] 32 | for la,lb in zip(lpA,lpB): 33 | rows,cols,dpt = la.shape 34 | ls = np.hstack((la[:,0:cols/2], lb[:,cols/2:])) 35 | LS.append(ls) 36 | # Şimdi Yeniden Oluşturma 37 | ls_ = LS[0] 38 | for i in xrange(1,6): 39 | ls_ = cv2.pyrUp(ls_) 40 | ls_ = cv2.add(ls_, LS[i]) 41 | 42 | # Her Yarım Küreye Bağlantı: 43 | 44 | real = np.hstack((A[:,:cols/2],B[:,cols/2:])) 45 | cv2.imwrite('Piramid_Karistirma.jpg',ls_) 46 | cv2.imwrite('Direkt_Karistirma.jpg',real) 47 | -------------------------------------------------------------------------------- /Uygulama-1/001.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import cv2 3 | img = cv2.imread('esogu-eee.jpg',0) 4 | cv2.imshow('image',img) 5 | k = cv2.waitKey(0) 6 | if k == 27: # ESC tuşu ile çıkış yapar 7 | cv2.destroyAllWindows() 8 | elif k == ord('s'): # 's' tuşu ile resmi kaydeder 9 | cv2.imwrite('esogu-eee.png',img) 10 | cv2.destroyAllWindows() 11 | -------------------------------------------------------------------------------- /Uygulama-1/002.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import cv2 3 | from matplotlib import pyplot as plt 4 | 5 | img = cv2.imread('esogu-eee.jpg',0) 6 | plt.imshow(img, cmap = 'gray', interpolation = 'bicubic') 7 | plt.show() 8 | -------------------------------------------------------------------------------- /Uygulama-1/esogu-eee.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turanerdem/OpenCV-Python/c520d6abdff44cf33f098a12e20f48d32f2ed3bd/Uygulama-1/esogu-eee.jpg -------------------------------------------------------------------------------- /Uygulama-2/video_yakala.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import cv2 3 | cap = cv2.VideoCapture(0) # harici bir kamerada i=0 yerine i=1,2,3..vs kullanabilirsiniz 4 | while(True): 5 | 6 | #Çerçeveler halinde görüntü yakalar 7 | ret, frame = cap.read() 8 | 9 | #Üzerinde işlem yapacağımız çerçeve buraya gelsin 10 | gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) 11 | 12 | #Sonuç Çerçeveyi Görüntüleme: 13 | cv2.imshow('frame',gray) 14 | if cv2.waitKey(1) & 0xFF == ord('q'): 15 | break 16 | 17 | #Herşey yolunda gitti ise dükkanı kapatabiliriz :) 18 | cap.release() 19 | cv2.destroyAllWindows() 20 | -------------------------------------------------------------------------------- /Uygulama-2/video_yakala_kaydet.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import cv2 3 | cap = cv2.VideoCapture(0) 4 | 5 | #Codec tanımlama ve VideoWriter nesnesi(object) oluşturma 6 | fourcc = cv2.VideoWriter_fourcc(*'XVID') 7 | out = cv2.VideoWriter('output.avi', fourcc, 20.0, (640,480)) 8 | 9 | while(cap.isOpened()): 10 | ret, frame = cap.read() 11 | if ret == True: 12 | frame = cv2.flip(frame,0) 13 | out.write(frame) 14 | 15 | cv2.imshow('frame',frame) 16 | if cv2.waitKey(1) & 0xFF == ord('q'): 17 | break 18 | else: 19 | break 20 | 21 | #Herşey yolunda gitti ise dükkanı kapatabiliriz :) 22 | cap.release() 23 | out.release() 24 | cv2.destroyAllWindows() 25 | -------------------------------------------------------------------------------- /Uygulama-3/esogu-eee.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turanerdem/OpenCV-Python/c520d6abdff44cf33f098a12e20f48d32f2ed3bd/Uygulama-3/esogu-eee.jpg -------------------------------------------------------------------------------- /Uygulama-3/geometrik_sekiller_1.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import cv2 3 | 4 | # Siyah bir zemin oluşturuyoruz. 5 | 6 | img = np.zeros((600,730,3), np.uint8) 7 | 8 | 9 | # 5 piksel kalınlığında diagonal mavi bir çizgi çizdiriyoruz. Çizginin özellikleri size kalmış, 8 bitlik değerleri istediğiniz gibi değiştirebilirsiniz. 10 | 11 | # Çizgi Çalışması !!! 12 | cv2.line(img,(0,0),(511,511),(255,0,0),5) 13 | 14 | # Dikdörtgen Çizimi: 15 | cv2.rectangle (img,(384,0), (510,511), (0,255,0), 3) 16 | 17 | # Daire Çizimi: 18 | cv2.circle (img,(447,63),63,(0,0,255),-1) 19 | 20 | # Elips Çizimi: 21 | cv2.ellipse(img,(256,256), (100,50),0,0,180,255,-1) 22 | 23 | # Poligon Çizimi: 24 | 25 | pts = np.array([[10,5],[20,30],[70,20],[50,10]],np.int32) 26 | pts = pts.reshape((-1,1,2)) 27 | cv2.polylines(img,[pts],True,(0,255,255)) 28 | 29 | #Beyaz renkte Esogu-EEE yazdıracağız. 30 | font = cv2.FONT_HERSHEY_SIMPLEX 31 | cv2.putText(img,'Esogu-EEE', (10,500), font, 4, (255,255,255),2,cv2.LINE_AA) 32 | 33 | # Görüntünün Oluşturulduğu Pencereyi Kapatmak için Herhangi bir Tuşu bekle 34 | 35 | cv2.imshow('Geometrik-Sekiller',img) 36 | cv2.waitKey(0) 37 | cv2.destroyAllWindows() 38 | -------------------------------------------------------------------------------- /Uygulama-3/geometrik_sekiller_2.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import cv2 3 | 4 | #İlk uygulama da öğrendiğimiz cv2.imread() komutu ile görüntü üzerinde geometrik şekiller oluşturacağız. 5 | 6 | img = cv2.imread('esogu-eee.jpg', cv2.IMREAD_COLOR) 7 | 8 | # 2 piksel kalınlığında diagonal mavi bir çizgi çizdiriyoruz. Çizginin özellikleri size kalmış, 8 bitlik değerleri istediğiniz gibi değiştirebilirsiniz. 9 | 10 | # Çizgi Çalışması !!! 11 | cv2.line(img,(0,0),(150,150),(255,0,0),2) 12 | 13 | # Dikdörtgen Çizimi: 14 | cv2.rectangle (img,(350,0), (200,200), (0,255,0), 3) 15 | 16 | # Daire Çizimi: 17 | cv2.circle (img,(300,400),63,(0,0,255),-1) 18 | 19 | # Elips Çizimi: 20 | cv2.ellipse(img,(200,255), (100,50),0,0,180,255,-1) 21 | 22 | # Poligon Çizimi: 23 | 24 | pts = np.array([[10,5],[20,30],[70,20],[50,10]],np.int32) 25 | pts = pts.reshape((-1,1,2)) 26 | cv2.polylines(img,[pts],True,(0,255,255)) 27 | 28 | #Mavi renkte Esogu-EEE yazdıracağız. 29 | font = cv2.FONT_HERSHEY_SIMPLEX 30 | cv2.putText(img,'Esogu-EEE', (0,375), font, 4, (255,0,0),2,cv2.LINE_AA) 31 | 32 | # Görüntünün Oluşturulduğu Pencereyi Kapatmak için Herhangi bir Tuşu bekle 33 | 34 | cv2.imshow('Geometrik-Sekiller',img) 35 | cv2.waitKey(0) 36 | cv2.destroyAllWindows() 37 | -------------------------------------------------------------------------------- /Uygulama-4/Basit_Paint_Uyg.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | 4 | drawing = False # Eğer mouse'a tıklandı ise: true 5 | mode = True # Eğer True ise, dikdörtgen çiz. 'm' tuşu mod değişimi için tanımlı 6 | ix,iy = -1,-1 7 | 8 | # Mouse kontrol Fonksiyonunu Çağırıyoruz(mouse callback function) 9 | 10 | def draw_circle(event,x,y,flags,param): 11 | global ix,iy,drawing,mode 12 | if event == cv2.EVENT_LBUTTONDOWN: 13 | drawing = True 14 | ix,iy = x,y 15 | elif event == cv2.EVENT_MOUSEMOVE: 16 | if drawing == True: 17 | if mode == True: 18 | cv2.rectangle(img,(ix,iy),(x,y),(0,255,0),-1) 19 | else: 20 | cv2.circle(img,(x,y),5,(0,0,255),-1) 21 | elif event == cv2.EVENT_LBUTTONUP: 22 | drawing = False 23 | if mode == True: 24 | cv2.rectangle(img,(ix,iy),(x,y),(0,255,0),-1) 25 | else: 26 | cv2.circle(img,(x,y),5,(0,0,255),-1) 27 | img = np.zeros((512,512,3), np.uint8) 28 | cv2.namedWindow('image') 29 | cv2.setMouseCallback('image',draw_circle) 30 | while(1): 31 | cv2.imshow('image',img) 32 | k = cv2.waitKey(1) & 0xFF 33 | if k == ord('m'): # Mod değişimi tuşunun ataması 34 | mode = not mode 35 | elif k == 27: 36 | break 37 | cv2.destroyAllWindows() 38 | -------------------------------------------------------------------------------- /Uygulama-4/daire_ciz.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | 4 | # Mouse kontrol fonkisyonu(mouse callback function) 5 | 6 | def draw_circle(event,x,y,flags,param): 7 | if event == cv2.EVENT_LBUTTONDBLCLK: 8 | cv2.circle(img,(x,y),50,(255,0,0),-1) 9 | 10 | # Siyah bir panel oluştur ve fonksiyonu birleştir 11 | 12 | img = np.zeros((512,512,3), np.uint8) 13 | cv2.namedWindow('image') 14 | cv2.setMouseCallback('image',draw_circle) 15 | while(1): 16 | cv2.imshow('image',img) 17 | if cv2.waitKey(20) & 0xFF == 27: 18 | break 19 | cv2.destroyAllWindows() 20 | -------------------------------------------------------------------------------- /Uygulama-5/TrackBar.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | 4 | def nothing(x): 5 | pass 6 | 7 | # Siyah bir görüntü oluştur: 8 | 9 | img = np.zeros((300,512,3),np.uint8) 10 | cv2.namedWindow('image') 11 | 12 | # Değer Çubuğu(Track Bar) Oluştur: 13 | 14 | cv2.createTrackbar('R','image',0,255,nothing) 15 | cv2.createTrackbar('G','image',0,255,nothing) 16 | cv2.createTrackbar('B','image',0,255,nothing) 17 | 18 | # Anahtar(Switch) Oluştur: AÇ/KAPA özelliği için: 19 | 20 | switch = 'O : KAPA \n1: AC' 21 | cv2.createTrackbar(switch, 'image',0,1,nothing) 22 | 23 | while(1): 24 | cv2.imshow('image',img) 25 | k = cv2.waitKey(1) & 0xFF 26 | if k ==27: 27 | break 28 | 29 | # Oluşturulan Dört Değer Çubuğunun Anlık Durumlarını Tutmak İçin: 30 | 31 | r = cv2.getTrackbarPos('R', 'image') 32 | g = cv2.getTrackbarPos('G', 'image') 33 | b = cv2.getTrackbarPos('B', 'image') 34 | s = cv2.getTrackbarPos('switch', 'image') 35 | 36 | if s == 0: 37 | img[:] = 0 38 | else: 39 | img[:] = [b,g,r] 40 | 41 | cv2.destrowAllWindows() 42 | -------------------------------------------------------------------------------- /Uygulama-6/Figure_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turanerdem/OpenCV-Python/c520d6abdff44cf33f098a12e20f48d32f2ed3bd/Uygulama-6/Figure_1.png -------------------------------------------------------------------------------- /Uygulama-6/opencv1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turanerdem/OpenCV-Python/c520d6abdff44cf33f098a12e20f48d32f2ed3bd/Uygulama-6/opencv1.png -------------------------------------------------------------------------------- /Uygulama-6/padding.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | from matplotlib import pyplot as plt 4 | 5 | # Matplotlib Modülünü Kurmayı Unutmayınız!!! 6 | 7 | BLUE = [255,0,0] 8 | res1= cv2.imread('opencv1.png') 9 | 10 | # Kullanılan Parametreler: 11 | 12 | replicate = cv2.copyMakeBorder(res1,15,15,15,15,cv2.BORDER_REPLICATE) 13 | reflect = cv2.copyMakeBorder(res1,15,15,15,15,cv2.BORDER_REFLECT) 14 | reflect101 = cv2.copyMakeBorder(res1,15,15,15,15,cv2.BORDER_REFLECT_101) 15 | wrap = cv2.copyMakeBorder(res1,15,15,15,15,cv2.BORDER_WRAP) 16 | constant= cv2.copyMakeBorder(res1,15,15,15,15,cv2.BORDER_CONSTANT,value=BLUE) 17 | 18 | # Subplotların Atamaları İçin: 19 | 20 | plt.subplot(231),plt.imshow(res1,'gray'),plt.title('ORIGINAL') 21 | plt.subplot(232),plt.imshow(replicate,'gray'),plt.title('REPLICATE') 22 | plt.subplot(233),plt.imshow(reflect,'gray'),plt.title('REFLECT') 23 | plt.subplot(234),plt.imshow(reflect101,'gray'),plt.title('REFLECT_101') 24 | plt.subplot(235),plt.imshow(wrap,'gray'),plt.title('WRAP') 25 | plt.subplot(236),plt.imshow(constant,'gray'),plt.title('CONSTANT') 26 | plt.show() 27 | -------------------------------------------------------------------------------- /Uygulama-7/görüntüEkleme.py: -------------------------------------------------------------------------------- 1 | img1 = cv2.imread('ml.png') 2 | img2 = cv2.imread('opencv-logo.png') 3 | 4 | # Görüntünün Karıştırma(Blending) İşlemi: 5 | dst = cv2.addWeighted(img1,0.8,img2,0.2,0) 6 | 7 | cv2.imshow('dst',dst) 8 | cv2.waitKey(0) 9 | cv2.destroyAllWindows() 10 | -------------------------------------------------------------------------------- /Uygulama-7/görüntüde_bitWise.py: -------------------------------------------------------------------------------- 1 | # İki Görüntü Yükle: 2 | res1 = cv2.imread('player.jpg') 3 | res2 = cv2.imread('logo.png') 4 | # Sol Üst Köşeye Görüntüyü Yerleştirmek İstiyoruz: 5 | rows,cols,channels = res2.shape 6 | roi = res1[0:rows, 0:cols ] 7 | # Şimdi Bir Maske Oluşturuyoruz, Ve O Maskenin Tersini Oluşturuyoruz: 8 | res2gray = cv2.cvtColor(res2,cv2.COLOR_BGR2GRAY) 9 | ret, mask = cv2.threshold(res2gray, 10, 255, cv2.THRESH_BINARY) 10 | mask_inv = cv2.bitwise_not(mask) 11 | # ROI Üzerindeki Siyah Bölge İçin: 12 | res1_bg = cv2.bitwise_and(roi,roi,mask = mask_inv) 13 | # Görüntü Bölgesinin Alımı: 14 | res2_fg = cv2.bitwise_and(res2,res2,mask = mask) 15 | # Ana Resmi İşliyoruz: 16 | dst = cv2.add(res1_bg,res2_fg) 17 | res1[0:rows, 0:cols ] = dst 18 | cv2.imshow('res',res1) 19 | cv2.waitKey(0) 20 | cv2.destroyAllWindows() 21 | -------------------------------------------------------------------------------- /Uygulama-8/BRG2HSV_NesneTakibi.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | cap = cv2.VideoCapture(0) 4 | while(1): 5 | 6 | # Her görüntü çerçevesini(frame) yakala 7 | _, frame = cap.read() 8 | 9 | # BGR'yi HSV'ye çevir 10 | hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) 11 | 12 | # HSV renk uzayında mavi renk oranını(range) ayarla 13 | lower_blue = np.array([110,50,50]) 14 | upper_blue = np.array([130,255,255]) 15 | 16 | # Görüntüde Mavi Objeye Threshold Uygula 17 | mask = cv2.inRange(hsv, lower_blue, upper_blue) 18 | 19 | # Orjinal Görüntüye Bitwise-AND İşlemini Uygula 20 | res = cv2.bitwise_and(frame,frame, mask= mask) 21 | 22 | cv2.imshow('frame',frame) 23 | cv2.imshow('mask',mask) 24 | cv2.imshow('res',res) 25 | k = cv2.waitKey(5) & 0xFF 26 | if k == 27: 27 | break 28 | cv2.destroyAllWindows() 29 | -------------------------------------------------------------------------------- /Uygulama-9/perspectiveTransformation.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | img = cv2.imread('sudoku_training.png') 3 | 4 | rows,cols,ch = img.shape 5 | pts1 = np.float32([[56,65],[368,52],[28,387],[389,390]]) 6 | pts2 = np.float32([[0,0],[300,0],[0,300],[300,300]]) 7 | 8 | M = cv2.getPerspectiveTransform(pts1,pts2) 9 | dst = cv2.warpPerspective(img,M,(300,300)) 10 | 11 | plt.subplot(121),plt.imshow(img),plt.title('Input') 12 | plt.subplot(122),plt.imshow(dst),plt.title('Output') 13 | plt.show() 14 | -------------------------------------------------------------------------------- /Uygulama-9/rotation(dondurme).py: -------------------------------------------------------------------------------- 1 | import cv2 2 | img = cv2.imread('ogu.jpg',0) 3 | 4 | rows,cols = img.shape 5 | M = cv2.getRotationMatrix2D((cols/2,rows/2),90,1) 6 | dst = cv2.warpAffine(img,M,(cols,rows)) 7 | -------------------------------------------------------------------------------- /Uygulama-9/scaling(olceklendirme).py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | 4 | img = cv2.imread('ogu.jpg') 5 | res = cv2.resize(img,None,fx=2, fy=2, interpolation = cv2.INTER_CUBIC) 6 | 7 | # Veya 8 | 9 | height, width = img.shape[:2] 10 | res = cv2.resize(img,(2*width, 2*height), interpolation = cv2.INTER_CUBIC) 11 | -------------------------------------------------------------------------------- /Uygulama-9/translation(tasima).py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | 4 | img = cv2.imread('ogu.jpg',0) 5 | rows,cols = img.shape 6 | 7 | # Matrisimizi (100,50)(wight,height) şeklinde kaydırıyoruz(Shift): 8 | M = np.float32([[1,0,100],[0,1,50]]) 9 | dst = cv2.warpAffine(img,M,(cols,rows)) 10 | 11 | cv2.imshow('img',dst) 12 | cv2.waitKey(0) 13 | cv2.destroyAllWindows() 14 | --------------------------------------------------------------------------------