I have the following function obtained from averaging 2d camera image over one axis, where detection of aligned objects is desired:
I need to detect (roughly speaking) locations and widths of the troughs -- sometimes and object will be missing, thus the trough will be much wider. The approach should have some resilience WRT possible lighting variations and other noise; this, and also a desire to use something new and useful) prevents me from going the naive way of thresholding and clustering or something similar.
I was looking at using wavelets: using ideal trough (Haar?) as the mother wavelet function, and the analysis would give its translation and scale at troughs in the signal.
I have no prior experience with wavelets. My background is numerics (variational analysis/FEM, particle systems programming), c++ and python, but I am quite new to signal processing (and its terminology).
What would be the most suitable thing to do? Suggestions, pointers to articles, books, or, best, code examples are much appreciated.
EDIT:
I finally used continuous wavelet transform (as implemented in scipy) where the result local maxima (in yellow) show both location (x-axis) and width (y-axis) of the trough.
import numpy as np
from scipy import signal
# scale the ricker (mexican hat) function to 10-60px width
widths=np.arange(10,60,.2)
cwtout=signal.cwt(vscan,signal.ricker,widths)
plt.imshow(cwtout,extent=[0,len(vscan),60,10],aspect='auto',vmax=abs(cwtout).max(),vmin=abs(cwtout).min())