Math functions for uint8

This may be a little low-level for skimage, but I just published a branch with some math operations on uint8 arrays. https://github.com/tonysyu/scikits.image/compare/master...uint8_math Basically, it defines add/subtract/multiply/divide for uint8 arrays, but clips values instead of allowing values to overflow/underflow. I originally wrote them because I thought they were necessary to fix the underflow problems in morphological tophat, but it turned out that the underlying issue was different. Even so, they could be useful elsewhere: For example, I remember the Sobel filters had issues with underflow or overflow (I think the functions now cast to float). I noticed that there were some similar operations written in Cython (scikits/image/io/_plugins/_colormixer.pyx), but these look specific to the application (but are probably faster, too). Any thoughts would be appreciated, -Tony
participants (1)
-
Tony Yu