Rose-Hulman Robotics Team

Changeset 713

Show
Ignore:
Timestamp:
03/03/10 01:43:17 (2 years ago)
Author:
mosttw
Message:

First step in implementing image processing in C: sobelizing

Location:
trunk/software/rb/vision
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/software/rb/vision/_camera.c

    r667 r713  
    359359                "Save an image using the ``cvSaveImage()`` function.  " 
    360360                "The file type will be taken from the extension in the " 
    361                 "given filename --- use ``.jpg`` or ``.png``."}, 
     361                "given filename --- use ``.jpg`` or ``.png``.\n\n" 
     362                "Arguments: string filename, IplImage."}, 
    362363        {"ipl_image_from_rgb_buffer", _camera_ipl_image_from_rgb_buffer, METH_VARARGS, 
    363364                "Produce a BGR IplImage from an RGB buffer.  Takes two " 
  • trunk/software/rb/vision/gstcam.py

    r667 r713  
    3232                self.controller = controller 
    3333                self.source = source 
     34                self.state = 'Initializing' 
    3435                self.running = True 
    3536                launch_string = ( 
     
    4647                bus.add_signal_watch() 
    4748                bus.connect('message', self.message_cb) 
     49                self._start_playback() 
    4850                 
    49                 self.pipeline.set_state(gst.STATE_PLAYING) 
    50  
    5151                if self.controller is not None: 
    5252                        gobject.timeout_add(100, self._send_image) 
    5353         
     54        def _start_playback(self): 
     55                self.state = 'Starting' 
     56                self.pipeline.set_state(gst.STATE_PLAYING) 
     57 
    5458        def _send_image(self): 
    5559                image = self.get_last_image() 
    5660                if image is not None: 
     61                        self.status = 'Capturing' 
    5762                        self.controller.send('camera_image', (self.source, image)) 
    5863                return True # Call me again 
     
    7075                        msg, details = message.parse_error() 
    7176                        logger.error("%s\n%s", msg, details) 
     77                        self.state = 'Error %s' % (msg,) 
    7278                        self.pipeline.set_state(gst.STATE_NULL) # Stop playback 
    7379 
  • trunk/software/rb/vision/makefile

    r667 r713  
    1 CFLAGS   = -p -pg -g -Wall -Werror -Wno-unused -pedantic -fPIC --std=gnu99 -fgnu89-inline -O3 $(shell pkg-config --cflags opencv gsl glib-2.0 gobject-2.0) 
    2 #CFLAGS   = -p -pg -g -Wall -Werror -pedantic -fPIC -O3 $(shell pkg-config --cflags opencv gsl) 
    3 CPPFLAGS = -p -pg -g -Wall -Werror -Wno-unused -pedantic -fPIC -O3 $(shell pkg-config --cflags opencv gsl) 
    4 LDFLAGS  = $(shell pkg-config --libs opencv gsl) 
    5 DLFLAGS  = -shared -nostartfiles 
    6 PYFLAGS  = -pthread -fno-strict-aliasing -fwrapv -I/usr/include/python2.6/ $(shell pkg-config --cflags gtk+-2.0 pygtk-2.0 pygobject-2.0) 
    7 PYLIBS   = -lpython2.6 $(shell pkg-config --libs gtk+-2.0 pygtk-2.0 pygobject-2.0) 
     1CFLAGS   := -p -pg -g -Wall -Werror -Wno-unused -pedantic -fPIC --std=gnu99 -fgnu89-inline -O3 $(shell pkg-config --cflags opencv gsl glib-2.0 gobject-2.0) 
     2#CFLAGS   := -p -pg -g -Wall -Werror -pedantic -fPIC -O3 $(shell pkg-config --cflags opencv gsl) 
     3CPPFLAGS := -p -pg -g -Wall -Werror -Wno-unused -pedantic -fPIC -O3 $(shell pkg-config --cflags opencv gsl) 
     4LDFLAGS  := $(shell pkg-config --libs opencv gsl) 
     5DLFLAGS  := -shared -nostartfiles 
     6PYFLAGS  := -pthread -fno-strict-aliasing -fwrapv -I/usr/include/python2.6/ $(shell pkg-config --cflags gtk+-2.0 pygtk-2.0 pygobject-2.0) 
     7PYLIBS   := -lpython2.6 $(shell pkg-config --libs gtk+-2.0 pygtk-2.0 pygobject-2.0) 
    88 
    9 PROG=main 
    10 OBJS=vision.o classify.o classify_hard.o classify_dtree.o classify_svm.o pathplan.o 
    11 LIBS=_camera.so _calibrate.so 
     9PROG := main 
     10OBJS := vision.o classify.o classify_hard.o classify_dtree.o classify_svm.o pathplan.o 
     11LIBS := _camera.so _calibrate.so _processing.so 
    1212 
    1313all: $(LIBS) $(PROG)