ENH Faster perimeter computation

Measured a 30% speedup on a 640x640 image. Fundamentally, this makes
fewer passes over the image; so it should never be worse that the
previous implementation.
RFCT Simpler code for initializing array

Also, replaced skimage.measures.histogram by np.bincount.

Both changes were suggested in the pull request discussion by Juan
Nunez-Iglesias (jni):

https://github.com/scikit-image/scikit-image/pull/746
Merge pull request #746 from luispedro/master

ENH Faster perimeter computation