Deblurred the Images using wiener Filter but i need to train the multiple images find their accuracy before training and after training by using Plots

3 views (last 30 days)
Deblurred the Images using wiener Filter but i need to train the multiple images find their accuracy before training and after training by using histogram.
Needed source code for Adding image folder then training the dataset and Accuracy after training by using plots.

Answers (1)

Drishti
Drishti on 24 Sep 2024
Edited: Drishti on 24 Sep 2024
Hi Kartikeya,
I understand that you want to utilize the Wiener filter to deblur the image and wants to train on multiple images.
Wiener filter is utilized to improve the quality of image degraded by additive noise and blurring.
In MATLAB, to achieve the similar functionality, you can utilize the ‘wiener2’ function, which is a 2-D adaptive noise-removal filtering technique.
For better understanding, you can refer to the provided implementation of ‘wiener2’ function:
function img = preprocessImageWithWiener(filename)
img = im2double(imread(filename));
img = imresize(img, [128, 128]);
% Apply Wiener filter to each channel individually
for c = 1:size(img, 3)
img(:, :, c) = wiener2(img(:, :, c), [5 5]);
end
end
Furthermore, for training of multiple images, a simple neural network can be created. Refer to the provided example to understand the architecture of a neural network.
layers = [
imageInputLayer([128 128 3])
convolution2dLayer(3, 16, 'Padding', 'same')
reluLayer
convolution2dLayer(3, 32, 'Padding', 'same')
reluLayer
convolution2dLayer(3, 64, 'Padding', 'same')
reluLayer
convolution2dLayer(3, 3, 'Padding', 'same')
regressionLayer
];
% Train the network
net = trainNetwork(trainingData, layers, options);
You can also refer to the MATLAB Documentation of ‘wiener2’ function and ‘trainNetwork’ for creating a neural network.
I hope this helps.

Community Treasure Hunt

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

Start Hunting!