Skip to content

Instantly share code, notes, and snippets.

@warmspringwinds
Created May 29, 2015 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save warmspringwinds/0394bbc39380ebd3c90d to your computer and use it in GitHub Desktop.
Save warmspringwinds/0394bbc39380ebd3c90d to your computer and use it in GitHub Desktop.
Code for generating images that are used in gsoc blog post.
# Use local scikit-image
import sys
sys.path.insert(0, "/home/dan/University/projects/gsoc_face_detection/scikit-image/")
import skimage.feature
import skimage.data as data
from skimage.transform import integral_image
import numpy as np
# The horizontal offset
x = 75
# The vertical offset
y = 130
# Width of one rectangle of 9
width = 50
# Height of one rectangle of 9
height = 50
img = data.coins()
integral_img = integral_image(img)
lbp_code = skimage.feature.multiblock_local_binary_pattern(integral_img, x, y, width, height)
print lbp_code
skimage.feature.visualize_multiblock_lbp(img, x, y, width, height, lbp_code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment