Detecting the presence/absence of an object in a region of interest is one of the important applications for sensor networks. A considerable amount of work has been seen in the literature for detecting events or objects using wireless sensor networks. Most of the prior work uses a simple binary detection model or an average signal strength model to make decisions of detection. Such methods are not optimal in terms of detection probability. This paper derives a detection approach which is optimal in the sense of Neyman-Pearson test and shows that the detection performance of the traditional average based method is much lower than the optimal. To reduce power consumption and communication cost, a localized fusion method is also developed by carefully selecting sensors in the vicinity of a target location. The paper shows that the localized fusion can dramatically reduce the number of sensors participating the fusion while maintain high detection performance.