0 Up votes0 Down votes

333 views12 pagessegmentation marrs data using matlab

Jun 09, 2009

© Attribution Non-Commercial (BY-NC)

PDF, TXT or read online from Scribd

segmentation marrs data using matlab

Attribution Non-Commercial (BY-NC)

333 views

segmentation marrs data using matlab

Attribution Non-Commercial (BY-NC)

- Steve Jobs
- Wheel of Time
- NIV, Holy Bible, eBook
- NIV, Holy Bible, eBook, Red Letter Edition
- Cryptonomicon
- The Woman Who Smashed Codes: A True Story of Love, Spies, and the Unlikely Heroine who Outwitted America's Enemies
- Contagious: Why Things Catch On
- Crossing the Chasm: Marketing and Selling Technology Project
- Everybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are
- Zero to One: Notes on Start-ups, or How to Build the Future
- Console Wars: Sega, Nintendo, and the Battle that Defined a Generation
- Dust: Scarpetta (Book 21)
- Hit Refresh: The Quest to Rediscover Microsoft's Soul and Imagine a Better Future for Everyone
- The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution
- Crushing It!: How Great Entrepreneurs Build Their Business and Influence—and How You Can, Too
- Make Time: How to Focus on What Matters Every Day
- Algorithms to Live By: The Computer Science of Human Decisions
- Wild Cards

You are on page 1of 12

html

Original image (im)

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

in isolated empty pixels (bwmorph(bw2,'fill')), and thickening (bwmorph(bw3,'thicken',5)) connected

regions. It is important that the thickening algorithm will not connected disconnected regions.

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.

disp('oops, image not grayscale!');

end

bw2 = bwmorph(bw1,'close'); % do boundary closure

bw3 = bwmorph(bw2,'fill'); % fill isolated empty pixels

bw4 = bwmorph(bw3,'thicken',5); % thicken patch regions w/o connecting

[cim,num] = bwlabel(bw4); % label each connected region

% point inside the nth connected region. a connected region is a connected

% blob of points.

% this makes it easy to calculate location of the blobs

[gx,gy] = meshgrid(1:size(im,2),1:size(im,1));

npix = prod(size(im)); % number of pixels in the image

c = (cim==k) .* im; % extract the kth connected region

wt = npix/sum(sum(c)); % find , by taking a weighted mean

x(k) = mean2(gx.*c)*wt;

y(k) = mean2(gy.*c)*wt;

end

clf; % clear current figure

imshow(im); % display the original image

hold on; % allow us to plot on top of the image

plot(x,y,'kx'); % plot black x's where we think blobs are

imzoom on; % allow user to zoom in with mouse

tiffwrite(q,map,'0-marked.tif','compress'); % output it to file

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

Version 2.0 Beta 15-Nov-1996

Release notes

Readme - Version 2.0 Beta release notes.

dither - Floyd-Steinberg image dithering.

gray2ind - Convert gray scale intensity image to indexed image.

im2bw - Convert image to black and white by thresholding.

ind2gray - Convert indexed image to gray intensity image.

ind2rgb - Convert indexed image to an RGB image.

isbw - True for black and white images.

isgray - True for intensity images.

isind - True for indexed images.

mat2gray - Convert matrix to (gray) intensity image.

rgb2gray - Convert RGB values to gray.

rgb2ind - Convert RGB image to indexed image.

imread - Read an image file.

imwrite - Write an image file.

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).

contour - Contour (level curves) plot (MATLAB Toolbox).

corr2 - Two-dimensional correlation coefficient.

imhist - Image histogram.

impixel - Color of a pixel.

improfile - Intensity profile.

mean2 - Mean of a matrix.

std2 - Two-dimensional standard deviation.

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

convmtx2 - Two-dimensional convolution matrix.

convn - N-dimensional convolution (MATLAB Toolbox).

filter2 - Two-dimensional filtering (MATLAB Toolbox).

fspecial - Special 2-D filters.

freqspace - Frequency response spacing (MATLAB Toolbox).

freqz2 - Two dimensional frequency response.

fsamp2 - 2-D FIR filter design via frequency sampling.

ftrans2 - 2-D FIR filter design via frequency transformation.

fwind1 - 2-D FIR filter design using 1-D windows.

fwind2 - 2-D FIR filter design using 2-D windows.

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.

bestblk - Best block size for block processing.

blkproc - Process an image in blocks.

col2im - Rearrange distinct or sliding column blocks to form image.

colfilt - Local non-linear filtering as columns.

im2col - Rearrange distinct or sliding blocks into columns.

medfilt2 - Two-dimensional median filtering.

nlfilter - Local non-linear filtering.

ordfilt2 - 2-D order-statistic filtering.

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).

applylut - Binary image lookup table operation.

bwarea - Area of objects in binary image.

bweuler - Euler number.

bwfill - Binary image flood fill.

bwlabel - Label connected components in a binary image.

bwmorph - Morphological operators.

bwperim - Perimeter of objects in a binary image.

bwselect - Select objects in a binary image.

dilate - Dilate (thicken) a binary image.

erode - Erode (thin) a binary image.

makelut - Generate LUT for use in APPLYLUT.

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

ycbcr2rgb - Convert YCbCr values to RGB values.

BW2 = BWMORPH(BW1,OPERATION) applies a specific

morphological operation to the binary image BW1.

output image BW2 is of class uint8.

times. N can be Inf, in which case the operation is repeated

until the image no longer changes.

'bothat' Subtract the input image from its closing

'bridge' Bridge previously unconnected pixels

'clean' Remove isolated pixels (1's surrounded by 0's)

'close' Perform binary closure (dilation followed by

erosion)

'diag' Diagonal fill to eliminate 8-connectivity of

background

'dilate' Perform dilation using the structuring element

ones(3)

'erode' Perform erosion using the structuring element

ones(3)

'fill' Fill isolated interior pixels (0's surrounded by

1's)

'hbreak' Remove H-connected pixels

'majority' Set a pixel to 1 if five or more pixels in its

3-by-3 neighborhood are 1's

'open' Perform binary opening (erosion followed by

dilation)

'remove' Set a pixel to 0 if its 4-connected neighbors

are all 1's, thus leaving only boundary

pixels

'shrink' Shrink objects without holes to single pixels;

shrink objects with holes to connected rings

'skel' Remove pixels from the boundaries of objects

without changing their 8-connectivity

'spur' Remove spur pixels

'thicken' Add pixels to the boundaries of objects

without changing their 8-connectivity

'thin' Shrink objects without holes to lines; shrink

objects with holes to connected rings

'tophat' Subtract the opening from the input image

[L,NUM] = BWLABEL(BW,N) returns a matrix L, of the same size

as BW, containing labels for the connected components in BW.

NUM is the number of connected components found.

N can have a value of either 4 or 8, where 4 specifies

4-connected components and 8 specifies 8-connected components.

0. The pixels labeled 0 are the background. The pixels

labeled 1 make up one component, the pixels labeled 2 make

up a second component, and so on.

output matrix L is of class double.

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

>> help images/Readme

Toolbox, version 2.0. The purpose of this file is to describe the ways

in which the toolbox differs from version 1.0. Topics include:

- general enhancements

- new functions

- enhancements to specific functions

- compatibility issues

- bug fixes

GENERAL ENHANCEMENTS

the Image Processing Toolbox User's Guide for more information about these

enhancements.

Most of the functions in the toolbox have been rewritten to take

advantage of MATLAB's support of unsigned 8-bit integers (uint8 data).

You can now read images into MATLAB as uint8 arrays, and process these

images with the toolbox functions. As a result, memory usage for most

image-processing operations has been dramatically reduced.

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.

imfinfo - Return information about image file (MATLAB Toolbox).

imread - Read image file (MATLAB Toolbox).

imwrite - Write image file (MATLAB Toolbox).

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).

applylut - Perform neighborhood operations using lookup tables.

bwfill - Fill background regions in binary image.

bwlabel - Label connected components in binary image.

bwselect - Select objects in binary image.

makelut - Generate lookup table for use with applylut.

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.

There are many new demos and sample images in the toolbox. To see a

complete list, type:

helpwin imdemos

capabilities. This section summarizes these enhancements.

the same size as the input. The output can be any size, including

empty.

bwmorph - You can now specify the number of iterations as Inf, in which

case bwmorph repeats the specified operation until the image stops

changing.

algorithm and the spatial-domain algorithm used in version 1. The

frequency-domain algorithm is faster for large structuring elements,

but uses more memory. Also, the spatial-domain algorithm is faster

than it was in version 1.

edge - There are two new methods available, 'log' and 'zerocross'.

images as well as colormaps.

than in version 1.

imshow - The imshow function has been enhanced in many ways. See the

User's Guide for information about imshow.

COMPATIBILITY ISSUES

N-dimensional arrays, most of the functions in the toolbox have been

rewritten. This has introduced some incompatibilities that you should be

aware of. This section summarizes these incompatibilities.

Grandfathered functions

"grandfathered." This means that these functions are no longer

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

superseded by new functions in the toolbox or in MATLAB. We recommend

that you do not use the grandfathered functions, and that you rewrite

any M-files you have that rely on them. They will be removed from the

toolbox in a future release.

The function mfilter2 has been renamed roifilt2. mfilter2 has been

grandfathered.

MATLAB:

imzoom - use zoom instead

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

in version 2, but is no longer supported and will be removed in a

future release.

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

a lookup table. The lookup table syntax has been grandfathered, and these

operations are now provided by the makelut and applylut functions.

Also, the syntax in which bwmorph returned a lookup table has been

grandfathered. In some cases, this syntax still works; however, for

many operations, a lookup table is no longer used, and this syntax

produces a warning.

because it does not work well.

In version 1, some of the toolbox functions could determine the type of

an image based on its data range, and process it accordingly. An image

with integer values greater than 1 was always an indexed image.

with integer values greater than 1 can be indexed, intensity, or RGB.

Therefore, certain functions now require you to specify the image

type. These functions are blkproc, colfilt, im2col, medfilt2, and

nlfilter. For example, to process an indexed image with medfilt2:

X2 = medfilt2(X1,'indexed')

image, and the results may not be correct.

different default method depending on whether the image was indexed or

not. These functions (improfile, imrotate, and imresize) now always default

to nearest neighbor interpolation, regardless of the image type.

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

toolbox that have been fixed in version 2.

bwmorph - The 'thicken', 'skel', and 'thin' operations did not preserve

the Euler number.

nonzero means.

produced double-pixel rather than single-pixel edges; the 'sobel'

method was computed incorrectly; and the 'roberts' method failed to

find some horizontal and vertical lines.

imnoise - The noise variance calculation for the noise type 'speckle'

was incorrect.

points; and the distance-along-profile computation was incorrect in

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.

did not rotate the image.

if the input polygon had closely-spaced vertices.

12 of 12 10/5/00 1:40 PM

- DataProcessing_MATLAB_Lecture1Uploaded byAbdulai Sheriff
- Influence of Word Length on Handwriting RecognitionUploaded byTaquito
- Assign IvpUploaded byRajesh Patil
- Visual Servoing For Robot Navigation.pdfUploaded bygdenunzio
- image processingUploaded byakanaume
- Newer Image Segmentation Methods for Biomedical Object DetectionUploaded byTarundeep Dhot
- Seeded WatershedUploaded byetournay
- 18 1527073370_23-05-2018.pdfUploaded byAnonymous lPvvgiQjR
- Background Segmentation with FeedbackUploaded byFtichi Youness
- Qualitative and Quantitative Evaluation of Two New Histogram Limiting Binarization AlgorithmsUploaded byAI Coordinator - CSC Journals
- IIJCS-2014-08-22-22Uploaded byAnonymous vQrJlEN
- Image Segmentation k Means and Morphological (1)Uploaded byhub23
- Why MatlabUploaded byAkshay Ranot
- IJAIEM-2014-12-01-129Uploaded byAnonymous vQrJlEN
- seg_2007Uploaded bygnoiseztual
- ICBDM Tentative ScheduleUploaded byHector Pratt
- Bogobots-Teen_Mexico_TDP_01.pdfUploaded byRayder S Vasquez
- lab 1:introduction to MATLABUploaded byFatin Zalikha
- 1842-4995-1-SM.pdfUploaded byJess Ortiz
- 1.8Uploaded byGaurav Goyal
- blood vesselsUploaded byGabriel Isaac Gonzalez
- CALCULATION OF AREA, CENTER AND DISTANCE OF CERVICAL CANCER FROM ORGAN AT RISK BY SEGMENTATION OF HISTOGRAM ON CT PELVIC IMAGEUploaded byIJIRAE- International Journal of Innovative Research in Advanced Engineering
- 2008_ECCV_The Naked Truth_Estimating Human Shape Under ClothingUploaded bycherryjiao1986
- Matlab QuizUploaded bySujit Mishra
- 109Uploaded byLukman Hakim Dwi Sugito
- Lab1Uploaded byAli Ahmad
- cvip0Uploaded byHàng Không Mẫu Hạm
- Blasco 2002Uploaded byramblicas
- Mr Brain Image Segmentation Using Region Based Active Contour ModelUploaded byIJSTR Research Publication
- Automatic recognition of surface landmarks of anatomical structures of back and postureUploaded bya7x1st

- 124138375 AVO and Seismic InversionUploaded byMark Mao
- Managing SAP R 3 With TivoliUploaded byTam Captain
- IJLTC V2(2)Uploaded byexcelingtech
- Brief Profile - TMM 05-03-2012Uploaded byNikhil K Rajyaguru
- p181 BogenUploaded byRafael
- Computer Graphics Chapter 1Uploaded byDarajjee Dhufeeraa
- Guest Blogging Survival GuideUploaded byLila Chow
- New FieldsUploaded bySourav Kumar
- KMUG-4_8-20190110-EN.pdfUploaded byFadhilla Alifia Nabila
- 138_SCO-MIG-WP-GPS_QSG-V01-F1Uploaded byBASS_openid
- Mysql Backup Excerpt 5.0 EnUploaded byChristine Wood
- Numpy ReferenceUploaded byscardig
- 4AA3-8753ENWUploaded bySimon Wright
- 16 Lab Guide Prime LmsUploaded byArunkumar Kumaresan
- PDFXVW1Uploaded byzagor_1
- E-brochure CM745 KatalogUploaded bychris moyo
- Composite Development Architecture GuidelinesUploaded byLeón Bala
- Student Management SystemUploaded bySudhakar Reddy
- Reseaux III Win2k8Uploaded byGaetan Robert Lescouflair
- SerVision - [System Configuration Guide v8.3 May 2007]Uploaded byPakne Lia
- Cementometer Complete DataUploaded bygeorgecv
- Erlang Programming Style GuideUploaded byDmitrii 'Mamut' Dimandt
- CodesysUploaded byQuillar Quintero
- Lifepak 1000 Data SheetUploaded byEnerspect Medical Solutions
- TF1.7 How to Guides_Flip-Flop ShootingUploaded byNdomadu
- Mitsubishi_ADVANCE_TechNote_Iron and Steel Plant Electrical Equipment.pdfUploaded bykokonut1128
- Bisection MethodUploaded byMuhammad Faiz
- 2.158EN_BC_GAAS80_GAA100_DOWNLOAD.pdfUploaded bySrikanth Srikanti
- Checkpoint SeminarUploaded byJuan Garcia
- FLASH MX LECTURE.pdfUploaded byPhoebe Joy Dionisio

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.