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
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ |
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
# see this quora post: http://www.quora.com/How-do-I-locate-the-centers-of-the-beads-in-this-video | |
import cv2 | |
import numpy as np | |
from matplotlib import pyplot as plt | |
from PIL import Image | |
from skimage.feature import peak_local_max, match_template | |
blur = lambda img, sigma: cv2.GaussianBlur(img, (0, 0), sigma, None, sigma, cv2.BORDER_DEFAULT) | |
img = np.array(Image.open('beads.png')) | |
img_float = img.astype('float32') |