Exemplo n.º 1
0
#!/usr/bin/python

import functools
import Image as Img

from Tkinter import *
from ImageTk import PhotoImage
from epuck import Controller

c = Controller('/dev/rfcomm0', asynchronous=True)
c.set_camera(Controller.RGB565_MODE, 40, 40, 8)

root = Tk()
img_camera = Label(root)
img_camera.pack()
img_modified = Label(root)
img_modified.pack()


def hue(r, g, b):
    M = max(r, g, b)
    m = min(r, g, b)
    C = M - m

    if C == 0:
        return None
    if M == r:
        h = float(g - b) / C % 6
    elif M == g:
        h = float(b - r) / C + 2
    elif M == b:
Exemplo n.º 2
0
#!/usr/bin/python

import functools
import Image as Img

from Tkinter import *
from ImageTk import PhotoImage
from epuck import Controller

c = Controller('/dev/rfcomm0', asynchronous=True)
c.set_camera(Controller.RGB565_MODE, 40, 40, 8)

root = Tk()
img_camera = Label(root)
img_camera.pack()
img_modified = Label(root)
img_modified.pack()

def hue(r, g, b):
    M = max(r, g, b)
    m = min(r, g, b)
    C = M - m

    if C == 0:
        return None
    if M == r:
        h = float(g-b)/C % 6
    elif M == g:
        h = float(b-r)/C + 2
    elif M == b:
        h = float(r-g)/C + 4