Python - Bothat

 
Vista:

Bothat

Publicado por Geomata (21 intervenciones) el 12/01/2021 10:06:27
1
2
3
4
5
6
7
8
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
img1 = cv.imread('medialuna.jpg',0)
ret,img1 = cv.threshold (img1,0,255,cv.THRESH_OTSU)
kernel = cv.getStructuringElement (cv.MORPH_CROSS,(4,4))
bothat = cv.morphologyEx(img1,cv.MORPH_BLACKHAT,kernel)
plt.imshow(bothat,cmap='gray')
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder