- added parameter for connection address
git-svn-id: http://moon:8086/svn/software/trunk/projects/opencv@342 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+5
-3
@@ -12,7 +12,6 @@ import pprint
|
|||||||
import math
|
import math
|
||||||
import struct
|
import struct
|
||||||
import ev3.ev3 as ev3
|
import ev3.ev3 as ev3
|
||||||
from threading import Thread
|
|
||||||
|
|
||||||
from matplotlib import pyplot as plt
|
from matplotlib import pyplot as plt
|
||||||
from mpl_toolkits.mplot3d import Axes3D
|
from mpl_toolkits.mplot3d import Axes3D
|
||||||
@@ -30,7 +29,9 @@ ap.add_argument("-n", "--seconds", type=int, default=10,
|
|||||||
ap.add_argument("-r", "--framerate", type=int, default=30,
|
ap.add_argument("-r", "--framerate", type=int, default=30,
|
||||||
help="Framerate in frame/s")
|
help="Framerate in frame/s")
|
||||||
ap.add_argument("-e", "--with-ev3", type=str, default='off',
|
ap.add_argument("-e", "--with-ev3", type=str, default='off',
|
||||||
help="Framerate in frame/s")
|
help="Connect to ev3")
|
||||||
|
ap.add_argument("-c", "--conn-addr", type=str, default='127.0.0.1:5555',
|
||||||
|
help="Connection dev to ev3")
|
||||||
ap.add_argument("-f", "--filename", type=str, default='piCamera',
|
ap.add_argument("-f", "--filename", type=str, default='piCamera',
|
||||||
help="Choose video source")
|
help="Choose video source")
|
||||||
ap.add_argument("-x", "--width", type=int, default=320,
|
ap.add_argument("-x", "--width", type=int, default=320,
|
||||||
@@ -45,6 +46,7 @@ seconds = args["seconds"]
|
|||||||
with_ev3 = args["with_ev3"] == 'on'
|
with_ev3 = args["with_ev3"] == 'on'
|
||||||
width = args["width"]
|
width = args["width"]
|
||||||
height = args["height"]
|
height = args["height"]
|
||||||
|
connAddr = args["conn_addr"]
|
||||||
|
|
||||||
class MyRgbProcess(RgbProcess):
|
class MyRgbProcess(RgbProcess):
|
||||||
def __init__(self, name, resolution=(320, 240, 3), numEntries=2, next=None, brick=None):
|
def __init__(self, name, resolution=(320, 240, 3), numEntries=2, next=None, brick=None):
|
||||||
@@ -146,7 +148,7 @@ class MyRgbProcess(RgbProcess):
|
|||||||
|
|
||||||
if with_ev3:
|
if with_ev3:
|
||||||
# Connect to brick
|
# Connect to brick
|
||||||
with ev3.EV3() as brick:
|
with ev3.EV3(connAddr) as brick:
|
||||||
|
|
||||||
videoSource = VideoSource(videoFile, (width, height,3), framerate)
|
videoSource = VideoSource(videoFile, (width, height,3), framerate)
|
||||||
proc = MyRgbProcess('MyRgbProcess', (width, height, 3), 4, brick=brick)
|
proc = MyRgbProcess('MyRgbProcess', (width, height, 3), 4, brick=brick)
|
||||||
|
|||||||
Reference in New Issue
Block a user