Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 matlab 中,我将图像的某些像素的颜色更改为黑色,但颜色变为蓝色。我无法理解这个问题。我的代码如下。任何人都可以帮助我吗?
img = imread('test.png'); for i = 1 : 200 for j = 1: 640 img(i,j) = 0; end end
也许你有一个 RGB 图像,所以你必须写:
img(i,j,:) = 0
您还应该检查以下输出:class(img)和size(img)
class(img)
size(img)