function [P,filename,pathname,Params]=centers_list(filename,pathname,Params,DPLAY) % Usage: [P,filename,pathname,Params]=centers_list(filename,pathname,Params,DPLAY) % Input: Default usage - centers_list([],[],struct([]),'ON') % filename - Filename of image file % pathname - Directory containing image file % Params - Parameters for cleaning up image as in CleanImage.m % DPLAY - Sets plots 'ON' or 'OFF'; % Output: % P - array with 4 columns [Label index | Y position | X position | Area ] % filename, pathname, Params - Same as input, except nonempty values are % provided when input values are empty. % Obtain image file if isempty(filename)||isempty(pathname)==1 [filename,pathname]=uigetfile('*','Select an image file'); end % Read imag rawimg=imread(fullfile(pathname,filename)); rawimg=uint8(sum(rawimg,3)/3); % Convert color image to grayscale. % Cleanup image and threshold it to generate a binary image [img,Params]=CleanImage(rawimg,Params); THOLD=mean(img(:))-std(img(:));% Threshold should preferable depend on image characteristics BW=img