In this paper, we proposed a novel corner detection algorithm, based on statistical properties of corners, to detect corners of both polygonal and polyhedral objects. By means of local histogram analysis, we first bilevel the subimage within a circular window, then compute the intensity mean for the bileveled subimage. From the intensity mean we can estimate the corner angle. We then calculate the theoretical position variance from the estimated angle. Comparing the position variance from the bileveled subimage with its theoretical value, we can identify whether or not the pixel at the center of the subimage is a corner. Finally, the corner orientation can be obtained from the position mean. Our algorithm can detect corners of both polygons and polyhedra, even if they appear in an image at the same time. It is superior to conventional detection algorithms that it can detect corners over a large range of angles.