-
Notifications
You must be signed in to change notification settings - Fork 0
/
denoised_image_read.m
68 lines (59 loc) · 1.75 KB
/
denoised_image_read.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
%% SCRIPT: TXT to PNG conversion and noise visualization
%
% Converting a .txt to .png, after running a CPU/GPU implementation
% of a non local means (NLM) algorithm as described in [1], in C, to
% visualize the effectivenes of the algorithm.
%
% The C code can be found in the author's github (see bottom of script).
%
% DEPENDENCIES
%
% [1] Antoni Buades, Bartomeu Coll, and J-M Morel. A non-local
% algorithm for image denoising. In 2005 IEEE Computer Society
% Conference on Computer Vision and Pattern Recognition (CVPR '05),
% volume 2, pages 60-65. IEEE, 2005.
%
% [2] Angelos Spyrakis. "image_read.m" file contained within the same
% directory, for pre-processing the image used by the NLM algorithm.
%
%
clear all %#ok
close all
clc
%% IMPORT .TXT FILES OF NOISY AND FILTERED IMAGE
delimiterIn = '\t';
headerlinesIn = 0;
filename1 = 'noisy_image.txt';
noisy_image = importdata(filename1, delimiterIn, headerlinesIn);
delimiterIn = ' ';
filename2 = 'filtered_image.txt';
filtered_image = importdata(filename2, delimiterIn, headerlinesIn);
%% EXPORT TO .PNG
imwrite(filtered_image, 'filtered_image.png');
% calculate noise removed & export
noise = filtered_image - noisy_image;
noise = mat2gray(noise);
imwrite(noise, 'noise_removed.png');
%%------------------------------------------------------------
%
% AUTHORS
%
% Angelos Spyrakis aspyrakis@auth.gr
%
% VERSION
%
% 0.1 - February 1, 2021
%
% CHANGELOG
%
% 0.1 (FEB 1, 2021) - Angelos
% * initial implementation
%
% GITHUB REPOSITORY
%
% https://github.com/ReaverAUTh/pad_auth_3
%
% --
% An Aristotle University of Thessaloniki ECE Department
% project for course 050 - Parallel & Distributed Systems.
% ------------------------------------------------------------