SlideShare a Scribd company logo
1 of 22
Download to read offline
Python Machine Learning
Chapter 07. Image and Deep Learning
7-4 OPENCV
7-5 IMAGE-OCR
7-4 OPENCV
OpenCV(Open Source Computer Vision Library)
는 오픈소스 이미지 처리 라이브러리입니다. 이미지
처리, 구조 분석, 패턴 인식, 머신러닝을 활용한 이미지
와 동영상 처리 등의 다양한 기능을 지원
OpenCV 설치
$pip3 install opencv-python
OpenCV Error: Assertion failed (!empty()) in detectMultiScale
이 에러문구가 뜬다면 얼굴 인식에 사용할 캐스케이드 파일의 경로를 재설정 해줘야합니다.
오류가 뜬다면 경로 재설정
detectMultiScale 매서드가
얼굴을 인식합니다.
소스코드
결과
모자이크 할 부분을 자릅니다
resize를 이용하여 자른 이미지를 축소시켜줍니다
다시 resize를 이용하여 축소시킨 이미지를
이전 크기로 확대합니다
interpolation으로 모자이크의 각을 어떻게 할 지 설정합니다
소스코드
결과
7-5 IMAGE-OCR
Optical character recognition; OCR은 광학 문자 인식이라고 하
며 이미지 스캔으로 얻을 수 있는 문서의 활자 영상을 컴퓨터가 편
집 가능한
문자코드 등의 형식으로 변환하는 소프트웨어
소스코드
결과
cv2.findContours() 함수는 이미지 속의 이미지를 검출하며, 계층 구조를 가진 윤곽도 추출 할 수 있습니다
소스코드
결과
가장 끝에 있는 윤곽만 표시합니다
소스코드
MNIST 모델을 저장
소스코드
minst.hdf5 파일을 불러옴
결과
소스코드
결과
소스코드
결과
결과로서 PNG 파일을 생성
소스코드
소스코드
폰트를 조금씩 확대하여
새로운 폰트 데이터를 만듭니다.
소스코드
앞에서 폰트들을 확대하고 회전시킨 이미지들로 모델을 저장합니다.
더 많은 이미지를 가지고 만든 모델을 사용하면
더 좋은 결과를 얻을 수 있습니다.
7-4 OPENCV
OPENCV은 범용적인 이미지 처리 라이브러리이며 얼굴 인식도 간단하게 할 수 있습니다.
NUMPY형식이므로 쉽게 값을 설정하거나 추출 할 수 있습니다.
7-5 IMAGE-OCR
OPENCV로 이미지 뿐만 아니라 문자 영역도 인식 할 수 있으며 학습시킬 데이터가 부족 할 때
적당한 폰트 이미지를 만들어 정밀도를 올릴 수 있습니다.
Thank You
-파이썬을 이용한 머신러닝, 딥러닝 실전 개발 입문(위키북스) 내용을 기반으로 정리했습니다
http://www.partprime.com

More Related Content

Similar to Image and deep learning 07-2

Summary in recent advances in deep learning for object detection
Summary in recent advances in deep learning for object detectionSummary in recent advances in deep learning for object detection
Summary in recent advances in deep learning for object detection창기 문
 
V8 add on with middleware modules
V8 add on with middleware modulesV8 add on with middleware modules
V8 add on with middleware modulesJay Kim
 
c++ opencv tutorial
c++ opencv tutorialc++ opencv tutorial
c++ opencv tutorialTaeKang Woo
 
영롱한 개발자로 거듭나기
영롱한 개발자로 거듭나기영롱한 개발자로 거듭나기
영롱한 개발자로 거듭나기은지 김
 
요즘 유행하는 AI 나도 해보자 (feat. CoreML)
요즘 유행하는 AI 나도 해보자 (feat. CoreML)요즘 유행하는 AI 나도 해보자 (feat. CoreML)
요즘 유행하는 AI 나도 해보자 (feat. CoreML)Chiwon Song
 
Amazon Rekognition을 이용하여 인공지능 안면 인식 키오스크 만들기 - 강정희 (AWS 솔루션즈 아키텍트)
Amazon Rekognition을 이용하여 인공지능 안면 인식 키오스크 만들기 - 강정희 (AWS 솔루션즈 아키텍트)Amazon Rekognition을 이용하여 인공지능 안면 인식 키오스크 만들기 - 강정희 (AWS 솔루션즈 아키텍트)
Amazon Rekognition을 이용하여 인공지능 안면 인식 키오스크 만들기 - 강정희 (AWS 솔루션즈 아키텍트)Amazon Web Services Korea
 
[2017 Incognito] Code Clone 기법을 통한 모바일 브라우저 취약점 분석
[2017 Incognito] Code Clone 기법을 통한 모바일 브라우저 취약점 분석[2017 Incognito] Code Clone 기법을 통한 모바일 브라우저 취약점 분석
[2017 Incognito] Code Clone 기법을 통한 모바일 브라우저 취약점 분석NAVER D2
 
[Korea Linux Forum] Implementing web based online multiplayer tetris with Ope...
[Korea Linux Forum] Implementing web based online multiplayer tetris with Ope...[Korea Linux Forum] Implementing web based online multiplayer tetris with Ope...
[Korea Linux Forum] Implementing web based online multiplayer tetris with Ope...JinKwon Lee
 
3D 모델러 ADDIN 개발과정 요약
3D 모델러 ADDIN 개발과정 요약3D 모델러 ADDIN 개발과정 요약
3D 모델러 ADDIN 개발과정 요약Tae wook kang
 
전형규, 가성비 좋은 렌더링 테크닉 10선, NDC2012
전형규, 가성비 좋은 렌더링 테크닉 10선, NDC2012전형규, 가성비 좋은 렌더링 테크닉 10선, NDC2012
전형규, 가성비 좋은 렌더링 테크닉 10선, NDC2012devCAT Studio, NEXON
 
Unionweb프로젝트
Unionweb프로젝트Unionweb프로젝트
Unionweb프로젝트Dong-Jin Park
 
[부스트캠프 Tech Talk] 배지연_Structure of Model and Task
[부스트캠프 Tech Talk] 배지연_Structure of Model and Task[부스트캠프 Tech Talk] 배지연_Structure of Model and Task
[부스트캠프 Tech Talk] 배지연_Structure of Model and TaskCONNECT FOUNDATION
 
수화 인식 자동 번역 iOS 앱 프로젝트 제안서
수화 인식 자동 번역 iOS 앱 프로젝트 제안서수화 인식 자동 번역 iOS 앱 프로젝트 제안서
수화 인식 자동 번역 iOS 앱 프로젝트 제안서Anna Kim
 
Calwmachine
CalwmachineCalwmachine
CalwmachineHYUN HO
 
스프링 코어 강의 1부 - 봄 맞이 준비 운동
스프링 코어 강의 1부 - 봄 맞이 준비 운동스프링 코어 강의 1부 - 봄 맞이 준비 운동
스프링 코어 강의 1부 - 봄 맞이 준비 운동Sungchul Park
 
[경북] I'mcloud openlight
[경북] I'mcloud openlight[경북] I'mcloud openlight
[경북] I'mcloud openlightstartupkorea
 
Development AR App with C++ and Windows Holographic API
Development AR App with C++ and Windows Holographic APIDevelopment AR App with C++ and Windows Holographic API
Development AR App with C++ and Windows Holographic APIYEONG-CHEON YOU
 

Similar to Image and deep learning 07-2 (18)

Summary in recent advances in deep learning for object detection
Summary in recent advances in deep learning for object detectionSummary in recent advances in deep learning for object detection
Summary in recent advances in deep learning for object detection
 
V8 add on with middleware modules
V8 add on with middleware modulesV8 add on with middleware modules
V8 add on with middleware modules
 
c++ opencv tutorial
c++ opencv tutorialc++ opencv tutorial
c++ opencv tutorial
 
영롱한 개발자로 거듭나기
영롱한 개발자로 거듭나기영롱한 개발자로 거듭나기
영롱한 개발자로 거듭나기
 
요즘 유행하는 AI 나도 해보자 (feat. CoreML)
요즘 유행하는 AI 나도 해보자 (feat. CoreML)요즘 유행하는 AI 나도 해보자 (feat. CoreML)
요즘 유행하는 AI 나도 해보자 (feat. CoreML)
 
Amazon Rekognition을 이용하여 인공지능 안면 인식 키오스크 만들기 - 강정희 (AWS 솔루션즈 아키텍트)
Amazon Rekognition을 이용하여 인공지능 안면 인식 키오스크 만들기 - 강정희 (AWS 솔루션즈 아키텍트)Amazon Rekognition을 이용하여 인공지능 안면 인식 키오스크 만들기 - 강정희 (AWS 솔루션즈 아키텍트)
Amazon Rekognition을 이용하여 인공지능 안면 인식 키오스크 만들기 - 강정희 (AWS 솔루션즈 아키텍트)
 
[2017 Incognito] Code Clone 기법을 통한 모바일 브라우저 취약점 분석
[2017 Incognito] Code Clone 기법을 통한 모바일 브라우저 취약점 분석[2017 Incognito] Code Clone 기법을 통한 모바일 브라우저 취약점 분석
[2017 Incognito] Code Clone 기법을 통한 모바일 브라우저 취약점 분석
 
[Korea Linux Forum] Implementing web based online multiplayer tetris with Ope...
[Korea Linux Forum] Implementing web based online multiplayer tetris with Ope...[Korea Linux Forum] Implementing web based online multiplayer tetris with Ope...
[Korea Linux Forum] Implementing web based online multiplayer tetris with Ope...
 
3D 모델러 ADDIN 개발과정 요약
3D 모델러 ADDIN 개발과정 요약3D 모델러 ADDIN 개발과정 요약
3D 모델러 ADDIN 개발과정 요약
 
전형규, 가성비 좋은 렌더링 테크닉 10선, NDC2012
전형규, 가성비 좋은 렌더링 테크닉 10선, NDC2012전형규, 가성비 좋은 렌더링 테크닉 10선, NDC2012
전형규, 가성비 좋은 렌더링 테크닉 10선, NDC2012
 
Unionweb프로젝트
Unionweb프로젝트Unionweb프로젝트
Unionweb프로젝트
 
[부스트캠프 Tech Talk] 배지연_Structure of Model and Task
[부스트캠프 Tech Talk] 배지연_Structure of Model and Task[부스트캠프 Tech Talk] 배지연_Structure of Model and Task
[부스트캠프 Tech Talk] 배지연_Structure of Model and Task
 
Visualaid
VisualaidVisualaid
Visualaid
 
수화 인식 자동 번역 iOS 앱 프로젝트 제안서
수화 인식 자동 번역 iOS 앱 프로젝트 제안서수화 인식 자동 번역 iOS 앱 프로젝트 제안서
수화 인식 자동 번역 iOS 앱 프로젝트 제안서
 
Calwmachine
CalwmachineCalwmachine
Calwmachine
 
스프링 코어 강의 1부 - 봄 맞이 준비 운동
스프링 코어 강의 1부 - 봄 맞이 준비 운동스프링 코어 강의 1부 - 봄 맞이 준비 운동
스프링 코어 강의 1부 - 봄 맞이 준비 운동
 
[경북] I'mcloud openlight
[경북] I'mcloud openlight[경북] I'mcloud openlight
[경북] I'mcloud openlight
 
Development AR App with C++ and Windows Holographic API
Development AR App with C++ and Windows Holographic APIDevelopment AR App with C++ and Windows Holographic API
Development AR App with C++ and Windows Holographic API
 

More from PartPrime

Deep learningwithkeras ch3_1
Deep learningwithkeras ch3_1Deep learningwithkeras ch3_1
Deep learningwithkeras ch3_1PartPrime
 
Python machine learning_chap07_1
Python machine learning_chap07_1Python machine learning_chap07_1
Python machine learning_chap07_1PartPrime
 
Python machine learning_chap06_1
Python machine learning_chap06_1Python machine learning_chap06_1
Python machine learning_chap06_1PartPrime
 
what is deep learning?
what is deep learning? what is deep learning?
what is deep learning? PartPrime
 
Deep Learning with Python 2-1
Deep Learning with Python 2-1Deep Learning with Python 2-1
Deep Learning with Python 2-1PartPrime
 
Python machine learning_chap05_8
Python machine learning_chap05_8Python machine learning_chap05_8
Python machine learning_chap05_8PartPrime
 
Python machine learning_chap05_7
Python machine learning_chap05_7Python machine learning_chap05_7
Python machine learning_chap05_7PartPrime
 
Ch.5 Deep Learning
Ch.5 Deep LearningCh.5 Deep Learning
Ch.5 Deep LearningPartPrime
 
Python machine learning_chap04_2
Python machine learning_chap04_2 Python machine learning_chap04_2
Python machine learning_chap04_2 PartPrime
 
Python machine learning_chap02
Python machine learning_chap02Python machine learning_chap02
Python machine learning_chap02PartPrime
 
Ch.3 데이터 소스의 서식과 가공
Ch.3 데이터 소스의 서식과 가공Ch.3 데이터 소스의 서식과 가공
Ch.3 데이터 소스의 서식과 가공PartPrime
 
Python machine learning Ch.4
Python machine learning Ch.4Python machine learning Ch.4
Python machine learning Ch.4PartPrime
 

More from PartPrime (12)

Deep learningwithkeras ch3_1
Deep learningwithkeras ch3_1Deep learningwithkeras ch3_1
Deep learningwithkeras ch3_1
 
Python machine learning_chap07_1
Python machine learning_chap07_1Python machine learning_chap07_1
Python machine learning_chap07_1
 
Python machine learning_chap06_1
Python machine learning_chap06_1Python machine learning_chap06_1
Python machine learning_chap06_1
 
what is deep learning?
what is deep learning? what is deep learning?
what is deep learning?
 
Deep Learning with Python 2-1
Deep Learning with Python 2-1Deep Learning with Python 2-1
Deep Learning with Python 2-1
 
Python machine learning_chap05_8
Python machine learning_chap05_8Python machine learning_chap05_8
Python machine learning_chap05_8
 
Python machine learning_chap05_7
Python machine learning_chap05_7Python machine learning_chap05_7
Python machine learning_chap05_7
 
Ch.5 Deep Learning
Ch.5 Deep LearningCh.5 Deep Learning
Ch.5 Deep Learning
 
Python machine learning_chap04_2
Python machine learning_chap04_2 Python machine learning_chap04_2
Python machine learning_chap04_2
 
Python machine learning_chap02
Python machine learning_chap02Python machine learning_chap02
Python machine learning_chap02
 
Ch.3 데이터 소스의 서식과 가공
Ch.3 데이터 소스의 서식과 가공Ch.3 데이터 소스의 서식과 가공
Ch.3 데이터 소스의 서식과 가공
 
Python machine learning Ch.4
Python machine learning Ch.4Python machine learning Ch.4
Python machine learning Ch.4
 

Image and deep learning 07-2