我有 2 个数组:
掩码:值为 0 和 1,dtype=uint8
>>> mask
array([[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[1, 1, 1, ..., 0, 0, 0],
...,
[1, 1, 1, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0]], dtype=uint8)
和 prova_clip
>>> prova_clip
array([[289, 281, 271, ..., 257, 255, 255],
[290, 284, 268, ..., 260, 260, 259],
[294, 283, 264, ..., 265, 263, 257],
...,
[360, 359, 360, ..., 335, 338, 331],
[359, 364, 369, ..., 337, 342, 339],
[358, 363, 368, ..., 332, 331, 332]], dtype=uint16)
我希望使用代码保存方法用掩码屏蔽 prova_clip 以便拥有
array([[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[294, 283, 264, ..., 0, 0, 0],
...,
[360, 359, 360, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0]], dtype=uint16)