This file contains hidden or 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 twitter import * | |
auth = OAuth( | |
consumer_key='2yiyIW2qqGfwblk1Tk8BqiygP', | |
consumer_secret='1FWJu5810Gng0QdZylIMZlA0v1aGsLv9muTh8xn5kouE4ZE6EV', | |
token='2886635781-2mXPbGqS6x3szeUjdjB50DGEcI9P2OOVWVCX13z', | |
token_secret='1SMDFRZdHqea5sKEzNQTVHdnUdFh7s5jDab2qNL1zTqKB' | |
) | |
t = Twitter(auth=auth) |
This file contains hidden or 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
#include <Bridge.h> | |
unsigned long timer; | |
unsigned long counter = 0L; | |
void setup() | |
{ | |
Serial.begin(9600); | |
Bridge.begin(); // this launches /usr/bin/run-bride on Linino | |
timer = millis(); |
This file contains hidden or 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
// http://www.epochconverter.com | |
function TimeCounter(t) { | |
var days = parseInt(t / 86400); | |
t = t - (days * 86400); | |
var hours = parseInt(t / 3600); | |
t = t - (hours * 3600); | |
var minutes = parseInt(t / 60); | |
t = t - (minutes * 60); |
This file contains hidden or 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
### | |
#Step 1 - Generate server certificates etc... (most of this code is horribly ripped off from nodejs docs currently -> http://nodejs.org/docs/latest/api/tls.html) | |
### | |
#Assuming your starting from a clean directory | |
mkdir server | |
cd server | |
#generate private key |
This file contains hidden or 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
find `pwd` |
This file contains hidden or 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
void displayText(const QString &text, const QColor &backgroundColor, const QColor &textColor, const Vec3D &pos) | |
{ | |
// some magic number (margin, spacing, font size, etc..) | |
int fontSize = 15; | |
int text_width=text.size()*(fontSize/1.5)+5, text_height=fontSize+20; | |
// create the QImage and draw txt into it | |
QImage textimg(text_width, text_height, QImage::Format_RGB888); | |
{ | |
QPainter painter(&textimg); |
This file contains hidden or 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 numpy as np | |
import cv2 | |
import os | |
# this two lines are for loading the videos. | |
# in this case the video are named as: cut1.mp4, cut2.mp4, ..., cut15.mp4 | |
videofiles = [n for n in os.listdir('.') if n[0]=='c' and n[-4:]=='.mp4'] | |
videofiles = sorted(videofiles, key=lambda item: int( item.partition('.')[0][3:])) | |
video_index = 0 |
This file contains hidden or 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
i=1 | |
for avi in *.mp4; do | |
name=`echo $avi | cut -f1 -d'.'` | |
jpg_ext='.jpg' | |
echo "$i": extracting the first frame of the video "$avi" into "$name$jpg_ext" | |
ffmpeg -loglevel panic -i $avi -vframes 1 -f image2 "$name$jpg_ext" | |
i=$((i+1)) | |
done |
This file contains hidden or 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
cv::Rect roi( cv::Point( originX, originY ), smallImage.size() ); | |
smallImage.copyTo( bigImage( roi ) ); |
This file contains hidden or 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
displayDebug = .... | |
// turn black pixels into alpha 0 | |
if(displayDebug.channels()==1) | |
cv::cvtColor(displayDebug, displayDebug, CV_GRAY2BGR); | |
cv::cvtColor(displayDebug, displayDebug, CV_BGR2BGRA); | |
for (cv::Mat4b::iterator it = displayDebug.begin<cv::Vec4b>(); it != displayDebug.end<cv::Vec4b>(); it++) { | |
if (*it == cv::Vec4b(0, 0, 0, 255)) { | |
*it = cv::Vec4b(0, 0, 0, 0); | |
} |