Permalink
Cannot retrieve contributors at this time
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?
dot-tracking-package/pre_process_image.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
24 lines (21 sloc)
697 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |