Detecting gait events is the key to many gait analysis applications which would immensely benefit if the analysis could be carried out using wearable sensors in uncontrolled outdoor environments, enabling continuous monitoring and long-term analysis. This would allow exploring new frontiers in gait analysis by facilitating the availability of more data and empower individuals, especially patients, to avail the benefits of gait analysis in their everyday lives. Previous gait event detection algorithms impose many restrictions as they have been developed from data collected incontrolled, indoor environments. This paper proposes a robust algorithm that utilizes a priori knowledge of gait in conjunction with continuous wavelet transform analysis, to accurately identify heel strike and toe off, from noisy accelerometer signals collected during indoor and outdoor walking. The accuracy of the algorithm is evaluated by using footswitches that are considered as ground truth and the results are compared with another recently published algorithm.