def main():
    p = optparse.OptionParser(usage="Usage: %prog [ options ] <xres> <yres>\n"
      "This program displays a live image of your camera")

    add_common_options(p)

    p.add_option("-o", "--offset", default = "0x0", dest="offset",
            help="Offset in pixels [%default]")
    p.add_option("-b", "--color-coding", default="Y8", dest="cc",
            help="Color coding for acquistion [%default]")
    options, args = p.parse_args()

    if len(args) != 2:
        p.error("Need x and y resolution!")

    l = DC1394Library()
    cam = handle_common_options(options,l)

    m, = filter(lambda m: m.name == "FORMAT7_0", cam.modes)
    cam.mode = m

    size = map(int, args)
    offset = map(int, options.offset.split('x'))
    cc = options.cc

    m.setup(size, offset, cc)

    if cam:
        app = QApplication(args)
        w1 = LiveCameraWin(cam); w1.show(); w1.raise_()
        sys.exit(app.exec_())
def main():
    p = optparse.OptionParser(usage="Usage: %prog [ options ]\n"
      "Acquires 25 pictures and exits.")

    add_common_options(p)

    options, args = p.parse_args()

    l = DC1394Library()
    cam = handle_common_options(options,l)

    if cam:
        print "Starting camera in normal mode. We need to process all pictures!"
        cam.start(interactive=False)

        print "Better be quick now! All images are saved in a Queue object, if we"
        print "are not fast enough in acquisition, the queue will overrun and"
        print "the program will crash."

        print "Acquiring 25 images"
        for idx in range(1,26):
            i = cam.shot()
            print "The last picture %i was acquired at: " % idx, i.timestamp

        cam.stop()

        print "All done."
Exemple #3
0
def run():
    """ parses command line args; adds to options defined in pydc/cmdline.py """

    usage = "usage: %prog [options] file"
    parser = OptionParser(usage)
    add_common_options(parser)

    parser.add_option("-v", "--verbosity", dest="verbosity",
            help="set stdout verbosity (0: critical, 1: error, 2: warning, 3: info, 4: debug)",
            type="int")
    parser.add_option("-n", "--modules", dest="nr_modules", default=1,
            help="set number of pipeline stages to run (1: edge detection; 2: ellipse fitting; 3: pose-1; 4: identify markers; 5: pose-2; 6: register data), default is all",
            type="int")
    parser.add_option("-s", "--simulate", dest="simulate",
            help="set simulation mode (-2: linear generated markers; -1: random generated markers; 0<:preset marker configurations by index nr)",
            type="int")
    parser.add_option("-w", "--windows", dest="windows",
            help="set image display (0: off; 1: on [default])",
            type="int")
    parser.add_option("-d", "--disk", dest="disk",
            help="load marker poses from disk (0: off [default]; 1: on)",
            type="int")
    parser.add_option("-t", "--simtime", dest="simtime",
            help="number of seconds to run simulation (default: 60)",
            type="int")

    (options, args) = parser.parse_args()

    if not options.verbosity:
        options.verbosity = 2

    if not options.simulate:
        options.simulate = 0

    return options, args
Exemple #4
0
def main():
    p = optparse.OptionParser(
        usage="Usage: %prog [ options ]\n" "This program lets the camera run in free running mode."
    )

    add_common_options(p)

    options, args = p.parse_args()

    l = DC1394Library()
    cam = handle_common_options(options, l)

    if cam:
        print "Starting camera in free running mode!"
        cam.start(interactive=True)

        print "We can now do whatever we want, the camera is acquiring"
        print "frames in the background in another thread. Let's sleep a while"
        for i in range(10, -1, -1):
            print i
            time.sleep(1)
            print "The last picture was acquired at: ", cam.current_image.timestamp

        cam.stop()

        print "All done."
Exemple #5
0
def run():
    """ parses command line args; adds to options defined in pydc/cmdline.py """

    usage = "usage: %prog [options] file"
    parser = OptionParser(usage)
    add_common_options(parser)

    parser.add_option(
        "-v",
        "--verbosity",
        dest="verbosity",
        help=
        "set stdout verbosity (0: critical, 1: error, 2: warning, 3: info, 4: debug)",
        type="int")
    parser.add_option(
        "-n",
        "--modules",
        dest="nr_modules",
        default=1,
        help=
        "set number of pipeline stages to run (1: edge detection; 2: ellipse fitting; 3: pose-1; 4: identify markers; 5: pose-2; 6: register data), default is all",
        type="int")
    parser.add_option(
        "-s",
        "--simulate",
        dest="simulate",
        help=
        "set simulation mode (-2: linear generated markers; -1: random generated markers; 0<:preset marker configurations by index nr)",
        type="int")
    parser.add_option("-w",
                      "--windows",
                      dest="windows",
                      help="set image display (0: off; 1: on [default])",
                      type="int")
    parser.add_option(
        "-d",
        "--disk",
        dest="disk",
        help="load marker poses from disk (0: off [default]; 1: on)",
        type="int")
    parser.add_option("-t",
                      "--simtime",
                      dest="simtime",
                      help="number of seconds to run simulation (default: 60)",
                      type="int")

    (options, args) = parser.parse_args()

    if not options.verbosity:
        options.verbosity = 2

    if not options.simulate:
        options.simulate = 0

    return options, args
def main():
    p = optparse.OptionParser(usage="Usage: %prog [ options ]\n"
      "This program displays a live image of your camera")

    add_common_options(p)

    options, args = p.parse_args()

    l = DC1394Library()
    cam = handle_common_options(options,l)

    if cam:
        app = QApplication(args)
        w1 = LiveCameraWin(cam); w1.show(); w1.raise_()
        sys.exit(app.exec_())
def main():
    p = optparse.OptionParser(usage="Usage: %prog [ options ]\n"
      "This program displays a live image of your camera")

    add_common_options(p)

    options, args = p.parse_args()

    l = DC1394Library()
    cam = handle_common_options(options,l)

    if cam:
        app = wx.PySimpleApp()
        LiveCameraDisplay(cam)
        app.MainLoop()