The so-called box fuzzy here is actually the mean filter that you are familiar with before. The principle is to take the current pixel as the center, calculate the average of the two pixels around the radius R (2 * r + 1) and then assign the value to the current pixel. There is nothing to explain. They are all very simple things. The following code is used:
Clear all; close all1_clc1_r1_51_img1_imread('lena.jpg '); IMG = double (IMG); [m n] = size (IMG); imshow (mat2gray (IMG )); imgn = zeros (m + 2 * r + 1, n + 2 * r + 1); imgn (R + 1: m + R, R + 1: N + r) = IMG; imgn (1: R, R + 1: N + R) = IMG (1: R, 1: N); imgn (1: m + R, N + R + 1: n + 2 * r + 1) = imgn (1: m + R, N: N + r); imgn (m + R + 1: m + 2 * r + 1, R + 1: n + 2 * r + 1) = imgn (M: m + R, R + 1: n + 2 * r + 1); imgn (1: m + 2 * r + 1, 1: R) = imgn (1: m + 2 * r + 1, R + * r); for I = R + 1: m + R for J = R + 1: N + R imgn (I, j) = mean (imgn (I-r: I + R, J-R: J + r); endendfigure; IMG = imgn (R + 1: m + R, R + 1: n1_r1_1_imshow(mat2gray(img1_1_imwrite(mat2gray(img1_,'1.jpg ');
Processing result. R is 5:
Source image
Effect
Photoshop Effect