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 / linefinder.h
Last active December 29, 2016 15:49
CV - Detect lines using Hough transform.
/*------------------------------------------------------------------------------------------*\
This file contains material supporting chapter 7 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 / objectFinder.h
Last active December 29, 2016 15:49
CV - Backprojecting a histogram.
#if !defined OFINDER
#define OFINDER
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
class ObjectFinder {
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 / 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 / hexo_draft.py
Last active January 1, 2016 21:39
Help me create a draft for hexo.
#!/bin/python3
import sys
import os
import time
import subprocess
def write(layout, title, current, category, target):
yaml = '''\
title: {1}
@wzpan
wzpan / mnote
Last active December 30, 2015 12:09
Yassnipet for mnote.
# name: margin-note
# key: mnote
# --
{% mnote ${2:index} %} ${1:text} {% endmnote %}$0
@wzpan
wzpan / margin-note.ejs
Last active December 30, 2015 12:09
Example for using margin-note.
{% mnote index %}
Margin note string
{% endmnote %}
@wzpan
wzpan / hexo_mode.ejs
Created December 6, 2013 16:08
Example for getting current mode for hexo.
<% if (cache) { %>
bootstrap.min.css
bootstrap-responsive.min.css
style.min.css
responsive.min.css
<% } else {%>
bootstrap.css
bootstrap-responsive.css
style.css
responsive.css
@wzpan
wzpan / ruhoh_mode.mustache
Last active December 30, 2015 12:09
Examples for getting current mode for Ruhoh.
{{# env.production }}
bootstrap.min.css
bootstrap-responsive.min.css
style.min.css
responsive.min.css
{{/ env.production }}
{{^ env.production }}
bootstrap.css
bootstrap-responsive.css
style.css
@wzpan
wzpan / alert.js
Last active December 30, 2015 11:39
Hexo tag plugins.
var render = hexo.render;
/**
* alert tag
*
* Syntax:
* {% alert caption [style] %}
* Alert string
* {% endalert %}
*/