Noise due to the sensor and the electronics of a camera is an undesirable issue in any machine vision application. Such noise tends to corrupt images and to obstruct any further analysis. An algorithm to detect and cancel such noise, using statistical methods, is presented in this paper. The proposed algorithm is an adaptive mean filter, which filters out image regions that are found to be noise corrupted. The efficiency of the proposed filter was examined both qualitatively and quantitatively, by software simulation in several noisy conditions. The main advantage of the filter in hand is that it is appropriate for hardware implementation and can be easily incorporated to smart cameras. The hardware implementation of the filter is also presented in this paper. This implementation aims at time critical applications such as machine vision, inspection and visual surveillance.