How to calculate local maximum point from a derivative of a function?
5 ビュー (過去 30 日間)
古いコメントを表示
Hi. I am working with border irregularity of lesion. So I have determined the derivative of the border irregularity function to get the local maximums.We know the local maximum is detected when the derivative of the function crosses the zero point and the slope changes sign from + to −. I want to divide the curve in 8 region and count the abrupt cut off in every region so that I can have the final decision.
I found out upto this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/314042/image.bmp)
And what I wanted is to point out the local maximums like this and count the abrupt cut off in each region:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/313169/image.png)
0 件のコメント
採用された回答
darova
2020 年 6 月 12 日
TRY THIS SIMPLE EXAMPLE
x = 1:50;
y = sin(x);
[xc,yc] = polyxpoly(x,y,[0 50],[0 0]);
plot(x,y)
hold on
for i = 1:3
ix = 15*(i-1) < xc & xc < 15*i;
plot(xc(ix),yc(ix),'*','color',rand(1,3))
end
hold off
14 件のコメント
その他の回答 (1 件)
Image Analyst
2020 年 7 月 7 日
Why not simply call imregionalmax()?
You can smooth the data with a sliding quadratic if you want to before that with sgolayfilt().
3 件のコメント
Image Analyst
2020 年 7 月 7 日
You wanted the zero crossings of the derivative, because you want to know where the maxima (peaks) are, and the derivative is zero when the signal is at a max and the slope is zero. But if you simply use imregionalmax() you don't need to even deal with the derivative at all. It's much simpler and more direct.
参考
カテゴリ
Help Center および File Exchange で Image Segmentation and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!