how to create a sliding window?

조회 수: 1 (최근 30일)
Andrea Finocchiaro
Andrea Finocchiaro 2015년 10월 19일
댓글: Walter Roberson 2018년 12월 25일
Hi guys, I would like to know ho to create a sliding window in a matrix. Thank you very much.

답변 (1개)

Image Analyst
Image Analyst 2015년 10월 19일
You can use conv2() or imfilter(). For example:
windowWidth = 11;
kernel = ones(windowWidth, windowWidth) / windowWidth ^ 2;
smoothedImage = conv2(double(grayImage), kernel, 'same');
  댓글 수: 2
Le Dung
Le Dung 2018년 12월 25일
Undefined function or variable 'grayImage'.
Walter Roberson
Walter Roberson 2018년 12월 25일
Replace grayImage with the variable that stores your gray-scale image (not RGB)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Import, Export, and Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by