Skip to content

Instantly share code, notes, and snippets.

View panovr's full-sized avatar

Yili Zhao panovr

View GitHub Profile
@panovr
panovr / HsvToRgb.cpp
Created June 28, 2012 11:37
RGB colorspace to HSV colorspace conversion and vice versa
/**
* R: [0, 255]
* G: [0, 255]
* B: [0, 255]
*
* H: [0.0, 360.0)
* S: [0.0, 1.0]
* V: [0.0, 1.0]
*
* If output is RGB of ByteImage3, then R, G, B is scaled to [0, 255];
@panovr
panovr / info.txt
Created July 6, 2012 12:25
Gaussian filter with libgil2 and cmlib
1213 910
3
data/input/STA_2713.JPG
data/input/STB_2714.JPG
data/input/STC_2715.JPG
#include <opencv2/opencv.hpp>
#include <iostream>
#include <vector>
#include <cmath>
#include <assert.h>
using namespace std;
using namespace cv;
@panovr
panovr / main.cpp
Created March 29, 2014 03:54
ReadImages
void ReadImages(vector<PanoImage> *pano_images);
int main(int argc, char **argv)
{
vector <PanoImage> pano_images;
ReadImages(&pano_images);
// Some error checking
for (size_t i = 0; i < pano_images.size(); ++i)
@panovr
panovr / info.txt
Created March 29, 2014 03:57
ReadImages configuration file
968 648
5
sample/001.jpg 729.25
sample/002.jpg 729.25
sample/003.jpg 729.25
sample/004.jpg 729.25
sample/005.jpg 729.25
@panovr
panovr / CMakeLists.txt
Created March 29, 2014 04:06
Project Cmake file
cmake_minimum_required(VERSION 2.8)
project(SimplePanoStitcher)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
find_package(OpenCV REQUIRED core imgproc highgui calib3d features2d nonfree)
include_directories(${OpenCV_INCLUDE_DIRS})
@panovr
panovr / CMakeLists.txt
Created March 29, 2014 04:08
lmfit CMake file
add_library(lmfit STATIC
lmmin.c lmcurve.c
lmmin.h lmstruct.h lmcurve.h
)
@panovr
panovr / main.cpp
Created March 29, 2014 04:14
FindMatches
void FindMatches(const Mat &img1, const Mat &img2, vector<MatchPair> &ret_matches)
{
Mat grey1, grey2;
cvtColor(img1, grey1, CV_BGR2GRAY);
cvtColor(img2, grey2, CV_BGR2GRAY);
// Detecting keypoints
Ptr<FeatureDetector> detector = FeatureDetector::create("SURF");
Ptr<DescriptorExtractor> descriptorExtractor = DescriptorExtractor::create("SURF");
@panovr
panovr / softmax.py
Created January 27, 2016 12:36 — forked from stober/softmax.py
Softmax in Python
#! /usr/bin/env python
"""
Author: Jeremy M. Stober
Program: SOFTMAX.PY
Date: Wednesday, February 29 2012
Description: Simple softmax function.
"""
import numpy as np
npa = np.array
@panovr
panovr / caffe_feature_extractor.py
Created April 23, 2016 02:30 — forked from marekrei/caffe_feature_extractor.py
Caffe feature extractor
import numpy as np
import os, sys, getopt
# Main path to your caffe installation
caffe_root = '/path/to/your/caffe/'
# Model prototxt file
model_prototxt = caffe_root + 'models/bvlc_googlenet/deploy.prototxt'
# Model caffemodel file