Skip to content

Instantly share code, notes, and snippets.

View t-abe's full-sized avatar

Takashi Abe t-abe

  • Preferred Networks, Inc.
  • Tokyo, Japan
View GitHub Profile
@t-abe
t-abe / blas.hpp
Created July 10, 2011 10:26
BLASのラッパー
#pragma once
/* using MKL10 */
#pragma comment(lib, "mkl_intel_lp64.lib")
#pragma comment(lib, "mkl_intel_thread.lib")
#pragma comment(lib, "mkl_core.lib")
#pragma comment(lib, "libiomp5md.lib")
#include <mkl.h>
#include <cmath>
@t-abe
t-abe / wbl.hpp
Created July 10, 2011 10:25
BLASとLAPACKのラッパー
/* the wrapper of BLAS and LAPACK (MKL) */
#pragma once
#include "blas.hpp"
#include <cstring>
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef MIN
@t-abe
t-abe / hog.hpp
Created July 10, 2011 10:20
implementation of HoG
/*
// prepare
HoG hog(PATCH_SIZE, cv::Size(8, 8), cv::Size(2, 2), cv::Size(8, 8), 9);
// ...or...
MultiScaleHoG hog;
hog.add(PATCH_SIZE, cv::Size(4, 4), cv::Size(2, 2), cv::Size(4, 4), 9);
hog.add(PATCH_SIZE, cv::Size(16, 16), cv::Size(2, 2), cv::Size(8, 8), 9);
hog.add(PATCH_SIZE, cv::Size(32, 32), cv::Size(2, 2), cv::Size(16, 16), 9);
@t-abe
t-abe / InteractiveGrabcut.cpp
Created June 30, 2011 04:08
interactive grabcut application using OpenCV
#include <useopencv.h>
#include <string>
#include <vector>
#include <iostream>
class InteractiveGrabcut {
cv::Mat src;
cv::Mat fgd, bgd;
bool ldrag, rdrag;
std::string name;
// use opencv
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/imgproc/imgproc_c.h>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#ifdef _DEBUG
#pragma comment( lib, "opencv_core229d.lib" )
#pragma comment( lib, "opencv_imgproc229d.lib" )
#pragma comment( lib, "opencv_highgui229d.lib" )
#pragma once
#pragma warning ( disable : 4819 )
#pragma warning ( disable : 4996 )
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/imgproc/imgproc_c.h>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <useopencv.h>
template <typename T>
class BoxMat {
public:
const cv::Mat_<T>& mat;
int offsetX, offsetY;
int rows, cols;
BoxMat(const cv::Mat_<T>& mat, const int offsetY, const int offsetX, const cv::Size size)
@t-abe
t-abe / dictor.pl
Created October 24, 2010 11:10
perl script to use weblio.jp's dictionary
#! /usr/bin/perl
use strict;
use warnings;
use Web::Scraper;
use LWP::UserAgent;
use URI;
use URI::Escape;
use Encode;
use utf8;