Extracting set of data around local maxima/minima

조회 수: 7 (최근 30일)
Konstantinos Belivanis
Konstantinos Belivanis 2015년 5월 2일
답변: Konstantinos Belivanis 2015년 5월 6일
Hello all,
as the title says I would like to extract sets of data around local maxima/minima. Depending on the results I'll get I might need more than two.
To explain a bit further I have two column vectors (A, B) corresponding to the x and y axis of the picture attached. So I would like to locate the minimum and extract the area of +/- 30 points around it in other column vectors (say A1, B1), and the continue for the remaining data for the next minimum and so on (A2, B2) and (A3, B3)....
I hope I was clear.
Thank you in advance!

답변 (2개)

Image Analyst
Image Analyst 2015년 5월 2일
Try using imregionalmin() or imregionalmax(). Then expand outwards with imdilate(). Then use the PixelValues option of regionprops to extract the values from the gray level image for each blob. Basically
binaryImage = imregionalmax(grayImage);
binaryImage = imdilate(binaryImage, true(30));
labeledImage = bwlabel(binaryImage);
measurements = regiopnprops(labeledImage, 'PixelValues');
or something pretty close to that. Good luck.

Konstantinos Belivanis
Konstantinos Belivanis 2015년 5월 6일
Thanks a lot for the answer. This will not get the next local minimum/maximum. As a result how can I ensure I can get multiple minima?
Regards

카테고리

Help CenterFile Exchange에서 Signal Operations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by