Оптическое распознавание символов - Дипломная работа

бесплатно 0
4.5 64
Процессы распознавания символов. Шаблонные и структурные алгоритмы распознавания. Процесс обработки поступающего документа. Обзор существующих приложений по оптическому распознаванию символов. Определение фиксированного шага и сегментация слов.

Скачать работу Скачать уникальную работу

Чтобы скачать работу, Вы должны пройти проверку:


Аннотация к работе
Одной из актуальных проблем на данный момент является неэффективная работа различных государственных организаций, таких как «Пенсионный Фонд», городские поликлиники, различные организации бухгалтерского учета, поскольку все делается в ручном режиме. Автоматизация процесса перевода информации с бумажных документов в электронный вид сейчас актуальна практически во всех государственных и коммерческих организациях. Над преобразованным в электронный вид при помощи оптического распознавания текстом можно совершать множественные манипуляции: редактировать, осуществлять поиск слова или фразы, хранить его в более компактной форме, демонстрировать или распечатывать материал, не теряя качества, анализировать информацию, а также применять к тексту электронный перевод =0 # do rotation if needed if rot: img = cv2.transpose(img) img = cv2.flip(img, 0) img = cleanbg.clean_bg((img, coeff, True)) if shrinkboxfactor =0) shrinkpixels = int(img.shape[0] * shrinkboxfactor) if shrinkpixels > 0: img = img[:, shrinkpixels:-shrinkpixels, :] # wash the box which is to be ignored if l1 != 0 or t1 != 0 or r1 != 0 or b1 != 0: for rr in range(t1, b1): for pp in range(l1, r1): img[rr][pp] = [255, 255, 255] result = do_recognize(img, dbg str(coeff) if dbg != else ) result = postactions.do_post_actions(result, post) if dbg != : print result return result # noinspection PyArgumentList def recognize_wrapper(args): wrapper function to be passed to the process pool return recognize(*args) def do_box(img, (l, t, r, b), rot, (l1, t1, r1, b1), post=None, agressive=0, dbg=, expandboxfactor=0): Does recognition for image within given box if dbg != : print _do_box (l:%u t:%u r:%u b:%u rot:%u) % (l, t, r, b, rot) if rot != 0: # dont expand rotated images expandboxfactor = 0 if expandboxfactor != 0: l -= int(expandboxfactor * (b-t)) r = int(expandboxfactor * (b-t)) # crop the box img = img[t:b, l:r] if agressive: def frange(x, y, jump): while x hist_max_ix[channel] - thres[channel]: img[row][col][channel] = 255 # bitwise remaining colors if img[row][col][0] != 255 or img[row][col][1] != 255 or img[row][col][2] != 255: img[row][col] = [0, 0, 0] def clean_bg_v2(img, coeff): # the algorithm breaks colors on the box on three areas: # - upper area, which is to be cleaned up, this must be bg # - middle area, area of interest which colors constructs characters # - lowers area, area with colors below characters colors, nothing must be here in the begging # upper and lower areas are to be cleaned up and middle area is to be stretched from 0 up to 225 # upper cutting threshold is fixed for the whole picture # lower threeshold is floating from pixel to pixel # # the idea is that character pixels with overlights from watermarks should be scaled down to # more lower value than usual pixels img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) rows, cols = img.shape # statistics for overall box avr = np.average(img) std = np.std(img) median = np.median(img) # print average: , avr # print median: , median # print std: , std # statistics for character colors # colors below 110 are considered related to the characters # TODO: to try calculate 110 dynamically blacks = [] for row in range(0, rows): for col in range(0, cols): if img[row][col] 110: bg.append(img[row][col]) # bg_avr = np.average(bg) # bg_median = np.median(bg) # bg_std = np.std(bg) # print bg average: , bg_avr # print bg median: , bg_median # print bg std: , bg_std # comparing meadian values for the whole box and for the characters only # we can try to assume if the box contains watermarks.

Вы можете ЗАГРУЗИТЬ и ПОВЫСИТЬ уникальность
своей работы


Новые загруженные работы

Дисциплины научных работ





Хотите, перезвоним вам?