IT 관련/파이썬

파이썬 image 내용 추출

과정에서 오는 행복 2022. 5. 20. 14:15

[사전설치]
>>> pip install easyocr

[코드]
import easyocr
reader = easyocr.Reader(['ko','en']) # this needs to run only once to load the model into memory
result = reader.readtext('check_naver.png')
print(result)


[대상]



[결과]
[([[31, 17], [127, 17], [127, 33], [31, 33]], 'NAVER whale', 0.9479118924565291), ([[456, 14], [821, 14], [821, 38], [456, 38]], '미간 펴고 사용하세요 인상 쓰지 말고 다크 모드', 0.6302304586055005), ([[875, 17], [915, 17], [915, 33], [875, 33]], '다운로-다', 0.11898824033778989), ([[83, 107], [247, 107], [247, 149], [83, 149]], 'NAVER', 0.9998415309117982), ([[56, 224], [92, 224], [92, 248], [56, 248]], '메일', 0.9493428196544995), ([[99, 227], [133, 227], [133, 245], [99, 245]], '카페', 0.9996641061425527), ([[141, 225], [189, 225], [189, 245], [141, 245]], '불로그', 0.9700104816362497), ([[196, 224], [348, 224], [348, 248], [196, 248]], '지식iN 쇼핑 쇼핑LE', 0.10418574181419672), ([[356, 224], [552, 224], [552, 248], [356, 248]], 'Pay DTV 사전 뉴스 증권', 0.5672269985205342), ([[559, 223], [610, 223], [610, 249], [559, 249]], '부동산', 0.9998009592634782), ([[617, 225], [649, 225], [649, 245], [617, 245]], '지도', 0.9999268338549803), ([[659, 229], [695, 229], [695, 245], [659, 245]], 'VIBE', 0.9999371767044067), ([[726, 224], [762, 224], [762, 248], [726, 248]], '웬문', 0.1091426948555449), ([[777, 229], [819, 229], [819, 243], [777, 243]], '드보기', 0.4397263547276861), ([[831, 299], [915, 299], [915, 317], [831, 317]], '네이터클 더 안', 0.26659279938552427), ([[847, 389], [885, 389], [885, 405], [847, 405]], '아이디', 0.7729873473128829), ([[45, 443], [99, 443], [99, 463], [45, 463]], '연합뉴스', 0.9975907206535339), ([[115, 443], [419, 443], [419, 463], [115, 463]], '타이든 오늘 방한 너일 주대통결고- 첫 한디정상회담', 0.2021913087653365), ([[565, 445], [607, 445], [607, 463], [565, 463]], '뉴스롬', 0.1629790560822697), ([[623, 447], [651, 447], [651, 463], [623, 463]], '연예', 0.999706164817854), ([[659, 445], [699, 445], [699, 461], [659, 461]], '스포츠', 0.9996076360508247), ([[705, 445], [763, 445], [763, 463], [705, 463]], '지방선거', 0.9997044205665588), ([[873, 447], [913, 447], [913, 461], [873, 461]], '코르다', 0.6002556449188761), ([[57, 499], [129, 499], [129, 519], [57, 519]], '뉴스스템드', 0.3169560808731001), ([[147, 499], [241, 499], [241, 519], [147, 519]], '구득하 언론사', 0.3653543459114611), ([[257, 499], [331, 499], [331, 519], [257, 519]], '전체언론사', 0.931070286995795), ([[57, 561], [133, 561], [133, 575], [57, 575]], 'MTO 더니두데어', 0.6602741839646173), ([[199, 561], [239, 561], [239, 577], [199, 577]], 'MBN', 0.9654555035064065), ([[309, 563], [373, 563], [373, 577], [309, 577]], 'ChosunlBiz', 0.8194163716988931), ([[441, 563], [513, 563], [513, 575], [441, 575]], 'Ulit

반응형