Skip to content

Instantly share code, notes, and snippets.

@kphilipp
kphilipp / speckle_pattern.m
Last active October 6, 2016 09:00
simulation of fully developed speckle pattern
L = 400;
D = 80;
speckleSize = L/D
img = zeros(L, L);
pad = L/2; % padding
for k=pad-D:D+pad
for l=pad-D:D+pad
if abs((pad-k)^2+(pad-l)^2) < D^2/4
img(k,l) = exp(unifrnd(-pi,pi));
end
@kphilipp
kphilipp / match_orb.py
Created November 1, 2013 20:17
demo for orb descriptor matching with opencv
# further information:
# * http://stackoverflow.com/questions/11114349/how-to-visualize-descriptor-matching-using-opencv-module-in-python
# * http://docs.opencv.org/doc/tutorials/features2d/feature_homography/feature_homography.html#feature-homography
# * http://stackoverflow.com/questions/9539473/opencv-orb-not-finding-matches-once-rotation-scale-invariances-are-introduced
# * OpenCV 2 Computer Vision Application Programming Cookbook, Chapter 9
import cv2
import scipy as sp
import numpy as np