This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import urllib | |
#import re | |
from BeautifulSoup import BeautifulSoup | |
""" | |
Download this file in html version | |
https://docs.google.com/spreadsheet/ccc?key=0AsKzpC8gYBmTcGpHbFlILThBSzhmZkRhNm8yYllsWGc&hl=en#gid=0" | |
""" | |
url = "The URL of above file" # url = "file:///home/jay/Downloads/index.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
See this gist: https://gist.github.com/1984424 | |
Download both of these gists. save it in same folder. The down_xkcd.py will download all the xkcd comics from net. And view comics using xkcd_viewer.py | |
""" | |
import pygtk | |
import gtk | |
from PIL import Image | |
import os | |
from random import randint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygtk | |
import gtk | |
import os | |
from random import randint | |
import urllib2 | |
import os | |
from BeautifulSoup import BeautifulSoup | |
from threading import Thread | |
import gobject | |
gtk.gdk.threads_init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import sqrt | |
def calculateBBCenter(bb): | |
center = (0.5*(bb[0] + bb[2]),0.5*(bb[1]+bb[3])) | |
return center | |
def getFilledBBPoints(bb, numM, numN, margin): | |
pointDim = 2 | |
bb_local = (bb[0] + margin, bb[1] + margin, bb[2] - margin, bb[3] - margin) | |
if numM == 1 and numN == 1 : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from SimpleCV import * | |
from cv2.cv import * | |
from cv2 import * | |
import time | |
import math | |
from copy import deepcopy | |
def fbtrack(imgI, imgJ, bb): | |
numM = 10 | |
numN = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Install SimpleCV" | |
echo "Installing pre-reqisites" | |
sleep 1 | |
echo "Installing OpenCV..." | |
sudo apt-get install libopencv-* | |
sudo apt-get install python-opencv | |
echo "OpenCV installed" | |
echo "Installing numpy and scipy" | |
sudo apt-get install python-numpy python-scipy | |
echo "numpy and scipy installed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PYTHON_VERSION = 2.7 | |
PYTHON_INCLUDE = /usr/include/python$(PYTHON_VERSION) | |
# location of the Boost Python include files and library | |
BOOST_INC = /usr/include | |
BOOST_LIB = /usr/lib | |
# compile mesh classes | |
TARGET = opencvtest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from SimpleCV import * | |
import time, cv2 | |
import cv2.cv as cv | |
i = Image("Python/SimpleCV/line1.jpg") | |
g = i.getGrayNumpyCv2() | |
em = cv2.Canny(g, 70, 100) | |
l = cv2.HoughLines(em, 1.0, cv.CV_PI/180.0, 100) | |
print l.shape | |
l = l[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
import itertools | |
lk_params = dict( winSize = (10, 10), | |
maxLevel = 5, | |
criteria = (cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, 10, 0.03)) | |
feature_params = dict( maxCorners = 3000, | |
qualityLevel = 0.5, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import cv2.cv as cv | |
""" | |
Got the idea from http://newpathprep.wordpress.com/2012/08/13/opencv-forward-and-rewind-avi/ | |
He has done it in C++. | |
""" | |
def start(capture, n): | |
cv.SetCaptureProperty(capture, cv.CV_CAP_PROP_POS_FRAMES, n-1) | |
def rewind(capture): |