Ejemplo n.º 1
0
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')
#!/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")