def depthsize(self, d):
    return {cv.IPL_DEPTH_8U: 1, cv.IPL_DEPTH_8S: 1, cv.IPL_DEPTH_16U: 2, cv.IPL_DEPTH_16S: 2, cv.IPL_DEPTH_32S: 4, cv.IPL_DEPTH_32F: 4, cv.IPL_DEPTH_64F: 8}[d]
def depthsize(self, d):
    return {cv.IPL_DEPTH_8U: 1, cv.IPL_DEPTH_8S: 1, cv.IPL_DEPTH_16U: 2, cv.IPL_DEPTH_16S: 2, cv.IPL_DEPTH_32S: 4, cv.IPL_DEPTH_32F: 4, cv.IPL_DEPTH_64F: 8}[d]