increase of efficiency for manipulating image pixels
Show older comments
hello guys, i have two arrays of pixels coordinates witch i'd like to change their value,one contains rows (named R) the other columns (named C) this instruction: image(R(:),C(:))=new value; doesn't result in what i want and i have to use two for loops. do you know any more efficient way to achieve this goal? thank you in advance
1 Comment
Ashish Uthama
on 30 Sep 2011
http://www.mathworks.com/matlabcentral/answers/11082-how-do-i-index-into-a-2d-matrix-using-two-equal-length-r-and-c-vectors
Answers (1)
Walter Roberson
on 30 Sep 2011
image(sub2ind(size(image),R,C)) = newvalue;
Categories
Find more on Images in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!