============================================================== FIND_IMAGE_BY_HEIGHT: Find the image whose peak is highest or lowest GENERAL [image_number] = find_image_by_height(images, image_width, number_of_images, type) INPUT/S -images: All the images. -image_width: The width of the images. -number_of_images: The number of images. -type: Allows other (inverse) operations. OUTPUT/S -image_number: The number of the image whose height attributes are requested. PENDING WORK - KNOWN BUG/S -None. COMMENT/S - RELATED FUNCTION/S ABOUT -Created: May 9th, 2004 -Last update: May 2004 -Revision: 0.0.1 -Author: R. S. Schestowitz, University of Manchester ==============================================================
0001 function [image_number] = find_image_by_height(images, image_width, number_of_images, type) 0002 0003 % ============================================================== 0004 % FIND_IMAGE_BY_HEIGHT: Find the image whose peak is highest or lowest 0005 % 0006 % GENERAL 0007 % 0008 % [image_number] = find_image_by_height(images, image_width, number_of_images, type) 0009 % 0010 % INPUT/S 0011 % 0012 % -images: 0013 % All the images. 0014 % 0015 % -image_width: 0016 % The width of the images. 0017 % 0018 % -number_of_images: 0019 % The number of images. 0020 % 0021 % -type: 0022 % Allows other (inverse) operations. 0023 % 0024 % OUTPUT/S 0025 % 0026 % -image_number: 0027 % The number of the image whose height attributes are requested. 0028 % 0029 % PENDING WORK 0030 % 0031 % - 0032 % 0033 % KNOWN BUG/S 0034 % 0035 % -None. 0036 % 0037 % COMMENT/S 0038 % 0039 % - 0040 % 0041 % RELATED FUNCTION/S 0042 % 0043 % 0044 % 0045 % ABOUT 0046 % 0047 % -Created: May 9th, 2004 0048 % -Last update: May 2004 0049 % -Revision: 0.0.1 0050 % -Author: R. S. Schestowitz, University of Manchester 0051 % ============================================================== 0052 0053 for current_image_number = 1:number_of_images, 0054 height_measure(current_image_number) = max(images(:,current_image_number)); 0055 % get peak values 0056 end 0057 0058 % OPTIMISATION NOTE: In the above, very many identical tests are run for 0059 % all images. 0060 0061 if (strcmp(type,'highest')), 0062 required_height = max (height_measure); 0063 elseif (strcmp(type,'lowest')), 0064 required_height = min (height_measure); 0065 end 0066 0067 for current_image_number = 1:number_of_images, 0068 if (height_measure(current_image_number) == required_height), 0069 image_number = current_image_number; 0070 end 0071 end