本文整理汇总了Python中SimpleCV.Image.morphGradient方法的典型用法代码示例。如果您正苦于以下问题:Python Image.morphGradient方法的具体用法?Python Image.morphGradient怎么用?Python Image.morphGradient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleCV.Image
的用法示例。
在下文中一共展示了Image.morphGradient方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import morphGradient [as 别名]
from SimpleCV import Image, Camera, Display, Image, Color
import time
import matplotlib.pyplot as plt
import numpy as np
imagen=Image('/home/pi/lunar_con_pelos.png')
#imagen.show()
#se prueba distintos metodos para ver si detecta los bellos en la piel
ed=imagen.edges()
edg=imagen+ed
edg.save('bordes_edge.png')
grad = imagen.morphGradient()
grd = imagen+grad
grd.save('bordes_gradiente.png')
lineas=imagen.findLines()
lineas.draw(Color.RED,width=3)
#imagen.show()
imagen.save("linbeas.png")
resu = imagen.resize(320,240) #se redefine la imagen para que tenga un menor tiempo
#de procesamiento
gray=resu.grayscale()
inv=gray.invert()
sumimg=resu+inv
res=(resu*1.5)-(gray/2)
res.save('muestras/imagen_tratada.png')
示例2: Image
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import morphGradient [as 别名]
#!/usr/bin/python
from SimpleCV import Camera, Display, Image
img = Image("img4.png")
imggray = img.grayscale().save("img4gray.png")
imggray = Image("img4gray.png")
(red, green, blue) = img.splitChannels(False)
# Edge detection with diferents algorithms on SCV.
# "Edges" Command.
imggray_edge = imggray.edges().save("img4gray_edges.png")
red_edge = red.edges().save("img4red_edges.png")
green_edge = green.edges().save("img4green_edges.png")
blue_edge = blue.edges().save("img4blue_edges.png")
# "morphGradient" Command
imggray_edge = imggray.morphGradient().save("img4gray_edges_morphGradient.png")
red_edge = red.morphGradient().save("img4red_edges_morphGradient.png")
green_edge = green.morphGradient().save("img4green_edges_morphGradient.png")
blue_edge = blue.morphGradient().save("img4blue_edges_morphGradient.png")
# "sobel" Command
imggray_edge = imggray.sobel().save("img4gray_edges_sobel.png")
red_edge = red.sobel().save("img4red_edges_sobel.png")
green_edge = green.sobel().save("img4green_edges_sobel.png")
blue_edge = blue.sobel().save("img4blue_edges_sobel.png")