How do I set up a for loop to replace specific pixels of a color image (with a value of 0) with specific pixels of another color image?
2 views (last 30 days)
Image Analyst on 28 Feb 2014
Try this (untested):
% Find logical indexes of where there is 0 in image1.
zeroPixels = image1 == 0;
% Replace them with the same pixels from image 2
image1(zeroPixels) = image2(zeroPixels);
If that doesn't work, let me know.