You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm sorry to bother you. First of all, thank you for your work. I have learned great knowledge. In addition, I have a question to ask. In the comparison experiment, how can I use the MSR method to output the light map? Is it like the SSRlog in the following code that directly outputs the filtered results?
function OUT = SSR(I, varargin)
T = imgaussfilt(I, varargin{:});
OUT = I./(T); % avoid NaN
end
function OUT = SSRlog(I, varargin)
OUT = imgaussfilt(I, varargin{:});
%OUT = log(I) - log(T+1) + 0.5;
end
function OUT = MSR(I, varargin)
if numel(varargin) == 0
varargin = {25 100 240}; %{25 100 240}
end
OUT = 0; N = numel(varargin);
for n = 1:N
OUT = OUT + (1/N)* multiscaleRetinex(I,'SSR',varargin{n});
end
end
function OUT = MSRCR(I, lowScale, medScale, highScale, leftChop, rightChop)
if ~exist('lowScale', 'var'), lowScale = 15; end
if ~exist('MedScale', 'var'), medScale = 80; end
if ~exist('HighScale', 'var'), highScale = 250; end
if ~exist('s1', 'var'), leftChop = 1; end
if ~exist('s2', 'var'), rightChop = 1; end
for c = 1:3
CR = (log(125*I(:,:,c))-log(I(:,:,1)+I(:,:,2)+I(:,:,3)));
OUT(:,:,c) = colorBalance(mat2gray(CR.*MSR(:,:,c)), 'simplest', leftChop, rightChop);
end
%OUT = max(0, min(1, OUT));
end
The text was updated successfully, but these errors were encountered:
Hello,
I'm sorry to bother you. First of all, thank you for your work. I have learned great knowledge. In addition, I have a question to ask. In the comparison experiment, how can I use the MSR method to output the light map? Is it like the SSRlog in the following code that directly outputs the filtered results?
function OUT = SSR(I, varargin)
T = imgaussfilt(I, varargin{:});
OUT = I./(T); % avoid NaN
end
function OUT = SSRlog(I, varargin)
OUT = imgaussfilt(I, varargin{:});
%OUT = log(I) - log(T+1) + 0.5;
end
function OUT = MSR(I, varargin)
if numel(varargin) == 0
varargin = {25 100 240}; %{25 100 240}
end
OUT = 0; N = numel(varargin);
for n = 1:N
OUT = OUT + (1/N)* multiscaleRetinex(I,'SSR',varargin{n});
end
end
function OUT = MSRCR(I, lowScale, medScale, highScale, leftChop, rightChop)
if ~exist('lowScale', 'var'), lowScale = 15; end
if ~exist('MedScale', 'var'), medScale = 80; end
if ~exist('HighScale', 'var'), highScale = 250; end
if ~exist('s1', 'var'), leftChop = 1; end
if ~exist('s2', 'var'), rightChop = 1; end
MSR = multiscaleRetinex(I, 'MSR', lowScale, medScale, highScale);
for c = 1:3
CR = (log(125*I(:,:,c))-log(I(:,:,1)+I(:,:,2)+I(:,:,3)));
OUT(:,:,c) = colorBalance(mat2gray(CR.*MSR(:,:,c)), 'simplest', leftChop, rightChop);
end
%OUT = max(0, min(1, OUT));
end
The text was updated successfully, but these errors were encountered: