1. A method for handwriting recognition, comprising: detecting connected regions in an input image comprising handwritten characters; determining a plurality of segmentation positions of the input image; obtaining multiple alternative paths of the input image, each path containing one or more segments, each path covering all of the connected regions of the input image, the multiple alternative paths being different from each other; for each path: obtaining a plurality of recognition results for the segments of the path, wherein each recognition result represents a character candidate for a corresponding segment; obtaining a plurality of scores corresponding to the recognition results of the segments; and calculating a path score for the path based on segment lengths and the scores corresponding to the recognition results of the segments using the following equation: S path =a*(S 11 *Len 1 +S 12 *Len 2 +. .. +S 1m *Len m )+b*min(S 11 , S 12 ,. .. S 1m ), wherein Len 1 , Len 2. .. Len m represent respective segment lengths for Seg 1 , Seg 2 ,. .. , Seg m of the path, (S 11 , S 12 ,. .. , S 1m ) represent scores corresponding to recognition results (R 11 , R 12 ,. .. R 1m ) of a decoding path, min means the minimization function, and a and b are pre-defined constants; and identifying the path with the highest path score and using that path to interpret the handwritten characters in the input image.