Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Vision Framework 入門
Search
Motoki Narita
August 09, 2017
Technology
2
1.7k
Vision Framework 入門
potatotips #42
https://potatotips.connpass.com/event/60015/
※公開されている情報を元に構成されています
Motoki Narita
August 09, 2017
Tweet
Share
More Decks by Motoki Narita
See All by Motoki Narita
Mercari 10years iOS Development
motokiee
5
3.5k
Alexa, Swiftで スマートスピーカーは実装できる?
motokiee
0
1.5k
iOSの自動化と仕組み化 ~コードと設計に集中する~
motokiee
11
2.9k
入力を型で表現する
motokiee
2
3.8k
Move Fast iOS Development
motokiee
4
3.7k
結婚式を支えた技術 Firebaseを活用したサーバレスiOSアプリケーション開発
motokiee
33
25k
Lightweight Dependency Injection tips
motokiee
10
2.8k
Hello React Native
motokiee
8
590
RxSwift in Practice
motokiee
11
5.6k
Other Decks in Technology
See All in Technology
2024-10-30-reInventStandby_StudyGroup_Intro
shinichirokawano
1
630
Product Engineer Night #6プロダクトエンジニアを育む仕組み・施策
hacomono
PRO
1
470
独自ツール開発でスタジオ撮影をDX!「VLS(Virtual LED Studio)」 / dx-studio-vls
cyberagentdevelopers
PRO
1
180
生成AIとAWS CDKで実現! 自社ブログレビューの効率化
ymae
2
330
プロダクト成長に対応するプラットフォーム戦略:Authleteによる共通認証基盤の移行事例 / Building an authentication platform using Authlete and AWS
kakehashi
1
150
チームを主語にしてみる / Making "Team" the Subject
ar_tama
4
310
新R25、乃木坂46 Mobileなどのファンビジネスを支えるマルチテナンシーなプラットフォームの全体像 / cam-multi-cloud
cyberagentdevelopers
PRO
1
130
10分でわかるfreeeのQA
freee
1
3.4k
visionOSでの空間表現実装とImmersive Video表示について / ai-immersive-visionos
cyberagentdevelopers
PRO
1
110
30万人が利用するチャットをFirebase Realtime DatabaseからActionCableへ移行する方法
ryosk7
5
350
MAMを軸とした動画ハンドリングにおけるAI活用前提の整備と次世代ビジョン / abema-ai-mam
cyberagentdevelopers
PRO
1
110
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
27
12k
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
32
2.4k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
22k
Adopting Sorbet at Scale
ufuk
73
9k
Bash Introduction
62gerente
608
210k
Six Lessons from altMBA
skipperchong
26
3.5k
Building an army of robots
kneath
302
42k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Become a Pro
speakerdeck
PRO
24
5k
The Cost Of JavaScript in 2023
addyosmani
45
6.6k
GitHub's CSS Performance
jonrohan
1030
460k
Transcript
7JTJPO'SBNFXPSLೖ !NPUPLJFF QPUBUPUJQT
ࣗݾհ w HJUIVC UXJUUFS!NPUPLJFF w ϝϧΧϦικJ04ΤϯδχΞ w ϝϧΧϦΧϧνʔϜ w J04%$+BQBOελοϑ
7JTJPO'SBNFXPSLͱ
$PSF.-ͱ7JTJPOͷҧ͍ʁ
ΞϓϦέʔγϣϯ 7JTJPO /-1 $PSF.- "DDFMFSBUF .14 IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXEDΛࢀߟʹ࡞
ΞϓϦέʔγϣϯ 7JTJPO /-1 /BUVSBM-BOHVBHF1SPDFTTJOH $PSF.- "DDFMFSBUF .14 %PNBJO4QFDJpD ಛఆͷλεΫʹಛԽͨ͠ը૾ղੳͷͨΊͷϑϨʔϜϫʔΫ
ΞϓϦέʔγϣϯ 7JTJPO /-1 /BUVSBM-BOHVBHF1SPDFTTJOH $PSF.- "DDFMFSBUF .14 7JTJPOը૾ղੳʹಛԽ͍ͯ͠Δ %PNBJO4QFDJpD
ΞϓϦέʔγϣϯ 7JTJPO /-1 /BUVSBM-BOHVBHF1SPDFTTJOH $PSF.- "DDFMFSBUF .14 %PNBJO4QFDJpD 7JTJPO$PSF.-͕ϕʔεʹͳ͍ͬͯΔ
ΞϓϦέʔγϣϯ 7JTJPO /-1 /BUVSBM-BOHVBHF1SPDFTTJOH $PSF.- "DDFMFSBUF .14 %PNBJO4QFDJpD ྡΓʹ͋Δ/-1'PVOEBUJPOʹΈࠐ·Ε͍ͯͯɺ /4-JOHVJTUJD5BHHFSͳͲͰΘΕ͍ͯΔͱͷ͜ͱ
ࠓճΓ͔ͨͬͨͷɺ 7JTJPOͰόʔίʔυΛݕग़͢Δ͜ͱ
Barcode Detection IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXEDΑΓ
w 7JTJPOΛͬͯόʔίʔυͷݕग़Λ͍ͨ͠ w ͔݁Βݴ͏ͱ7JTJPO .-&YBNQMFͱ͍͏88%$ ͷηογϣϯͰΘΕ͍ͯͨαϯϓϧΛݩʹػց ֶशͷ͕ࣝͳͯ͘͢ΜͳΓ7JTJPOಈ͔͢͜ͱ ͕Ͱ͖ͨ w ͨͩ͠ͱ͍͏Λ͢Δ
࣮ํ๏
IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXEDΑΓ Analyzing an Image The Machinery The Results The Asks
IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXEDΑΓ Analyzing an Image The Machinery The Results The Asks
Requests VNDetectBarcodesRequest VNDetectFaceLandmarksRequest VNDetectFaceRectanglesRequest … Observations VNClassificationObservation VNDetectedObjectObservation VNFaceObservation … RequestHandler VNImageRequestHandler
w ը૾͔ΒόʔίʔυΛݕग़ w 7/%FUFDU#BSDPEFT3FRVFTUΛͬͯɺը૾͔Β όʔίʔυΛಡΈऔΔ
Analyzing an Image The Machinery The Results The Asks Requests
VNDetectBarcodesRequest VNDetectFaceLandmarksRequest VNDetectFaceRectanglesRequest … Observations VNClassificationObservation VNDetectedObjectObservation VNFaceObservation … RequestHandler VNImageRequestHandler IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXEDΑΓ
let handler = VNImageRequestHandler(ciImage: ciImage, orientation: orientation) try! handler.perform([barcodeClassificationRequest])
w ը૾͔Βόʔίʔυͷ*4#/ίʔυΛऔΓग़͢
Analyzing an Image The Machinery The Results The Asks Requests
VNDetectBarcodesRequest VNDetectFaceLandmarksRequest VNDetectFaceRectanglesRequest … Observations VNClassificationObservation VNDetectedObjectObservation VNFaceObservation … RequestHandler VNImageRequestHandler IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXEDΑΓ
lazy var barcodeClassificationRequest: VNDetectBarcodesRequest = { return VNDetectBarcodesRequest(completionHandler: { request,
error in guard let observations = request.results as? [VNBarcodeObservation] else { return } let rects = observations.map { $0.boundingBox } DispatchQueue.main.async { [weak self] in for rect in rects { let view = UIView(frame: convertedRect(rect: rect, to: self!.imageView.frame.size)) view.backgroundColor = .green self?.imageView.addSubview(view) } } let _ = observations.flatMap { observation -> CIBarcodeDescriptor? in if let desc = observation.barcodeDescriptor as? CIBarcodeDescriptor { return desc } else { return nil } } }) }()
lazy var barcodeClassificationRequest: VNDetectBarcodesRequest = { return VNDetectBarcodesRequest(completionHandler: { request,
error in guard let observations = request.results as? [VNBarcodeObservation] else { return } let rects = observations.map { $0.boundingBox } DispatchQueue.main.async { [weak self] in for rect in rects { let view = UIView(frame: convertedRect(rect: rect, to: self!.imageView.frame.size)) view.backgroundColor = .green self?.imageView.addSubview(view) } } let _ = observations.flatMap { observation -> CIBarcodeDescriptor? in if let desc = observation.barcodeDescriptor as? CIBarcodeDescriptor { return desc } else { return nil } } }) }()
ͱΓ͋͑ͣͰ͖ͨ
͕ɺ
όʔίʔυ͕Ͳ͜ʹ͋Δ͔Θ͔͚ͬͨͲɺ ༰ʢ&"/ίʔυʣ͔Βͳ͔ͬͨʜ
lazy var barcodeClassificationRequest: VNDetectBarcodesRequest = { return VNDetectBarcodesRequest(completionHandler: { request,
error in guard let observations = request.results as? [VNBarcodeObservation] else { return } let rects = observations.map { $0.boundingBox } DispatchQueue.main.async { [weak self] in for rect in rects { let view = UIView(frame: convertedRect(rect: rect, to: self!.imageView.frame.size)) view.backgroundColor = .green self?.imageView.addSubview(view) } } let _ = observations.flatMap { observation -> CIBarcodeDescriptor? in if let desc = observation.barcodeDescriptor as? CIBarcodeDescriptor { return desc } else { return nil } } }) }()
w $*#BS$PEF%FTDSJQUPSͰ&"/ίʔυ͕औಘͰ͖Δ ͣɺͱࢥ͍͕ͬͯͨɺͦΜͳͷͳ͔ͬͨ w $*#BS$PEF%FTDSJQUPS/40CKFDUͷαϒΫϥεͰ ಛʹԿ࣮͞Ε͍ͯͳ͍
IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXEDΑΓ Framework Barcode Support Several frameworks support various barcodes types
AVFoundation.framework Vision.framework CoreImage.framework Detection of barcodes during capture Detection of barcodes after capture Rendering barcodes CIBarcodeDescriptor
IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPODPSFJNBHFDJCBSDPEFEFTDSJQUPS
w ࣮$*#BS$PEF%FTDSJQUPSͷαϒΫϥεʹҕͶΒ Ε͍ͯͯɺ͍·ཉ͍͠ͷ&"/ίʔυʹରԠͨ͠ ͷͳ͔ͬͨ IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPODPSFJNBHFDJCBSDPEFEFTDSJQUPS
w $*23$PEF%FTDSJQUPS w $*"[UFD$PEF%FTDSJQUPS w $*1%'$PEF%FTDSJQUPS w $*%BUB.BUSJY$PEF%FTDSJQUPS ରԠ͍ͯ͠Δ̎࣍ݩίʔυ
Framework Barcode Support Several frameworks support various barcodes types AVFoundation.framework
Vision.framework CoreImage.framework Detection of barcodes during capture Detection of barcodes after capture Rendering barcodes CIBarcodeDescriptor
·ͱΊ w 7JTJPOΛ͏ͱόʔίʔυ͕ը૾ͷதʹ͋Δͱ͍͏ ͜ͱ͔Δ w ը໘্ͷͲ͜ʹ͋Δ͔ͷ࠲ඪऔΕΔͷͰɺؤுͬ ͯ&"/ίʔυม·ͰͰ͖Δͣ w IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZ XXED
UJNF
͓ΘΓ