Skip to content

Instantly share code, notes, and snippets.

def toma_lineas(pendiente,img):
segmento=list()
imagen=img.load()
ancho,alto=img.size
for a in range(ancho):
for b in range(alto):
if imagen[a,b]!=(0,0,0):
pendiente_2=pendiente[a,b]
if pendiente[a,b]==0:
import Image, ImageDraw
from sys import argv
import random
import matplotlib.pyplot as plt
from numpy import *
def cruz_histo(image):
imagen = image.load()
ancho, alto = image.size
histov = []
def graficar_histo(histoh,histov,image):
plt.clf()
fig1=plt.subplot(111)
nivel_x=max(histoh)
nivel_y=max(histov)
ancho,alto=image.size
if ancho>alto:
n=ancho
else:
n=alto
from Tkinter import *
from sys import argv
import math
import sys, string
cam = list()
codigos = list()
frec = list()
simbolos = {}
arbol_fin =''
def minimos_pix(vechisto):
minimo = list()
media = sum(vechisto)/len(vechisto)
print media
for a in range(1, len(vechisto)-1):
if vechisto[a-1] > vechisto[a] and vechisto[a+1] > vechisto[a]:
if(vechisto[a] < media):
minimo.append(vechisto[a])
return minimo
def histo_agujero():
image = argv[1]
im = Image.open(image)
imagen=im.load()
ancho, alto = im.size
#ima, nueva = pixeleg()
histoh = []
histov = []
#pixel_horizontal
def histo_agujero():
image = argv[1]
im = Image.open(image)
imagen=im.load()
ancho, alto = im.size
#ima, nueva = pixeleg()
histoh = []
histov = []
#pixel_horizontal
def binarizar():
#inicio = time()
image1 = Image.open("conv.png")
pixels = image1.load()
ancho,alto = image1.size
minimo = int(argv[2])
for i in range(ancho):
for j in range(alto):
if pixels[i,j][1] < minimo:
p=0
def bfs(image,color,a,b): #para detectar por formas
imagen=image.load()
ancho,alto=image.size
original = imagen[a,b]
#punto=[]
c=[]
xs=[]
ys=[]
c.append((a,b))
n = 0
import pygame, sys, os
from pygame.locals import *
from sys import argv
import Image
import ImageDraw
def pixeleg():
#image = argv[1]
im = Image.open(image)