|
From: | Alasdair McAndrew |
Subject: | Re: grayscale image processing |
Date: | Thu, 2 Jan 2014 22:04:42 +1100 |
There may be an easier way than this, but if there is I can't think of it right now.Z = X*Y[X,Y] = meshgrid(1:R,1:C);Then:[R,C] = size(im)To get your 3 x N array, suppose your image has R rows and C columns. That is:Is this the sort of thing you want?If you'd prefer a circular neighbourhood, try something likewhich will give you a 5x5 neighbourhood centred on the first pixel in your list.im(i(k)-2:i(k)+2,j(k)-2:j(k)+2)k = 1This will give you vectors of i and j indices. And to look at pixel values around such a peak, you can always isolate a local neighbourhood with[i,j]=find(im>=max(im(:))-m)m = 10To find the largest values, say in an 8-bit grayscale image, you can door for values which are nearly as large:
[i,j]=find(im==max(im(:)))
rad = 3[x,y] = meshgrid(-rad:rad);
circ = x.^2+y.^2>rad^2
im(i(k)-rad:i(k)+rad,j(k)-rad:j(k)+rad).*circ
[reshape(X,Z,1),reshape(Y,Z,1),reshape(im,Z,1)]
--On Mon, Dec 23, 2013 at 8:39 PM, fulviosaccoccia <address@hidden> wrote:
Dear Octave users,
this is my first post.
I would like to extract a 3xN matrix from grayscale image files (tiff, img,
cbf format). These images contain a series of "2D peaks". Each of these
peaks are ultimately a cluster of high intensity grayscale pixel I already
know to follow a Normal distribution, over a background of low intensity
pixel. Then, I would like to obtain a three columns matrix where the first
two columns report the coordinates in pixels, while the third one report the
intensity of gray. Later, my purpose will be to analize the distribution of
the maximum of the intensity of gray. Ultimately, I would to reconstruct a
series of Gaussian by the data extracted from the images.
The final goal will be to ascertain if a "peak" in the original image
contain the contribution of a minor "satellite peak".
I have used
I=imread("file.tiff") in order to otain the I matrix but I do not know how
to deal with it to finally obtain the 3xN matrix.
Hoping I have been clear,
thank you to all
Fulvio
--
View this message in context: http://octave.1599824.n4.nabble.com/grayscale-image-processing-tp4660324.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave
Blog: http://amca01.wordpress.com
Web: http://sites.google.com/site/amca01/
Facebook: http://www.facebook.com/alasdair.mcandrew
[Prev in Thread] | Current Thread | [Next in Thread] |