How to add the neighboring pixel values
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a matrix - if 0 occurs then i have to add the 8 neighboring pixels and replace the 0 value . is there any built in function for this ..
댓글 수: 0
채택된 답변
Walter Roberson
2015년 6월 30일
filt2() with [1 1 1;1 0 1; 1 1 1] to get the sums everywhere. Then in the places that are 0 in the original, replace with the sum at the corresponding location. Use logical indexing.
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!