如何从misc.imread()获取的ndarray中删除整列值?(How do you delete an entire column of values from an ndarray obtai

编程入门 行业动态 更新时间:2024-10-23 18:26:44
如何从misc.imread()获取的ndarray中删除整列值?(How do you delete an entire column of values from an ndarray obtained from misc.imread()?)

我正在读一个png图像,它是RGBA格式,我想删除'A'部分。 我的形象是(694,1077,4),但我希望它是(694,1077,3)。 我想删除数组中的最后一列,所以我只有RGB值。

I am reading a png image and it is in RGBA format and i would like to remove the 'A' part. The shape of my image is (694, 1077, 4) but I would like it to be (694, 1077, 3). I'd like to remove the last column in the array so I only have RGB values.

最满意答案

只需这样做:

im_without_A = im[:, :, :3]

Simply do this:

im_without_A = im[:, :, :3]

更多推荐

本文发布于:2023-08-01 16:21:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1361546.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:ndarray   整列值   misc   imread   delete

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!