opencv - Segment character of complicate background -
in optical character recognition (ocr), facing problem of segmenting characters on noisy/complicated background image. have tried 1 easiest image among 3 (as think) attached here. also, have tried contrast enhancement (histogram equalization) since images low contrast. however, segmented characters still have poor quality: connected character, unfilled regions , can not work other images due fixed thresholds.
scalar m = mean(src); ( y = 0; y < src.rows; y++ ) { ( x = 0; x < src.cols; x ++ ) { if ( filtered_image.at<uchar>(y,x) > 160 ) { filtered_image.at<uchar>(y, x) = (uchar) m(0); } } } gaussianblur(filtered_image, filtered_image, size(5, 5), 1, 1, 4); imshow("filtered", filtered_image); hardthresholding(filtered_image, filtered_image, 70); imshow("threshold", filtered_image);
- remove bright spots assigning image average value pixels greater threshold (ex: 180).
- gaussian blurring remove noise.
- hard thresholding respect fixed threshold value.
if can suggest ideas, if great.
you try mser (maximally stable extremal regions) blob detection. vlfeat open source library includes implementation of mser.
there entire scientific competition devoted text segmentation. turns out many of methods utilize mser part of processing pipeline.
Comments
Post a Comment