Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View thorikawa's full-sized avatar

Takahiro "Poly" Horikawa thorikawa

View GitHub Profile
@thorikawa
thorikawa / Top.java
Created June 6, 2011 14:04
Android DrmFramework Sample
package com.polysfactory.DrmFrameworkTest;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import android.app.Activity;
import android.drm.DrmManagerClient;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
@thorikawa
thorikawa / theme.xml
Created June 18, 2011 00:28
Android Dark Theme
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyDark" parent="android:Theme.Black">
<item name="android:textColorPrimary">#FFFFFF</item>
<item name="android:textColorSecondary">#FFFFFF</item>
<item name="android:textColorTertiary">#FFFFFF</item>
<item name="android:textColorPrimaryInverse">#000000</item>
<item name="android:textColorSecondaryInverse">#000000</item>
<item name="android:textColorTertiaryInverse">#000000</item>
<item name="android:textColorPrimaryDisableOnly">#FFFFFF</item>
@thorikawa
thorikawa / poisson.cpp
Created September 4, 2011 14:42
Poisson Image Editing OpenCV
#include <opencv2/opencv.hpp>
#include <iostream>
#include <vector>
#include <cmath>
#include <assert.h>
using namespace std;
using namespace cv;
#include <opencv2/opencv.hpp>
#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <assert.h>
#define mp make_pair
#define pb push_back
@thorikawa
thorikawa / build.xml
Created February 26, 2012 18:42
improved build.xml for Android SDK r16
<?xml version="1.0" encoding="UTF-8"?>
<project name="android_rules" default="debug">
<!--
This build file is imported by the project build file. It contains
all the targets and tasks necessary to build Android projects, be they
regular projects, library projects, or test projects.
At the beginning of the file is a list of properties that can be overridden
by adding them to your ant.properties (properties are immutable, so their
@thorikawa
thorikawa / helloworld.cpp
Created August 14, 2012 06:44
OpenCV Hello World
#include <opencv2/opencv.hpp>
int main () {
cvNamedWindow( "My Window", 1 );
IplImage *img = cvCreateImage( cvSize( 640, 480 ), IPL_DEPTH_8U, 1 );
CvFont font;
double hScale = 2.0;
double vScale = 2.0;
int lineWidth = 5;
cvInitFont(&font, CV_FONT_HERSHEY_SIMPLEX | CV_FONT_ITALIC, hScale, vScale, 0, lineWidth);
@thorikawa
thorikawa / matching_sift.cpp
Created August 19, 2012 10:41
Keypoints matching with SIFT
#include <opencv2/opencv.hpp>
#include <opencv2/nonfree/nonfree.hpp>
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
using namespace cv;
const double THRESHOLD = 400;
@thorikawa
thorikawa / matching_sift.cpp
Created August 19, 2012 23:37
SIFT keypoint matcher using OpenCV C++ interface
#include <opencv2/opencv.hpp>
#include <opencv2/nonfree/nonfree.hpp>
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
using namespace cv;
const double THRESHOLD = 400;
@thorikawa
thorikawa / detect_multiscale.cpp
Created January 15, 2013 09:36
Simple example for CascadeClassifier.detectMultiScale
#include <opencv2/opencv.hpp>
#include <vector>
using namespace cv;
using namespace std;
int main () {
Mat img = imread("lena.jpg");
CascadeClassifier cascade;
if (cascade.load("haarcascade_frontalface_alt.xml")) {
@thorikawa
thorikawa / ChromaticNumber.cpp
Created February 18, 2013 04:42
TCO 2012 Round 3A 250 ChromaticNumber
#include <string>
#include <iostream>
#include <sstream>
#include <vector>
#include <cmath>
#include <queue>
using namespace std;
#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)