Professional Documents
Culture Documents
html
Problem is this picture has some holes and the blobs are not well formed.
1 of 12 10/5/00 1:40 PM
Image cluster analysis of Marr's Data http://www-snow.stanford.edu/~ike/marr/cluster.html
After this step, bwlabel(bw4) is used to label the pixels of each connected region with a number.
2 of 12 10/5/00 1:40 PM
Image cluster analysis of Marr's Data http://www-snow.stanford.edu/~ike/marr/cluster.html
This allows us to mask out the region corresponding to single blobs from the original picture. We
then take a weighted mean of these pixels to determine the center point. This is done for each of the
19 blobs.
Results:
region# x y
1 67.77 66.61
2 75.33 8.30
3 82.30 223.76
4 86.80 114.64
5 101.29 54.31
6 104.31 162.75
7 120.42 102.56
3 of 12 10/5/00 1:40 PM
Image cluster analysis of Marr's Data http://www-snow.stanford.edu/~ike/marr/cluster.html
8 135.45 43.00
9 138.98 153.05
10 149.05 211.71
11 155.37 93.12
12 157.57 14.59
13 170.92 47.64
14 172.17 139.85
15 188.95 80.52
16 193.76 19.94
17 205.60 125.92
18 222.89 68.39
19 240.87 117.67
Program:
%
% File: clusterim.m
% Date: 17-Oct-97
% Author: I. Chuang
%
% MATLAB5 script: read in an image with white dots and find where they
% are located, quantitatively.
fprintf(1,'region# x y\n');
for k = 1:length(x)
fprintf(1,' %3d %8.2f %8.2f\n',k,x(k),y(k));
end
4 of 12 10/5/00 1:40 PM
Image cluster analysis of Marr's Data http://www-snow.stanford.edu/~ike/marr/cluster.html
Release notes
Readme - Version 2.0 Beta release notes.
Image display.
colorbar - Display color bar (MATLAB Toolbox).
getimage - Get image data from axes.
image - Display indexed image (MATLAB Toolbox).
imagesc - Scale data and display as image (MATLAB Toolbox).
immovie - Make a movie of an image deck.
imshow - Display all types of image data.
imzoom - Zoom in and out an image or 2-D plot.
montage - Display an image deck as a rectangular montage.
subimage - Display multiple images.
truesize - Resize figure so that image is actual size.
warp - Warp an image onto a surface.
Geometric operations.
griddata - Data gridding and surface fitting (MATLAB Toolbox).
imcrop - Crop image.
imresize - Resize image.
imrotate - Rotate image.
interp2 - Two-dimensional data interpolation (MATLAB Toolbox).
Image analysis.
edge - Edge extraction.
qtdecomp - Quadtree decomposition.
qtgetblk - Get block values according to a quadtree decomposition.
qtsetblk - Assign block values according to a quadtree decomposition.
Image enhancement.
grayslice - Density (intensity) slicing.
histeq - Histogram equalization.
imadjust - Adjust and stretch image intensity.
imnoise - Image noise.
wiener2 - Adaptive 2-D Wiener filtering.
Linear filtering.
5 of 12 10/5/00 1:40 PM
Image cluster analysis of Marr's Data http://www-snow.stanford.edu/~ike/marr/cluster.html
Image transforms.
dct2 - Two-dimensional discrete cosine transform.
dctmtx - Discrete cosine transform matrix.
fft2 - Two-dimensional fast Fourier transform (MATLAB Toolbox).
fftn - N-dimensional fast Fourier transform (MATLAB Toolbox).
fftshift - Move zeroth lag (DC component) to center (MATLAB Toolbox).
idct2 - Two-dimensional inverse discrete cosine transform.
ifft2 - Two-dimensional inverse FFT (MATLAB Toolbox).
ifftn - N-dimensional inverse fast Fourier transform (MATLAB Toolbox).
radon - Radon transform.
Region-based processing.
mfilter2 - Masked filter.
roicolor - Define region of interest (ROI) by color.
roifill - Smoothly interpolate within a specified region.
roipoly - Define polygonal region of interest (ROI).
Colormap manipulation.
brighten - Brighten or darken a colormap (MATLAB Toolbox).
cmgamdef - Default gamma correction table.
cmgamma - Gamma correct colormap.
cmpermute - Permute colormap positions.
cmunique - Find unique colormap colors and corresponding image.
colormap - Set or get the color look-up table (MATLAB Toolbox).
imapprox - Approximate indexed image by an image with fewer colors.
rgbplot - Plot RGB colormap components (MATLAB Toolbox).
Colorspace conversions.
hsv2rgb - Convert HSV values to RGB values (MATLAB Toolbox).
ntsc2rgb - Convert NTSC values to RGB values.
rgb2hsv - Convert RGB values to HSV values (MATLAB Toolbox).
rgb2ntsc - Convert RGB values to NTSC values.
6 of 12 10/5/00 1:40 PM
Image cluster analysis of Marr's Data http://www-snow.stanford.edu/~ike/marr/cluster.html
7 of 12 10/5/00 1:40 PM
Image cluster analysis of Marr's Data http://www-snow.stanford.edu/~ike/marr/cluster.html
- general enhancements
- new functions
- enhancements to specific functions
- compatibility issues
- bug fixes
GENERAL ENHANCEMENTS
N-dimensional arrays
The toolbox takes advantage of another new MATLAB feature, N-dimensional
arrays. For example, an RGB image is now stored in a single
three-dimensional array, rather than requiring three separate matrices.
In addition, multiframe images no longer require image decks, but can
now be stored and processed in four-dimensional arrays.
Speed-ups
Several of the toolbox functions have been rewritten to run faster, in
some cases substantially so.
NEW FUNCTIONS
This section describes the new functions in the Image Processing Toolbox,
as well as new functions in the MATLAB Toolbox that are useful for
image-processing applications.
Image analysis
qtdecomp - Perform quadtree decomposition.
qtgetblk - Get block values in quadtree decomposition.
qtsetblk - Set block values in quadtree decomposition.
Image enhancement
ordfilt2 - Perform 2-D order-statistic filtering.
Linear filtering
convmtx2 - Compute 2-D convolution matrix.
convn - Perform N-D convolution (MATLAB Toolbox).
8 of 12 10/5/00 1:40 PM
Image cluster analysis of Marr's Data http://www-snow.stanford.edu/~ike/marr/cluster.html
Image transforms
dctmtx - Compute discrete cosine transform matrix.
fftn - Compute N-D fast Fourier transform (MATLAB Toolbox).
ifftn - Compute N-D inverse fast Fourier transform (MATLAB Toolbox).
Region-based processing
roifill - Smoothly interpolate within arbitrary region.
Toolbox preferences
iptgetpref - Get value of Image Processing Toolbox preference.
iptsetpref - Set value of Image Processing Toolbox preference.
helpwin imdemos
bwmorph - You can now specify the number of iterations as Inf, in which
case bwmorph repeats the specified operation until the image stops
changing.
edge - There are two new methods available, 'log' and 'zerocross'.
imshow - The imshow function has been enhanced in many ways. See the
User's Guide for information about imshow.
COMPATIBILITY ISSUES
Grandfathered functions
9 of 12 10/5/00 1:40 PM
Image cluster analysis of Marr's Data http://www-snow.stanford.edu/~ike/marr/cluster.html
The function mfilter2 has been renamed roifilt2. mfilter2 has been
grandfathered.
These image file i/o functions from version 1 have been superseded by
imread, imwrite, and imfinfo:
bmpread
bmpwrite
hdfread
hdfpeak
hdfwrite
pcxread
pcxwrite
tiffread
tiffwrite
xwdread
xwdwrite
The gifread and gifwrite functions have been removed from the toolbox
due to patent restrictions.
uint8 arrays
Many of the functions in the toolbox now return uint8 arrays. For
example, functions that return binary images now return them as uint8
arrays. If you have code that performs mathematical operations on
binary images, you will need to modify this code to convert the images
to double-precision arrays, because mathematical operations are not
supported for uint8 arrays.
In addition, the conventional data ranges are different for uint8 and
double-precision images. For example, a double-precision intensity
image has data in the range [0,1], while a uint8 intensity image has
data in the range [0,255]. See the User's Guide for more information
about differences between uint8 and double-precision images.
RGB images
The toolbox functions that take RGB images as input now accept a single
three-dimensional array rather than three two-dimensional matrices.
For example:
imshow(R,G,B) - v1 syntax
imshow(RGB) - v2 syntax
Image decks
Multiframe images are now stored as four-dimensional arrays, rather
than as image decks. The functions that work with image decks, such as
montage, now accept a 4-D array as input. The image deck syntaxes have
been grandfathered.
Morphological operations
In version 1, the dilate and erode functions accepted either a
structuring element or a string such as 'thin'. The string syntax has
been grandfathered, because in all cases the same operation is
10 of 12 10/5/00 1:40 PM
Image cluster analysis of Marr's Data http://www-snow.stanford.edu/~ike/marr/cluster.html
X2 = medfilt2(X1,'indexed')
dct2 function
This function produces different results than in version 1, because
it now uses the unitary form of the transform.
edge function
The syntax of the edge function has changed substantially. The 'marr'
method has been grandfathered, and has been replaced by two new
methods, 'log' and 'zerocross'. (The 'marr' method will still work,
but will produce different results from version 1.) Also, the
directionality factor is now specified with a string rather than a
vector, and the order of the arguments has changed. For information
about the new syntax, type "help edge" or see the User's Guide.
BUG FIXES
bwmorph - The 'thicken', 'skel', and 'thin' operations did not preserve
the Euler number.
imnoise - The noise variance calculation for the noise type 'speckle'
was incorrect.
11 of 12 10/5/00 1:40 PM
Image cluster analysis of Marr's Data http://www-snow.stanford.edu/~ike/marr/cluster.html
some circumstances.
12 of 12 10/5/00 1:40 PM