How can I change the pixel value of central row and column of an image?
조회 수: 3 (최근 30일)
이전 댓글 표시
I have already used one method but I want to use another method without using "for loop". My code is...
a = imread('pic.jpg');
[r,c]=size(a);
centerRow = round(r/2);
centerColumn = round(c/2);
for i=1:r
for j=1:c
if(i==centerRow || j==centerColumn)
a(i,j) =255;
end
end
end
imshow(a);
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!