The present invention discloses an OCR training sample generation method, device and
system, which relates to the field of
computer vision. The method includes: a text contour extraction step, where all text contours are extracted based on the original image, an erasure area
mask is determined by combining the erasure area coordinates, and a repaired area
mask is obtained; an image repair and filling step, where image repair and filling are performed according to the repaired area
mask and the pixel information around the repaired area to obtain a background template after the erased text; a
random text generation step, where
random text is generated in each generation area, thereby obtaining a new sample picture and a corresponding
annotation information file. The present invention combines technologies such as text contour extraction algorithms and image repair, makes full use of the
background information of the original picture, generates high-quality training pictures, and at the same time generates an
annotation file corresponding to the picture (including text content and position information), eliminating the cumbersome and laborious
annotation work and can be directly used for OCR model training.