Last active
August 29, 2015 14:06
-
-
Save ZGainsforth/604a906bad527728e439 to your computer and use it in GitHub Desktop.
Bins an image when the image is a 2d numpy array.
This file contains hidden or 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
| def BinImage(img, binsize): | |
| imgbin = zeros(array(img.shape)/binsize) | |
| for i in range(binsize): | |
| for j in range(binsize): | |
| imgbin += img[i::binsize, j::binsize] | |
| return imgbin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment