Adaptive Segmentation Using Wavelet Transform