Top Banner
Python Machine Learning Chapter 07. Image and Deep Learning
22

Image and deep learning 07-2

Jan 21, 2018

Download

Software

PartPrime
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Image and deep learning 07-2

Python�Machine�Learning��Chapter�07.��Image�and�Deep�Learning�

Page 2: Image and deep learning 07-2

7-4�OPENCV

7-5�IMAGE-OCR

Page 3: Image and deep learning 07-2

7-4�OPENCV

Page 4: Image and deep learning 07-2

OpenCV(Open�Source�Computer�Vision�Library)는�오픈소스�이미지�처리�라이브러리입니다.�이미지�처리,�구조�분석,�패턴�인식,�머신러닝을�활용한�이미지

와�동영상�처리�등의�다양한�기능을�지원

Page 5: Image and deep learning 07-2

OpenCV�설치

$pip3�install�opencv-python

Page 6: Image and deep learning 07-2

OpenCV�Error:�Assertion�failed�(!empty())�in�detectMultiScale

이�에러문구가�뜬다면�얼굴�인식에�사용할�캐스케이드�파일의�경로를�재설정�해줘야합니다.

Page 7: Image and deep learning 07-2

오류가�뜬다면�경로�재설정

detectMultiScale�매서드가��얼굴을�인식합니다.

소스코드

Page 8: Image and deep learning 07-2

결과

Page 9: Image and deep learning 07-2

모자이크�할�부분을�자릅니다

resize를�이용하여�자른�이미지를�축소시켜줍니다

다시�resize를�이용하여�축소시킨�이미지를��이전�크기로�확대합니다

interpolation으로�모자이크의�각을�어떻게�할�지�설정합니다

소스코드

Page 10: Image and deep learning 07-2

결과

Page 11: Image and deep learning 07-2

7-5�IMAGE-OCR

Page 12: Image and deep learning 07-2

Optical�character�recognition;�OCR은�광학�문자�인식이라고�하며�이미지�스캔으로�얻을�수�있는�문서의�활자�영상을�컴퓨터가�편

집�가능한�문자코드�등의�형식으로�변환하는�소프트웨어

Page 13: Image and deep learning 07-2

소스코드

결과

cv2.findContours()�함수는�이미지�속의�이미지를�검출하며,�계층�구조를�가진�윤곽도�추출�할�수�있습니다

Page 14: Image and deep learning 07-2

소스코드

결과

가장�끝에�있는�윤곽만�표시합니다

Page 15: Image and deep learning 07-2

소스코드

MNIST�모델을�저장

Page 16: Image and deep learning 07-2

소스코드

minst.hdf5�파일을�불러옴

결과

Page 17: Image and deep learning 07-2

소스코드

결과

Page 18: Image and deep learning 07-2

소스코드

결과

결과로서�PNG�파일을�생성

Page 19: Image and deep learning 07-2

소스코드

소스코드

폰트를�조금씩�확대하여�새로운�폰트�데이터를�만듭니다.

Page 20: Image and deep learning 07-2

소스코드

앞에서�폰트들을�확대하고�회전시킨�이미지들로�모델을�저장합니다.

더�많은�이미지를�가지고�만든�모델을�사용하면�더�좋은�결과를�얻을�수�있습니다.

Page 21: Image and deep learning 07-2

7-4�OPENCV�

OPENCV은�범용적인�이미지�처리�라이브러리이며�얼굴�인식도�간단하게�할�수�있습니다.�NUMPY형식이므로�쉽게�값을�설정하거나�추출�할�수�있습니다.�

7-5�IMAGE-OCR�

OPENCV로�이미지�뿐만�아니라�문자�영역도�인식�할�수�있으며�학습시킬�데이터가�부족�할�때�적당한�폰트�이미지를�만들어�정밀도를�올릴�수�있습니다.

Page 22: Image and deep learning 07-2

Thank�You

-파이썬을�이용한�머신러닝,�딥러닝�실전�개발�입문(위키북스)�내용을�기반으로�정리했습니다�

http://www.partprime.com��