From: aasim Azooz on
"Avengeline " <avengeline.biz(a)gmail.com> wrote in message <hi1pk4$p51$1(a)fred.mathworks.com>...
> I am working on a project of calculating edge width in an image. I have to scan every row in the image to calculate the edge width. In order to do so, I need to detect several local minima and maxima for each row. An edge exists in between a local maxima and minima. There might be a few edges in one row. Any idea how to detect the local minima and maxima?

Hi
You can use my programs maxima and minima on the matlab file exchange library.
Good Luck
Aasim Azooz
From: Avengeline on
I am sorry for all the confusion.

I uploaded the graph for 'a row of image, which is row = 240' here: http://farm5.static.flickr.com/4062/4302374885_0e70709e00_b.jpg

y-axis = pixel value
x-axis = pixel position (column)

I managed to obtain the coordinates through edge detection. In the graph. 2 edge locations are detected at [240, 22] - Y and [240, 80] - X.

I have problem to detect local maximas and local minimas (P1, P2, P3, P4) of the edge locations (X and Y). For example, the local maxima for an edge at X is P2 and local minima is P1.

Anyone can help?
From: Avengeline on
I saw from a journal paper mentioning about a difference filter like local maximum filter/local minimum filter to detect the local maxima/minima. Does the filter exist in the Matlab library?
From: ImageAnalyst on
Avengeline :
Did you not see my earlier reply?
I said you can use imregionalmax() in the Image Processing Toolbox.
"BW = imregionalmin(I) computes the regional minima of I. The output
binary image BW has value 1 corresponding to the pixels of I that
belong to regional minima and 0 otherwise. BW is the same size as I.

Regional minima are connected components of pixels with a constant
intensity value, and whose external boundary pixels all have a higher
value. "

You can use imregionalmin() to find the local minima.
Alternatively you can use the findpeaks() function in the Signal
Processing Toolbox, or use similar functions people have uploaded to
the File Exchange.
"pks = findpeaks(data)finds local maxima or peaks pks in the input
data. data must be a row or column vector with real-valued elements
and have a minimum length of three. findpeaks compares each element of
data to its neighboring values. If an element of data is larger than
both of its neighbors, it is a local peak. If there are no local
maxima, pks is an empty vector."


Let me know if you've seen this reply.
From: Avengeline on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <673c91de-3ff0-4513-b5c6-8e5b44216873(a)q4g2000yqm.googlegroups.com>...
> Avengeline :
> Did you not see my earlier reply?
> I said you can use imregionalmax() in the Image Processing Toolbox.
> "BW = imregionalmin(I) computes the regional minima of I. The output
> binary image BW has value 1 corresponding to the pixels of I that
> belong to regional minima and 0 otherwise. BW is the same size as I.
>
> Regional minima are connected components of pixels with a constant
> intensity value, and whose external boundary pixels all have a higher
> value. "
>
> You can use imregionalmin() to find the local minima.
> Alternatively you can use the findpeaks() function in the Signal
> Processing Toolbox, or use similar functions people have uploaded to
> the File Exchange.
> "pks = findpeaks(data)finds local maxima or peaks pks in the input
> data. data must be a row or column vector with real-valued elements
> and have a minimum length of three. findpeaks compares each element of
> data to its neighboring values. If an element of data is larger than
> both of its neighbors, it is a local peak. If there are no local
> maxima, pks is an empty vector."
>
>
> Let me know if you've seen this reply.

Hi. Thanks a lot for the reply. I will try to work it out first based on the information your provided. Willl update on this again.