How to apply image smoothing & sharpening to only a particular region of an image?

I'm supposed to take a corrupted and noisy image. Select a particular region of interest. Then apply smoothing and/or sharpening only to that region using MATLAB codes. The code should be generalized i.e i should be able to apply that code to any image. Won't there be problem with selecting the threshold levels for smoothing and/or sharpening for each image, if we are supposed to generalize?

Thank you for your solution.
I meant threshold frequency of the low pass and high pass filters used for smoothing and sharpening in frequency domain. When we apply smoothing or sharpening to an image, the whole image gets smoothed or sharpened. This happens by setting a cut-off frequency for the whole image using a generalized formula in the code.
But when we are needed to set cut-off/threshold frequency for a particular region of an image, we will have to change that frequency in the code every time we take a different image input, as the cut-off frequency may differ for different images in different regions. I didn't know how to solve that problem.

But i also didn't know about masking. I will try that.
Thank you once again!!

% Change the current folder to the folder of this m-file.
if(~isdeployed)
cd(fileparts(which(mfilename)));
end
% Check that user has the Image Processing Toolbox installed.
hasIPT = license('test', 'image_toolbox');
if ~hasIPT
% User does not have the toolbox installed.
message = sprintf('Sorry, but you do not seem to have the Image Processing Toolbox.\nDo you want to try to continue anyway?');
reply = questdlg(message, 'Toolbox missing', 'Yes', 'No', 'Yes');
if strcmpi(reply, 'No')
% User said No, so exit.
return;
end
end

% Perform 2D FFT on the filtered image to see its spectrum.
% We expect to see a sinc multiplication effect.
% It should look like the original but with a sinc pattern overlaid on it.
fftFiltered = fft2(double(filteredImage));
shiftedFFT = fftshift(fftFiltered);