Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 24 lines (21 sloc) 697 Bytes
function im_new = pre_process_image(im, perform_minimum_subtraction, minimum_intensity_level,image_mask)
% This function applies common pre-processing operations for the image
% 1. Converts to double
% 2. Peforms minimum subtraction if required
% 3. Flips image upside down
%
% INPUTS:
% im: image
% id: data structure containing
% convert images to double arrays
im_new = double(im);
% peform minimum subtraction if required
if perform_minimum_subtraction
im_new = im_new - minimum_intensity_level;
im_new(im_new < 0) = 0;
end
% flip images upside down
im_new = flipud(im_new);
% image masking
im_new = im_new .* image_mask;
end