フィルターのクリア

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

1 回表示 (過去 30 日間)
Anon
Anon 2020 年 2 月 8 日
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

回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by