Code for generating images that are used in gsoc blog post.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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