This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Tkinter import * | |
from sys import argv | |
import math | |
import sys, string | |
cam = list() | |
codigos = list() | |
frec = list() | |
simbolos = {} | |
arbol_fin ='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def histo_agujero(): | |
image = argv[1] | |
im = Image.open(image) | |
imagen=im.load() | |
ancho, alto = im.size | |
#ima, nueva = pixeleg() | |
histoh = [] | |
histov = [] | |
#pixel_horizontal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def histo_agujero(): | |
image = argv[1] | |
im = Image.open(image) | |
imagen=im.load() | |
ancho, alto = im.size | |
#ima, nueva = pixeleg() | |
histoh = [] | |
histov = [] | |
#pixel_horizontal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |