Abstract Thinning is a process by which a binary pattern is transformed into another binary pattern consisting of its skeleton in order to reduce and extract information for further transmission or recognition. It is very important to preserve the shape of the original unthinned pattern in order to keep the necessary information for further processing. However, since thinning algorithms can only consider local information, a skeletonizing transformation generally results in distorted representation of the original unthinned characters, and usually affects the possibility of correct recognition. In the paper, a new technique called ‘dynamical threshold’ is designed to extract the correct features of original patterns. Hence, a more accurate stroke segmentation, having the same effectiveness as human vision, can be achieved to tell how the lines (strokes) overlap (pass through) each other. It provides a method to segment complex stroke structures into strokes from which the structures are composed.