Skip to content

Instantly share code, notes, and snippets.

View kscottz's full-sized avatar
💭
🐀 🫡 🛠️

Katherine Scott kscottz

💭
🐀 🫡 🛠️
View GitHub Profile
@kscottz
kscottz / gist:1284737
Created October 13, 2011 16:40
Every OpenCV Function in the Python Bindings for OpenCV 2.3.1
[('ADAPTIVE_THRESH_GAUSSIAN_C', 1L)
('ADAPTIVE_THRESH_MEAN_C', 0L)
('ANN_MLP', <built-in function ANN_MLP>)
('ANN_MLP_GAUSSIAN', 2L)
('ANN_MLP_IDENTITY', 0L)
('ANN_MLP_NO_INPUT_SCALE', 2L)
('ANN_MLP_NO_OUTPUT_SCALE', 4L)
('ANN_MLP_SIGMOID_SYM', 1L)
('ANN_MLP_TRAIN_PARAMS_BACKPROP', 0L)
('ANN_MLP_TRAIN_PARAMS_RPROP', 1L)
Katherine-Scotts-MacBook-Air:tesseract-3.00 katherinescott$ makemake all-recursive
Making all in ccstruct
/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I../ccutil -I../cutil -I../image -I../viewer -I/sw/include -arch i386 -arch x86_64 -MT blobbox.lo -MD -MP -MF .deps/blobbox.Tpo -c -o blobbox.lo blobbox.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I../ccutil -I../cutil -I../image -I../viewer -I/sw/include -arch i386 -arch x86_64 -MT blobbox.lo -MD -MP -MF .deps/blobbox.Tpo -c blobbox.cpp -fno-common -DPIC -o .libs/blobbox.o
g++-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
make[3]: *** [blobbox.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Katherine-Scotts-MacBook-Air:tesseract-3.00 katherinescott$ make ARCHFLAGS="-arch i386 -arch x86_64"
atherine-Scotts-MacBook-Air:SimpleCV katherinescott$ git pull origin kscottz
From github.com:/ingenuitas/SimpleCV
* branch kscottz -> FETCH_HEAD
CONFLICT (rename/delete): Rename SimpleCV/BOFFeatureExtractor.py->SimpleCV/Analysis/BOFFeatureExtractor.py in HEAD and deleted in dabab39a9e954a09520cffbd434efac5bb1192fe
CONFLICT (rename/delete): Rename SimpleCV/ColorSegmentation.py->SimpleCV/Segmentation/ColorSegmentation.py in HEAD and deleted in dabab39a9e954a09520cffbd434efac5bb1192fe
CONFLICT (rename/delete): Rename SimpleCV/DiffSegmentation.py->SimpleCV/Segmentation/DiffSegmentation.py in HEAD and deleted in dabab39a9e954a09520cffbd434efac5bb1192fe
CONFLICT (rename/delete): Rename SimpleCV/EdgeHistogramFeatureExtractor.py->SimpleCV/Analysis/EdgeHistogramFeatureExtractor.py in HEAD and deleted in dabab39a9e954a09520cffbd434efac5bb1192fe
CONFLICT (rename/delete): Rename SimpleCV/FeatureExtractorBase.py->SimpleCV/Analysis/FeatureExtractorBase.py in HEAD and deleted in dabab39a9e954a09520cffbd434efa
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * Arithmetic Operations * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Notation: OR == alt // the same
seq + seq:
(a; b; c) + (x; y; z) = (a+x; b+y; c+z)
(a; b; c) + (x; y) = (a+x; b+y; c)
(a; b) + (x; y; z) = (a+x; b+y; z)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * Arithmetic Operations * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Notation: OR == alt // the same
seq + seq:
(a; b; c) + (x; y; z) = (a+x; b+y; c+z)
(a; b; c) + (x; y) = (a+x; b+y; c)
(a; b) + (x; y; z) = (a+x; b+y; z)
def createBinaryMask(self, rgb_color=(128,128,128),color1=None,color2=None):
"""
Generate a binary mask of the image based on either a hue or an rgb triplet.
A binary mask is a black and white image where the white area is kept and the
black area is removed.
We have two modes of operation, one where you can select a single color
by specifying it as
rgb_color - a single color mask.
#cluster overlapping template matches
finalfs = FeatureSet()
finalfs.append(fs[0])
for f in fs:
match = False
for f2 in finalfs:
if( f2.overlaps(f) ): #if they overlap
f2.consume(f) #merge them
match = True
break
SimpleCV:27>img = cam.getImage().scale(.4)
SimpleCV:28>img.show()
SimpleCV:28><SimpleCV.Display.Display instance at 0x101464998>
SimpleCV:29>bc = img.findBarcode()
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/zxing/client/j2se/CommandLineRunner
Caused by: java.lang.ClassNotFoundException: com.google.zxing.client.j2se.CommandLineRunner
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
impleCV:1>cam = Camera(1)
SimpleCV:2>img = cam.getImage().scale(.4)
SimpleCV:3>img.show()
SimpleCV:3><SimpleCV.Display.Display instance at 0x107d69908>
SimpleCV:4>img = cam.getImage().scale(.4)
SimpleCV:5>img.show()
SimpleCV:5><SimpleCV.Display.Display instance at 0x107d694d0>
SimpleCV:6>img.findBarcode()
/Library/Python/2.6/site-packages/SimpleCV-1.2-py2.6.egg/SimpleCV/ImageClass.py:1933: RuntimeWarning: tmpnam is a potential security risk to your program
SimpleCV:6><SimpleCV.Features.Detection.Barcode object at 0x101403f10>
require 'formula'
class Opencv < Formula
url 'https://code.ros.org/svn/opencv/trunk/opencv', :using=>:svn
version "2.3.1"
homepage 'http://opencv.willowgarage.com/wiki/'
head 'https://code.ros.org/svn/opencv/trunk'
md5 "a121861848851c5a37e491f0b61cf3fb"
depends_on 'cmake' => :build