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?
|
|
0
|
|
|
|
Reply
|
Avengeline
|
1/6/2010 10:45:25 AM |
|
"Avengeline "
> 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?
Help min,max (or nanmin/nanmax). Pay attention to the dim argument.
Oleg
|
|
0
|
|
|
|
Reply
|
oleg.komarov (127)
|
1/13/2010 2:05:21 PM
|
|
On Jan 6, 5:45=A0am, "Avengeline " <avengeline....@gmail.com> wrote:
> I am working on a project of calculating edge width in an image. I have t=
o scan every row in the image to calculate the edge width. In order to do s=
o, I need to detect several local minima and maxima for each row. An edge e=
xists in between a local maxima and minima. There might be a few edges in o=
ne row. Any idea how to detect the local minima and maxima?
If x(i) =3D max(x(i-1:i+1)) is a start. However, you still
have to deal with x(i) =3D x(i-1) and/or x(i) =3D x(i+1).
Similarly with min.
Hope this helps.
Greg
|
|
0
|
|
|
|
Reply
|
heath (3882)
|
1/14/2010 4:40:09 AM
|
|
Greg Heath <heath@alumni.brown.edu> wrote in message <6ff94dab-0022-4f8b-86c7-96c931657d20@b2g2000yqi.googlegroups.com>...
> On Jan 6, 5:45 am, "Avengeline " <avengeline....@gmail.com> wrote:
> > 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?
>
> If x(i) = max(x(i-1:i+1)) is a start. However, you still
> have to deal with x(i) = x(i-1) and/or x(i) = x(i+1).
>
> Similarly with min.
>
> Hope this helps.
>
> Greg
I still can't detect the local minima & maxima through the edge coordinates I obtained. Example, in one row of the image (let's say row = 200), 3 positions of edges are found after edge detection; which are [200 60], [200 155] and [200 240]. Assuming the image is 240 x 240 pixels. So from these coordinates, I have to determine the local minima and maxima for each coordinates based on the graph I plotted for row = 200 of a grayscale image. I am basically stuck here. Any idea?
|
|
0
|
|
|
|
Reply
|
Avengeline
|
1/24/2010 3:48:03 PM
|
|
On Jan 24, 10:48=A0am, "Avengeline " <avengeline....@gmail.com> wrote:
> I still can't detect the local minima & maxima through the edge coordinat=
es I obtained. Example, in one row of the image (let's say row =3D 200), 3 =
positions of edges are found after edge detection; which are [200 60], [200=
155] and [200 240]. Assuming the image is 240 x 240 pixels. So from these =
coordinates, I have to determine the local minima and maxima for each coord=
inates based on the graph I plotted for row =3D 200 of a grayscale image. I=
am basically stuck here. Any idea?
---------------------------------------------------------------------------=
-----------------------------
Avangeline:
You're not describing what you want accurately/specifically enough.
You say you have the positions of the edges. Well the max or min is
simply the value of your edge image at those points. Fore example at
[200,60] it would be edgeImage(200, 60) - simple as that. Because
getting the value of an array at a row,column location is so trivially
obvious, I'm not really sure if this is what you meant. So please
explain better.
If you need help locating the max values in the edge image, you can
use imregionalmax().
Make sure you're using the continuous edge image rather than one
that's already been binarized. For example, use imfilter() rather
than edge() or else you won't know the underlying edge strength
values.
clc;
close all;
clear all;
workspace; % Display workspace panel.
% Read in standard MATLAB demo image.
grayImage =3D imread('cameraman.tif');
subplot(2, 2, 1);
imshow(grayImage, []);
title('Original Grayscale Image');
set(gcf, 'Position', get(0,'Screensize')); % Maximize figure.
edgeImage =3D imfilter(grayImage,fspecial('sobel') /8,'replicate');
subplot(2, 2, 2);
imshow(edgeImage, []);
title('Edge Image');
peakEdges =3D imregionalmax(edgeImage, 8);
subplot(2, 2, 3);
imshow(peakEdges, []);
title('Local Peak (Max) Edges');
minEdgeStrength =3D 15;
strongEdges =3D edgeImage > minEdgeStrength;
subplot(2, 2, 4);
imshow(strongEdges, []);
title('Strong Edges');
Good luck,
ImageAnalyst
|
|
0
|
|
|
|
Reply
|
ImageAnalyst
|
1/24/2010 5:41:12 PM
|
|
"Avengeline " <avengeline.biz@gmail.com> wrote in message <hi1pk4$p51$1@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
|
|
0
|
|
|
|
Reply
|
aasim
|
1/24/2010 10:05:05 PM
|
|
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?
|
|
0
|
|
|
|
Reply
|
Avengeline
|
1/25/2010 6:03:02 AM
|
|
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?
|
|
0
|
|
|
|
Reply
|
Avengeline
|
1/25/2010 4:58:04 PM
|
|
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.
|
|
0
|
|
|
|
Reply
|
ImageAnalyst
|
1/25/2010 5:09:46 PM
|
|
ImageAnalyst <imageanalyst@mailinator.com> wrote in message <673c91de-3ff0-4513-b5c6-8e5b44216873@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.
|
|
0
|
|
|
|
Reply
|
Avengeline
|
1/26/2010 3:47:03 AM
|
|
Dear ImageAnalyst,
I got the all the local minimas already. Do you have any idea how to find the closest minima value to a point, X? Thanks.
Avengeline.
|
|
0
|
|
|
|
Reply
|
Avengeline
|
1/26/2010 5:30:21 AM
|
|
On Jan 26, 12:30=A0am, "Avengeline " <avengeline....@gmail.com> wrote:
> Dear ImageAnalyst,
>
> =A0 =A0I got the all the local minimas already. Do you have any idea how =
to find the closest minima value to a point, X? Thanks.
>
> Avengeline.
-----------------------------------------------------------------
Just take the absolute value of the difference in the index (element)
values at which they occur. The smallest difference (delta x) will be
with the closest min.
|
|
0
|
|
|
|
Reply
|
ImageAnalyst
|
1/26/2010 11:14:20 AM
|
|
Hi ImageAnalyst,
Can I also use imregionalmax to find local maxima? What is the difference between maxima and local maxima?
|
|
0
|
|
|
|
Reply
|
avengeline.biz (12)
|
1/31/2010 3:37:05 AM
|
|
You can use imregionalmin to find local min. Local min are min in one
small area. You could have a local min that is not the global min.
You can have more than one local min and more than one global min if
they have the same value but are physically separated.
|
|
0
|
|
|
|
Reply
|
imageanalyst (7596)
|
1/31/2010 4:08:31 AM
|
|
ImageAnalyst <imageanalyst@mailinator.com> wrote in message <de75006f-dd32-45cf-972e-7425131f3ea4@n7g2000yqb.googlegroups.com>...
> You can use imregionalmin to find local min. Local min are min in one
> small area. You could have a local min that is not the global min.
> You can have more than one local min and more than one global min if
> they have the same value but are physically separated.
Hi. I am trying to develop peak finding alogrithm. My focus of my project is not on this part but it is needed for data transformation.
I tried using SignalProcessing Toolbox and codes downloaded. All of them are able to locate the peaks using different techniques. Beside the peak amp and locations, I need to know the width.
Can anyone guide me to use SignalProcessing Toolbox to determine the width. I tried using the downloaded codes but their approaches cannot fit all shapes of peaks from my data. From my data, there are shape peak and broaden peak. Hence, is anyone able to guide me on using SignalProcessing Toolbox to solve my problem or any alternative? Thank you
|
|
0
|
|
|
|
Reply
|
Wai
|
4/22/2010 5:38:05 AM
|
|
|
14 Replies
492 Views
(page loaded in 0.196 seconds)
Similiar Articles: Re: Find maxima in lists of data - comp.soft-sys.math.mathematica ...Locate Minima & Maxima - comp.soft-sys.matlab Re: Find maxima in lists of data - comp.soft-sys.math.mathematica ..... 09 at 6:23 AM, david.leipold@tu-ilmenau.de (David ... how to find out global maxima from histogram - comp.soft-sys ...Locate Minima & Maxima - comp.soft-sys.matlab how to find out global maxima from histogram - comp.soft-sys ... Can any one help me how to find out two peaks that ... maximize a function with two variables - comp.soft-sys.matlab ...Locate Minima & Maxima - comp.soft-sys.matlab... Grayscale Image'); set(gcf, 'Position', get(0,'Screensize')); % Maximize ... Maxima and Minima of Functions of Two ... optimization using lagrange multiplier method - comp.soft-sys ...Locate Minima & Maxima - comp.soft-sys.matlab optimization algorithm on lagrange multiplier method - comp.soft ..... tell how to do optimization using lagrange multiplier ... Removing a Drifting Baseline - comp.soft-sys.matlabI have the following plot: http://img842.imageshack.us/i/23665523.png/ and I need to firstly remove the drifting baseline and then find the maxima/minima. Find the position of max/min value in an unsorted array - comp ...Locate Minima & Maxima - comp.soft-sys.matlab You say you have the positions of the edges. Well the max or min is simply the value of your edge ... how to calculate area of a grayscale image? - comp.soft-sys.matlab ...Locate Minima & Maxima - comp.soft-sys.matlab I have to scan every row in the image to calculate the edge ... on the graph I plotted for row = 200 of a grayscale image ... Local Maxima of 2D array - comp.lang.idl-pvwaveRe: Find maxima in lists of data - comp.soft-sys ... find nth max - comp.soft-sys.matlab I ... Local minima in unsorted array, in matrix How to find local minimum in 2D ... fmincon vs lsqnonlin - comp.soft-sys.matlabA simple quadratic line, x^2+b*x+c, has two extreme values with the same sign, together with one minima or else one maxima (never both except in degenerate cases). find max in 3D array -- slow - comp.lang.idl-pvwave... over a number of subsets, then find the max of those maxima. You can tune the subset size/number to find a ... to read the data a slice at a time and do a running minima ... Sobel Edge Detection - comp.soft-sys.matlabIs it only 1 edge lies between a local maxima and minima? In my graph, 2 edges (E1 & E2) lie in between the same local maxima and minima.. is it possible? comp.soft-sys.matlab - page 118surface regression 2 9 (11/12/2003 2:52:17 PM) I have to find the best plane ... finding of local minima and maxima 0 4 (11/12/2003 6:07:22 PM) My problem is the following ... How to draw a vertical line at the peak of a graph - comp.soft-sys ...... end)) & (y(2:end-1)>y(1:end-2)); false];%lokalne minima ... find first peak and draw line > ind = find(a==1,1 ... y(15) = y(15)+.1; xloc = x(diff(y)<0); %maxima ... Maximum dimension array - comp.lang.fortranfind max in 3D array -- slow - comp.lang.idl-pvwave Hello IDL users, I have a 1200x1200x2900 array of floats. The dimensions correspond to ... the maximum value - comp ... Problems to calculate sin - comp.lang.java.programmerI do find it believeable that TurboPascal produces a more exact result, since ... It seems like there's still a tiny bit of ambiguity at the minima and maxima. Maxima and minima - Wikipedia, the free encyclopediaIn mathematics, the maximum and minimum (plural: maxima and minima) of a function, known collectively as extrema (singular: extremum), are the largest and smallest ... Visual Calculus - Maxima and Minima - Mathematics Archives WWW ServerObjectives: In this tutorial, we investigate what derivatives tell us about local maxima and local minima. We apply these results to finding maxima and minima of ... 7/15/2012 1:30:00 PM
|