I have to change pixel values in a RGB image.
I have two arrays indicating positions, so:
rows_to_change = [r1, r2, r3, ..., rn];
columns_to_change = [c1, c2, c3, ..., cn];
I would operate this modification without loops. So intuitively, in order to set the red color in those location, I write:
image(rows_to_change, columns_to_change, :) = [255, 0, 0];
This code line returns an error.
How can I operate this change without using a double for loop?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…