Login  Register

Re: how to measure length of lines

Posted by Kirmse Robert on Mar 17, 2006; 8:29am
URL: http://imagej.273.s1.nabble.com/Open-images-tp3703382p3703388.html

Hi Rinto,

to shrink the lines use the "skeletonize" features in the menu
"Process -> Binary -> skeletonize"
You have to convert your image to binary format though.

If you want to save the image then as a matrix
I would save the image as Text image wich gives you basically
a Matrix with colums and rows representing the resolution of the image
(512x512 pixel image would give a text table of 512 x 512 columns and rows)
in the matrix cell you will find the values for the pixels.
Because you have saved a binary image if you followed the above procedure
you will get a matrix with values of 0 and 255
Use "save as > text image.

I have pasted the result of a 10x10 pixel images with a black line which was
skeletonized below
(saved as text image)


//--------------------------  Example of a 10x10 pixel images saved as text
--------------------
// Zeros representing the position of the black pixels

255 255 255 255 255 255 255 255 255 255
255 255 255 255 0 0 255 255 255 255
255 255 255 0 255 255 0 255 255 255
255 255 0 255 255 255 255 255 255 255
255 255 255 0 0 0 255 255 255 255
255 255 255 255 255 255 0 255 255 255
255 255 255 255 255 255 255 0 255 255
255 255 255 255 0 0 0 255 255 255
255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255
 


Hope that helps and/or was what you wanted.

Cheers
robert

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Rinto
Anugraha
Sent: Donnerstag, 16. März 2006 14:23
To: [hidden email]
Subject: how to measure length of lines

Dear All,

I have one 16bits grayscale image which contain only some curved black
lines, and the other areas is white.
The black lines are not the straight ones, and also have their width more
than one pixel.
How to measure the length of lines? Is it possible to shrink the width lines
into only one pixel? Is there any plug-in, so we can transfer all
coordinates of pixels and their values into a matrix, in which the matrix
rows and colums same as the pixel size of the image.
Thanks

Rinto Anugraha
Kyushu University, JAPAN

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com