Anda di halaman 1dari 1

% PROGRAM DESCRIPTION %

%The purpose of this program is to take an inputed tif file and


%correspondingly calculate the area, and the first moments around the x and
%y axes. The program will automatically output these values.
%In addition to these calculations and outputs, a tif file will be created
%that will be a replica of the original image only with the center pixel of
%the image turned to grey.
%
% DATA & FUNCTION DICTIONARY %
%
%x - the matrix that correspondes to each pixel of the imported image
%map - ncessary code for the values given in the x matrix
%Area - variable that contains the area of the object in the image
%i - corresponds to the ith row of the image
%j- corresponds to the jth column of the image
%horiz_proj - matrix that contains the horizontal projection of each row, where each row
corresponds to a column in the matrix.
%ibar_Area - value that corresponds to the multiplication of Area and ibar
%ibar - the distance on the i-axis for the center of the object in the image
%vert_proj - matrix that contains the vertical projection of each column, where each row
corresponds to a column in the matrix
%jbar_Area - value that corresponds to the multiplication of Area and jbar
%jbar - the distance on the j-axis for the conter of the object in the image
%Area_Calculated - the value of 'Area' in a string that is formatted to have 5 digits before the
decimal point and padded with
%
zeros if needed. there will be no digits after the decimal point.
%ibar_Calculated - the value of 'ibar' in a string that is formatted to have 3 digits before the
decimal point and padded with
%
zeros if needed. there will be 4 digits after the decimal point.
%jbar_Calculated - the value of 'jbar' in a string that is formatted to have 3 digits before the
decimal point and padded with
%
zeros if needed. there will be 4 digits after the decimal point.
%
%close all - MATLAB function for closing open plot windows
%clear all - MATLAB function for clearing all stored variable
%clc - MATLAB function for clearing the command window
%echo off - MATLAB function for preventing statement to be displayed while preforming the
function
%imread - MATLAB function for reading in an image and storing its pixel values into a matrix
%sprintf - MATLAB function for converting a number into a string as well as formatting the
string.
%fprintf - MATLAB function for printing text, data and more to the command window. It also
allows for easy formatting.
%imwrite - MATLAB function that writes an image to a specified name and file type
%

Anda mungkin juga menyukai