Beispiel #1
0
def video():
	
	Gray_1 = cv2.cvtColor(Video.read()[1], cv2.COLOR_BGR2GRAY)
	img = PhotoImage(Gray_1)
	cv2.imshow('',img)
def start():
	print 'hai'
	##video()
	#pass
	
	
def stop():
	pass

Video = cv2.VideoCapture(0)
t = repeatedTimer(0,video)


window=Tk()
window.title('biscuit gui')
window.geometry('600x600') 

win=Frame(window)
win.pack(side='bottom')

canvas=Canvas(window,width=300,height=300)
canvas.config(bg='white')
canvas.pack(side='left')
canvas.bind=("<Button-1>", video())

button1 = Button(win, text="START", width=8,command=video)
Beispiel #2
0
#   Create a list for x axis(0 to 100)
xAxis = pylab.arange(0, 100, 1)
#   Create a list for y axis(100 elements)
yAxis = pylab.array([0]*100)
#   Create a figure
figure1 = pylab.figure(1)
#   Create an axis
axis1 = figure1.add_subplot(111)
#   For axis grid
axis1.grid(True)
# Title
axis1.set_title("Mean value per Frame")
#   x- label
axis1.set_xlabel("Frame")
#   Y- label
axis1.set_ylabel("Mean value")
#   Set axis size as 100 x 255
axis1.axis([0, 100, 0, 255])
#    plot  graph
plot1 = axis1.plot(xAxis, yAxis, 'o-', color='r', markersize=2)

manage = pylab.get_current_fig_manager()
#   Create list for store values
values = [0 for x in range(100)]
#   Create Timer_1
timer1 = repeatedTimer(.1, GraphPlot, ())
#   To start Timer_1
timer1.start()
#   To show plotted graph
pylab.show()
Beispiel #3
0
__author__ = 'subin'

from repeated_timer import repeatedTimer
def Print():
    print('hai')
def Print2():
    print(' Subin')
t1 = repeatedTimer(1, Print)
t1.start()
t2 = repeatedTimer(.1, Print2)
t2.start()
Beispiel #4
0
window = Tk()
window.geometry('850x450')

#values = [0 for x in range(100)]

videoFigure = Figure(figsize=(5, 4), dpi=80)
axis1 = videoFigure.add_subplot(111)
axis1.set_title('Video frame')
canvas1 = FigureCanvasTkAgg(videoFigure, master=window)
canvas1.show()
canvas1.get_tk_widget().place(x=10, y=10)

#Figure = Figure(figsize=(5, 4), dpi=80)
#axis2 = plotFigure.add_subplot(111)
#axis2.grid(True)
#axis2.set_title("Mean value per Frame")
#canvas2 = FigureCanvasTkAgg(plotFigure, master=window)
#canvas2.show()
#canvas2.get_tk_widget().place(x=300, y=10)

#axis2.axis([0, 100, 0, 255])
#plotGraph = axis2.plot(xAxis, yAxis, 'o-', color='r', markersize=2)

#timer1 = repeatedTimer(.01, GraphPlot)
timer2 = repeatedTimer(.01, VideoPlot)

window.mainloop()



Beispiel #5
0
def StartButton():
    global timer1, timer2, timer3
    timer1 = repeatedTimer(0.1, GraphPlot)
    timer2 = repeatedTimer(0.1, VideoPlot)
    timer3 = repeatedTimer(0.1, TablePlot)
Beispiel #6
0
import cv2
import matplotlib
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
import Tkinter as Tk

from repeated_timer import repeatedTimer
matplotlib.use('TkAgg')
import pylab


def Video():
    image1 = video.read(0)[1]
    axis1.imshow(image1)
    canvas1 = FigureCanvasTkAgg(videoFigure, master=window)
    canvas1.show()
    canvas1.get_tk_widget().pack(side=Tk.LEFT, fill=Tk.BOTH, expand=1)
    canvas1._tkcanvas.pack(side=Tk.LEFT, fill=Tk.BOTH, expand=1)

video = cv2.VideoCapture(0)
window = Tk.Tk()
window.title("test_Gui")
window.geometry('500x500')
videoFigure = Figure(figsize=(5,4), dpi=100)
axis1 = videoFigure.add_subplot(111)
axis1.set_title("Test Frame")

timer1 = repeatedTimer(.1, Video)
timer1.start()

Tk.mainloop()
Beispiel #7
0
def StartButton():
    global timer1, timer2, timer3
    timer1 = repeatedTimer(.1, GraphPlot)
    timer2 = repeatedTimer(.1, VideoPlot)
    timer3 = repeatedTimer(.1, TablePlot)
Beispiel #8
0
#video = cv2.VideoCapture(0)
#gray1 = cv2.cvtColor(video.read(0)[1], cv2.COLOR_BGR2GRAY)
window = Tk()
window.geometry('850x450')

#values = [0 for x in range(100)]

videoFigure = Figure(figsize=(5, 4), dpi=80)
axis1 = videoFigure.add_subplot(111)
axis1.set_title('Video frame')
canvas1 = FigureCanvasTkAgg(videoFigure, master=window)
canvas1.show()
canvas1.get_tk_widget().place(x=10, y=10)

#Figure = Figure(figsize=(5, 4), dpi=80)
#axis2 = plotFigure.add_subplot(111)
#axis2.grid(True)
#axis2.set_title("Mean value per Frame")
#canvas2 = FigureCanvasTkAgg(plotFigure, master=window)
#canvas2.show()
#canvas2.get_tk_widget().place(x=300, y=10)

#axis2.axis([0, 100, 0, 255])
#plotGraph = axis2.plot(xAxis, yAxis, 'o-', color='r', markersize=2)

#timer1 = repeatedTimer(.01, GraphPlot)
timer2 = repeatedTimer(.01, VideoPlot)

window.mainloop()
Beispiel #9
0
videoFigure = Figure(figsize=(5,4), dpi=100)
axis1 = videoFigure.add_subplot(111)
axis1.set_title("Frame")

xAxis = pylab.arange(0, 100, 1)
yAxis = pylab.array([0]*100)
graphFigure = Figure(figsize=(5,4), dpi=100)
axis2 = graphFigure.add_subplot(111)
axis2.grid(True)
axis2.set_title("Mean value per Frame")
axis2.set_xlabel("Frame")
axis2.set_ylabel("Mean value")
axis2.axis([0, 100, 0, 255])
plotGraph = axis2.plot(xAxis, yAxis, 'o-', color='r', markersize=2)
manage = pylab.get_current_fig_manager()
values = [0 for x in range(100)]

tableFigure = Figure(figsize=(5, 4), dpi=100)
axis3 = tableFigure.add_subplot(111)
axis3.set_title("Table")

window = Tk.Tk()
window.title("test_Gui")

#while True:
GraphPlot(0)
t1 = repeatedTimer(.1, GraphPlot(0))
t1.start()
#~ Tk.mainloop()
Beispiel #10
0
video = cv2.VideoCapture(0)
gray1 = cv2.cvtColor(video.read(0)[1], cv2.COLOR_BGR2GRAY)
window = Tk()
window.geometry('1000x500')

values = [0 for x in range(100)]

videoFigure = Figure(figsize=(5, 4), dpi=80)
axis1 = videoFigure.add_subplot(111)
axis1.set_title('Video frame')
canvas1 = FigureCanvasTkAgg(videoFigure, master=window)
canvas1.get_tk_widget().place(x=10, y=10)

plotFigure = Figure(figsize=(5, 4), dpi=80)
axis2 = plotFigure.add_subplot(111)
axis2.grid(True)
axis2.set_title("Mean value per Frame")
canvas2 = FigureCanvasTkAgg(plotFigure, master=window)
canvas2.show()
canvas2.get_tk_widget().place(x=500, y=10)

axis2.axis([0, 100, 0, 255])
plotGraph = axis2.plot(xAxis, yAxis, 'o-', color='r', markersize=2)

timer = repeatedTimer(0.01, Video)
window.mainloop()



Beispiel #11
0
#   Create a list for x axis(0 to 100)
xAxis = pylab.arange(0, 100, 1)
#   Create a list for y axis(100 elements)
yAxis = pylab.array([0] * 100)
#   Create a figure
figure1 = pylab.figure(1)
#   Create an axis
axis1 = figure1.add_subplot(111)
#   For axis grid
axis1.grid(True)
# Title
axis1.set_title("Mean value per Frame")
#   x- label
axis1.set_xlabel("Frame")
#   Y- label
axis1.set_ylabel("Mean value")
#   Set axis size as 100 x 255
axis1.axis([0, 100, 0, 255])
#    plot  graph
plot1 = axis1.plot(xAxis, yAxis, 'o-', color='r', markersize=2)

manage = pylab.get_current_fig_manager()
#   Create list for store values
values = [0 for x in range(100)]
#   Create Timer_1
timer1 = repeatedTimer(.1, GraphPlot, ())
#   To start Timer_1
timer1.start()
#   To show plotted graph
pylab.show()
Beispiel #12
0
import matplotlib
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
import Tkinter as Tk

from repeated_timer import repeatedTimer
matplotlib.use('TkAgg')
import pylab


def Video():
    image1 = video.read(0)[1]
    axis1.imshow(image1)
    canvas1 = FigureCanvasTkAgg(videoFigure, master=window)
    canvas1.show()
    canvas1.get_tk_widget().pack(side=Tk.LEFT, fill=Tk.BOTH, expand=1)
    canvas1._tkcanvas.pack(side=Tk.LEFT, fill=Tk.BOTH, expand=1)


video = cv2.VideoCapture(0)
window = Tk.Tk()
window.title("test_Gui")
window.geometry('500x500')
videoFigure = Figure(figsize=(5, 4), dpi=100)
axis1 = videoFigure.add_subplot(111)
axis1.set_title("Test Frame")

timer1 = repeatedTimer(.1, Video)
timer1.start()

Tk.mainloop()