MATLAB: How does the imgaussfilt function handle the first and last pixels of a row or a column

imgaussfilt.m

I'm using the imgaussfilt function to smooth an image and was wondering how the algorithm handles the beginning and the end of a row or a column to get the right values?

Best Answer

By default, the edge values are padded by replication, but you have control over that through the ''Padding'' input parameter.
Note that it's not just the first/last row/column that is affected. Any pixel within half a kernel width of the image border will need to use padded values.
Related Question