MATLAB: I am try to blur half portion of the image but in output i am getting blurred portion of image with box how can i remove this box as I need entire image without that blurred box???

digital image processingimage processingImage Processing Toolbox

clear all
close all
[rows, columns] = size(I);
midColumn = ceil(columns/2);
leftHalf = I(:, 1:midColumn);
rightHalf = I(:, midColumn+1:end);
windowSize = 11;
blurryLeft = imfilter(leftHalf, ones(windowSize)/windowSize^2);
blurryRight = imfilter(rightHalf, ones(windowSize)/windowSize^2);
I(1:256, 1:128) = blurryLeft;

Best Answer

Replace this line:
I(1:256, 1:128) = blurryLeft;
with this line
Now you will have the original image in a new figure and it will not have any blurred pixels in it.