Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

潘伟洲 wzpan

🎯
Focusing
View GitHub Profile
@wzpan
wzpan / config.yml
Created Apr 4, 2014
Recommended Markdown settings for using hexo-theme-freemind.
View config.yml
# Markdown
## https://github.com/chjj/marked
markdown:
gfm: true
pedantic: false
sanitize: false
tables: true
breaks: false
smartLists: true
smartypants: true
@wzpan
wzpan / phase.cpp
Created Apr 2, 2014
Switch two images' phase.
View phase.cpp
#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 / hexo_compile.sh
Last active Feb 19, 2019
A script to help me generate hexo blog and publish it to gitcafe.
View hexo_compile.sh
#!/bin/zsh
CUR_DIR=$PWD
HEXO=/Users/wzpan/Documents/workspace/repositories/hexo-blog
PUBLISH=/Users/wzpan/Documents/workspace/repositories/wzpan
CSS=$HEXO/themes/bootstrap/source/css
JS=$HEXO/themes/bootstrap/source/js
DIST=$HEXO/themes/bootstrap/source/dist
PUBLIC=$HEXO/public
@wzpan
wzpan / shutdown_dialog.sh
Last active Aug 21, 2016
A GUI Shutdown dialog.
View shutdown_dialog.sh
#!/bin/sh
ACTION=`zenity --width=90 --height=200 --list --radiolist --text="Select logout action" --title="Logout" --column "Choice" --column "Action" TRUE Shutdown FALSE Reboot FALSE LockScreen FALSE Suspend`
if [ -n "${ACTION}" ];then
case $ACTION in
Shutdown)
zenity --question --text "Are you sure you want to halt?" && gksudo halt
## or via ConsoleKit
# dbus-send --system --dest=org.freedesktop.ConsoleKit.Manager
@wzpan
wzpan / dev-studio-build.el
Created Mar 7, 2014
Add a compile option for using devenv on emacs.
View dev-studio-build.el
(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 / CMakeLists.txt
Last active Dec 30, 2019
Perform FFT and IFFT operation on an image, based on FFTW and OpenCV 2.
View CMakeLists.txt
# Copyright (c) 2012 Marwan Abdellah <abdellah.marwan@gmail.com>
# Minimum required CMake version
cmake_minimum_required(VERSION 2.6)
# FFT
PROJECT(FFT_CV)
# Add CMake modules
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake)
@wzpan
wzpan / ImageFilter.cpp
Created Feb 23, 2014
A backup for image filters.
View ImageFilter.cpp
/**
* @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 / RobustMatcher.h
Last active Sep 24, 2018
CV - match images using random sample consensus(RANSAC).
View RobustMatcher.h
/*------------------------------------------------------------------------------------------*\
This file contains material supporting chapter 9 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 / CameraCalibrator.cpp
Last active Apr 9, 2018
CV - Calibrate camera from detected chess pattern corners.
View CameraCalibrator.cpp
/*------------------------------------------------------------------------------------------*\
This file contains material supporting chapter 9 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 / harrisDetector.h
Last active Aug 29, 2015
CV - Detect Harris corners.
View harrisDetector.h
/*------------------------------------------------------------------------------------------*\
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.