Change data type of computed heightmap arrays to signed integer to avoid unsigned overflow.

Code that works with heightmaps such as filters/smooth.py will subtract two heights expecting to get a negative integer. Getting a very large positive one usually causes an error, so make sure signed int arithmetic gets used.
This commit is contained in:
David Vierra 2012-10-17 12:19:01 -10:00
parent 14967d46da
commit fde247b651

View File

@ -50,7 +50,7 @@ def extractHeights(array):
# from each column.
w, h = array.shape[:2]
heightMap = zeros((w, h), 'uint16')
heightMap = zeros((w, h), 'int16')
heights = argmax((array > 0)[..., ::-1], 2)
heights = array.shape[2] - heights