필터 지우기
필터 지우기

How can we slide say a 3X3 window on a matrix and perform an operation (i.e. Sum) on the 3X3 window, and then move that 3X3 window to the next part until we reach the end of the matrix? Thanks.

조회 수: 2 (최근 30일)
How can we slide say a 3X3 window on a matrix and perform an operation (i.e. Sum) on the 3X3 window, and then move that 3X3 window to the next part until we reach the end of the matrix? Thanks. i have a program of 2X2 but i went 3, thanks.

채택된 답변

Image Analyst
Image Analyst 2015년 4월 15일
You can use conv2():
blurredImage = conv2(double(grayImage), ones(3), 'same');
imshow(blurredImage, []);
You could also use imfilter(). Use ones(3)/9 if you want the average instead of the sum.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by