1. A method for image processing, comprising: obtaining a mask of an image; identifying, in the mask, a first stroke segment and a second stroke segment for possible merging, wherein the first stroke segment and the second stroke segment do not overlap; calculating a plurality of merger eligibility scores for the first stroke segment and the second stroke segment; calculating an aggregate merger eligibility score for the first stroke segment and the second stroke segment based on the plurality of merger eligibility scores; and merging the first stroke segment and the second stroke segment based on the aggregate merger eligibility score.