Skip to content

Commit

Permalink
Optimize RX.
Browse files Browse the repository at this point in the history
Fix color space list.
  • Loading branch information
nathanntg committed Apr 6, 2015
1 parent 7fc7ecf commit fedf4d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions RX_global.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
% Create mean color column vector
mu=mean(CC)';

% Preallocate
img_out = zeros(img_size1, img_size2);

for i=1:img_size1
for j=1:img_size2
% Locate center pixel and convert to column vector
r=reshape(Data(i,j,:),channels,[]);
r = squeeze(Data(i, j, :));

% Run RX detector on center pixel
d(1+i,1+j)=(r-mu)'*K^-1*(r-mu);
img_out(i,j)=(r-mu)'/K*(r-mu);
end
end
img_out=d;
2 changes: 1 addition & 1 deletion run_script.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function run_script(scene_file)
color_spaces{end + 1} = @(img) select_channel(im_rgb2upvpl(img), 1:2);
color_spaces{end + 1} = @(img) select_channel(im_rgb2uvl(img), 1:2);
color_spaces{end + 1} = @(img) select_channel(im_rgb2xyz(img), [1 3]);
color_spaces{end + 1} = @(img) select_channel(im_rgb2lab(img), [1 3]);
color_spaces{end + 1} = @(img) select_channel(im_rgb2xyy(img), [1 3]);
color_spaces{end + 1} = @(img) transform_channel(im_rgb2lab(img), 1, @log);

% load file
Expand Down

0 comments on commit fedf4d0

Please sign in to comment.