Code covered by the BSD License
-
histogram(varargin)
GUI for Plotting historgam and equalizing image arrays
-
image_mva(varargin)
GUI for Multivariate Analysis of images
-
profiles(varargin)
GUI for plotting profiles for image arrays
-
threshold(varargin)
GUI for thresholding images
-
Cont=Contingency(Mem1,Mem2)
CONTINGENCY Form contigency matrix for two vectors
-
DCAgg(Distance, Method, k)
DCAGG Performs agglomerative clustering
-
LogFactorial(n)
LOGFACTORIAL Calculates the Natural log of the factorial of n
-
MakeGaussData(NCentres,NDims,...
MAKEGAUSSDATA - Creates spherical data clouds
-
MaxMax(x)
MAXMAX Maximum of all elements in an n-dimension array
-
MeanMean(x)
MEANMEAN Mean of all elements in an n-dimension array
-
MinMin(x)
MINMIN Minimum of all elements in an n-dimension array
-
PCAGraph(X,dims,labels)
PCAGRAPH Plots data projected onto its first 2 principal components
-
SumSum(x)
SUMSUM Sums all elements in an n-dimension array
-
[AR,RI,MI,HI]=RandIndex(c1,c2...
RANDINDEX - calculates Rand Indices to compare two partitions
-
[C,perm]=ChooseInitialCentres...
CHOOSEINITIALCENTRES Randomly picks sample points
-
[Classes,Centres,FinalDistanc...
DCKMEANS Performs k-means clustering
-
[RITrue,RISelf,EstIndex]=DoCl...
DOCLUSTERING Performs cluster analysis of specified data using specified
-
[mix, class,likelihood]=dcEMG...
DCEMGMM - estimates Gaussian Mixture Model using the EM algorithm
-
[purspec,purint,purity_spec]=...
function [purspec,purint,purity_spec]=simplisma(data,varlist,offset,n,data2);
-
array_subset=array_downsizing...
function array_subset=array_downsizing(array, N);
-
c=PlotColour(index,lineflag)
PLOTCOLOUR Returns colour and marker string for PLOT
-
class=im_class_MLE(im,plot);
function class=im_class_MLE(im,plot);
-
data_der=invder(data)
data_der=invder(data)
-
dcFuzzy(X,c,m,InitCentres)
DCFUZZY Performs fuzzy c-means clustering
-
im=vms_im_read(filename,plot)...
im=vms_im_read(filename,plot);
-
threshold_grayscale_image(ori...
431-400 Year Long Project
-
Contents.m
-
DcDemo.m
-
uigetfiles.m
-
View all files
from
GUI for Multivariate Image Analysis of Multispectral Images
by Kateryna Artyushkova
A GUI for MIA of multispectral image data sets (PCA, Simplisma, MCR, classification).
|
| threshold_grayscale_image(original_image,min_threshold,max_threshold)
|
% 431-400 Year Long Project
% LA1 - Medical Image Processing 2003
% Supervisor : Dr Lachlan Andrew
% Group Members : Alister Fong 78629 a.fong1@ugrad.unimelb.edu.au
% Lee Siew Teng 102519 s.lee1@ugrad.unimelb.edu.au
% Loh Jien Mei 103650 j.loh1@ugrad.unimelb.edu.au
%
% The function without any numbers at the name of its name is the most up-to-date version intended
% for use.
% Current version in use : Version 6 - threshold_grayscale_image5
%
% File and function name : threshold_grayscale_image
% Version : 6.0
% Date of completion : 2 May 2003
% Written by : Alister Fong 78629 a.fong1@ugrad.unimelb.edu.au
%
% Inputs : original_image - original grayscale image (0 - black, 255 - white)
% min_threshold - minimum value that should be recognized as a feature.
% max_threshold - maximum value that should be recoginized as a feature
%
% Outputs : thresholded_image - binary thresholded image
% (Feature = black(0) otherwise white(255) as indicated in Version 5)
%
% Description : If the pixel in the original image has a value between the min_threshold
% and max_threshold, then it will be assigned as a white pixel in the binary
% image. Otherwise it will be a black pixel.
%
% To Run >> thresholded_image = threshold_grayscale_image(original_image,min_threshold,max_threshold)
% (0 <= min_threshold, max_threshold<= 255)
% Version 1
% The speed of this program is too slow
%
% Version 2
% This is a faster version of threshold_grayscale_image using vectorized methods
% instead of 'for' loops. The previous version took around 56 seconds to execute
% on a 600 x 600 grayscale image, while this version takes about 4 seconds.
% Problem : This is still too slow for multiple usage as a 1924 x 2886
% image takes about 4 minutes to process.
%
% Version 3
% In this version, the use of vector form of pixel selection to assign the black
% pixel value has improved the speed of this program.
% Problem : This is still too slow for multiple usage as a 1924 x 2886
% image takes about 4 minutes to process. However, the speed
% bottleneck is now the initialization of the thresholded_image
% to be all white pixels.
%
% Version 4
% This is a fastest version of threshold_grayscale_image using vectorized methods
% instead of 'for' loops. The initialization of the thresholded_image has been
% changed to a more vectorized form using a faster 2 step method of initialization.
% Problem : This is still too slow for multiple usage as a 1924 x 2886 image
% takes about 2 minutes to process.
%
% Version 5
% To speed up the process by about twice the previous speed, we redefine the output
% If there is a feature, it will be represented by white(255) otherwise by black(0)
% Now there is a maximum processing time of about 3 minutes for a 1924 x 2886 image
%
% Version 6
% Change the resultant image to 0 for black(non-feature) and 1 for white(feature)
function thresholded_image = threshold_grayscale_image(original_image,min_threshold,max_threshold)
% Initialize the value of black and white pixels
%black_pixel = 0;
white_pixel = 1;
% Ensure that the threshold inputs are acceptable
if min_threshold > max_threshold
error('threshold_grayscale_image : min_threshold is greater then max_threshold');
end
%Generate the resulting image
%Initialize the image to be all black (non-feature)
%Method used here is optimized for speed
thresholded_image = zeros(size(original_image));
%Find all pixels which are the feature
selected = find((min_threshold <= original_image) & (original_image <= max_threshold));
%Assign the white pixel value to all coordinates of features
thresholded_image(selected) = white_pixel;
|
|
Contact us at files@mathworks.com