Avatar ·

Finding positive peaks of function

📁 python, ии, работа

It is necessary to programatically find the number and location of positive peaks on the graph.
It is known that the number of peaks is odd. Typically, 3, 5 or 7. In this case, 3. It is also known that each positive peak follows negative.
How best to solve such a problem on Python? It is advisable without the selection of the
coefficients : the data always begins with a positive peak and end in negative.
Data is a vertical projection of the image treated with the function of np.gradient (projection)/projection . That is, the ratio of the second derivative of the function to its height.