Skip to content

Instantly share code, notes, and snippets.

View wzpan's full-sized avatar
:octocat:
Focusing

潘伟洲 wzpan

:octocat:
Focusing
View GitHub Profile
@wzpan
wzpan / histogram.h
Last active August 29, 2015 13:56
CV - Calculate 1D histogram
#if !defined HISTOGRAM
#define HISTOGRAM
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
class Histogram1D {
private:
@wzpan
wzpan / colorhistogram.h
Last active August 29, 2015 13:56
CV - Calculate historgram for Color images
#if !defined COLHISTOGRAM
#define COLHISTOGRAM
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
class ColorHistogram {
private:
@wzpan
wzpan / harrisDetector.h
Last active August 29, 2015 13:56
CV - Detect Harris corners.
/*------------------------------------------------------------------------------------------*\
This file contains material supporting chapter 8 of the cookbook:
Computer Vision Programming using the OpenCV Library.
by Robert Laganiere, Packt Publishing, 2011.
This program is free software; permission is hereby granted to use, copy, modify,
and distribute this source code, or portions thereof, for any purpose, without fee,
subject to the restriction that the copyright notice may not be removed
or altered from any source or altered source distribution.
The software is released on an as-is basis and without any warranties of any kind.
@wzpan
wzpan / ImageFilter.cpp
Created February 23, 2014 07:49
A backup for image filters.
/**
* @file ImageFilter.cpp
* @author Joseph Pan <cs.wzpan@gmail.com>
* @date Sat Feb 22 16:34:00 2014
*
* @brief Create filters
*
* [Johnston80] - J D Johnston, "A filter family designed for use in quadrature
* mirror filter banks", Proc. ICASSP, pp 291-294, 1980.
*
@wzpan
wzpan / dev-studio-build.el
Created March 7, 2014 09:36
Add a compile option for using devenv on emacs.
(defun is-devstudio-solution (filename)
(or
(null (file-name-extension filename))
(string= (file-name-extension filename) "sln")))
(read-file-name "Solution: " nil nil t nil 'is-devstudio-solution)
(defun extract-projects (sln-file)
(save-excursion
(with-temp-buffer
@wzpan
wzpan / phase.cpp
Created April 2, 2014 13:21
Switch two images' phase.
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
// Rearrange the quadrants of a Fourier image so that the origin is at
// the image center
void shiftDFT(Mat &fImage )
{
@wzpan
wzpan / config.yml
Created April 4, 2014 04:12
Recommended Markdown settings for using hexo-theme-freemind.
# Markdown
## https://github.com/chjj/marked
markdown:
gfm: true
pedantic: false
sanitize: false
tables: true
breaks: false
smartLists: true
smartypants: true
@wzpan
wzpan / getopt.py
Last active August 29, 2015 14:05
Python2 example to handle options and arguments.
import sys, os, getopt
TARGET_TYPE = ".log"
def process_file(path):
''' Process a file. '''
print path
def process_dir(path):
#! /bin/bash
# 计算有效变更代码量的脚本
# 包括注释,但不包括新增的空行
version() {
OS=`uname -o`
echo "svn_counter ($OS) 0.0.1"
}
usage() {
#!/usr/bin/env ruby
if ARGV[0].nil? || ARGV[0].match(/-h/)
puts "Usage : #{$0} github_username dash_sqlite_db char_appended_to_keyword [no_comments]"
exit
end
require 'net/http'
require 'open-uri'
#require 'awesome_print'