How to replace pixel values using a loop in a image?
5 views (last 30 days)
grayImage = imageData;
I = grayImage;
Rv = [54:154; 67:167; 41:141; 80:180]; % Row Start Matrix
% Column Vector
Rc = 0:15; % Row Subscript Address Length
I(Rv(1,k)+Rc,Cv(k)) = I(Rv(3,k)+Rc, Cv(k));
I(Rv(2,k)+Rc,Cv(k)) = I(Rv(4,k)+Rc, Cv(k));
Hi, I am having an issue with this code. As you can see below in the photo, the code does not perform what I intend to do. As I want to replace the metal artifact pixels with the surrounding tissue pixels. So I need to make it so the column vector is repeated for a few of the row matrix.