-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.m
32 lines (26 loc) · 1.07 KB
/
main.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
clc
clear
close all
%% Data Input
%------Reference image
[RefName, RefPath] = uigetfile('*','Select the reference image');
RefImg = abs(double(imread(fullfile(RefPath, RefName))));
%-------Subject image
[SubName, SubPath] = uigetfile('*','Select the subject image');
SubImg = abs(double(imread(fullfile(SubPath, SubName))));
thresh = multithresh(SubImg(:,:,1), 3);
% Replace NaN values with 0
RefImg(isnan(RefImg)) = 0;
SubImg(isnan(SubImg)) = 0;
%% Location-independent relative radiometric normalization (LIRRN)
N = 1000;
% Perform normalization
tic
[NormImg, RMSE, R_ad] = LIRRN(N, SubImg, RefImg);
Time = round(toc, 2);
%% Results depiction
disp(['Time= ', num2str(Time), ' (s).'])
% Display images
figure('color', 'w'), imshow(uint8(abs(SubImg(:,:,[3 2 1]))),[]), title('Subject image','FontName','Times New Roman')
figure('color', 'w'), imshow(uint8(NormImg(:,:,[3 2 1])),[]), title('Normalized image','FontName','Times New Roman')
figure('color', 'w'), imshow(uint8(RefImg(:,:,[3 2 1])),[]), title('Reference image','FontName','Times New Roman')