This paper proposes a novel kernel-based and technique to segment pedestrians from a single image. An important concept introduced in this paper is "detection before segmentation" for extracting pedestrians' boundaries more precisely no matter what cameras (mobile, PTZ, or stationary) are used or how does the background include various lighting changes. First of all, the Adaboost-based detector is trained for detecting all possible pedestrians from still images. Then, we adopt the Watershed algorithm to over-segment each frame as a rough segmentation. Since two homogenous regions will still connect together, a triangulation-based scheme is then used to divide them into different tinier regions using their edge features. Then, we propose a novel kernel density analysis to estimate the probability of each tinier region to be foreground or background. With the kernel modeling, an optimal segmentation of pedestrian can be found by maximizing a posteriori probability for maintaining the visual and spatial consistencies between each segmented regions. Then, each desired pedestrian can be more accurately extracted for content analysis even though it is occluded with other objects or captured by a mobile camera. Experimental results have shown the effectiveness and superiority of the proposed method in pedestrian segmentation.