Effacer les filtres
Effacer les filtres

How to replace pixel values using a loop in a image?

1 vue (au cours des 30 derniers jours)
Anon
Anon le 8 Fév 2020
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
Cv=16:116
for k=1:100
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));
end
imshow(I)
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.
Screenshot 2020-02-08 at 15.53.53.png

Réponses (0)

Catégories

En savoir plus sur Geometric Transformation and Image Registration dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by