Skip to content

Instantly share code, notes, and snippets.

def im2():
image = Image.open('binarizada1.png')
imagen = image.load()
ancho,alto = image.size
print ancho
print alto
for a in range(ancho):
for b in range(alto):
color=(random.randint(0,255),random.randint(0,255),random.randint(0,255))
@vane90
vane90 / pgris.py
Last active December 13, 2015 22:19
def im2():
image = Image.open('binarizada2.png') #carca la imagen con convolucion y binarizada
imagen = image.load()
ancho,alto = image.size
total = ancho*alto
porcentaje = []
centro = []
contiene = 0
print ancho
print alto
@vane90
vane90 / bfs2.py
Last active December 13, 2015 22:19
import sys, pygame
import Image
from math import*
from time import*
import math
import random
import ImageDraw
def im2():
image = Image.open('binarizada2.png') #carca la imagen con convolucion y binarizada
imagen = image.load()
@vane90
vane90 / moore.py
Last active December 14, 2015 01:19
from sys import argv
import random
import time
n=int(argv[1]) #recibe parametros n= longitud de cadena donde se busca
m=int(argv[2]) #recibe parametros m=longitud de patron a buscar
def generan(tam): #Funcion para generar patron o texto
x=[] #Variable para guardar el texto o patron a generar
for i in range(tam):
import Image
from sys import argv
import ImageDraw
TURN_LEFT, TURN_RIGHT, TURN_NONE = (1, -1, 0)
def turn(p, q, r):
return cmp((q[0] - p[0])*(r[1] - p[1]) - (r[0] - p[0])*(q[1] - p[1]), 0)
#distancias entre p y q
import sys, pygame
import Image
from sys import argv
from math import sqrt, sin, cos, fabs
import numpy
from time import*
import math
def main():
pygame.init() # Inicializa pygame
def circulos():
ima1 = Image.open("vane2.jpg")
imagen = ima1.load()
radio = int(argv[1])
ancho,alto = ima1.size
#frec = list()
frec = numpy.empty((ancho, alto)) #frecuecia en centros
#frec = []
@vane90
vane90 / tarea3.py
Last active December 16, 2015 02:39
from Tkinter import *
from sys import argv
import math
import sys, string
cam = list()
codigos = list()
frec = list()
simbolos = {}
arbol_fin =''
@vane90
vane90 / info3.py
Last active December 16, 2015 02:39
from Tkinter import *
from sys import argv
import math
import sys, string
cam = list()
codigos = list()
frec = list()
simbolos = {}
arbol_fin =''
import Image
from math import*
from time import*
import math
import random
import ImageDraw
#Aplica bfs
def im2():
image = Image.open('binarizada.png') #carca la imagen con convolucion y binarizada