Reputation: 777
I was wondering what is the best way to find all the peaks and valleys in a 2D grey level Mat ?
I found only opencv functions which find local extremum in a Mat but not all the peaks and valleys.
So I try to find out my own algorithm, but I hope there is a way (already existing or improving this one) to make it faster
My idea would be :
In order to find all the peaks:
Then redo the same thing for valley starting from 0 up to 255.
So, what do you think about it ?
I guess there is a faster way to do it ?
Thanks
PS: I did that in order to try detect stem cells colonies in images like that:
Because I thought that there will be more peaks and valleys inside the stem cells colony (the big thing in the middle). But I am afraid this is not a very good way since I seem to have as many peaks inside the cells colony than outside...
Upvotes: 1
Views: 4436
Reputation: 4453
Upvotes: 3
Reputation: 6080
One idea would be:
otherwise you would find nearly every Pixel as a peak.
Upvotes: -1