test_ometiffwriter.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:ome-files-py 作者: ome 项目源码 文件源码
def rgb_pixeldata(self):
    pixels = [np.ndarray(shape=[64, 128], dtype=np.dtype('u1'), order='C'),
              np.ndarray(shape=[64, 128], dtype=np.dtype('u1'), order='C'),
              np.ndarray(shape=[64, 128], dtype=np.dtype('u1'), order='C')]
    for s in range(0, len(pixels)):
        for (y, x), value in np.ndenumerate(pixels[s]):
            if s == 0:
                value = (x * 255) / 128
            if s == 1:
                value = (y * 255) / 64
            if s == 2:
                value = 255 - ((y * 255) / 64)
            pixels[s].itemset((y, x), value)
    return pixels
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号