function ok = VisualizePrincipleImage(component, fileName) % image = VisualizePrincipleImage(component) % This function normalizes a component so that you can see it as an image. % Author : Sasakthi Abeysinghe, Timothy Simpson % Date : 04/05/2006 global imageHeight; global imageWidth; minValue = min(component); maxValue = max(component); component = component - minValue; component = uint8(round((component * 255) ./ (maxValue - minValue))); componentImage = reshape(component, imageHeight, imageWidth, 3); imwrite(componentImage, fileName); figure; image(componentImage);