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.8k
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.6k
Alexa, Swiftで スマートスピーカーは実装できる?
motokiee
0
1.5k
iOSの自動化と仕組み化 ~コードと設計に集中する~
motokiee
11
2.9k
入力を型で表現する
motokiee
2
3.8k
Move Fast iOS Development
motokiee
4
3.8k
結婚式を支えた技術 Firebaseを活用したサーバレスiOSアプリケーション開発
motokiee
33
25k
Lightweight Dependency Injection tips
motokiee
10
2.9k
Hello React Native
motokiee
8
590
RxSwift in Practice
motokiee
11
5.7k
Other Decks in Technology
See All in Technology
Oracle Cloud Infrastructure:2024年12月度サービス・アップデート
oracle4engineer
PRO
0
190
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
110
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
180
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
150
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
110
Snowflake女子会#3 Snowpipeの良さを5分で語るよ
lana2548
0
230
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
560
サーバレスアプリ開発者向けアップデートをキャッチアップしてきた #AWSreInvent #regrowth_fuk
drumnistnakano
0
190
LINEスキマニにおけるフロントエンド開発
lycorptech_jp
PRO
0
330
DevOps視点でAWS re:invent2024の新サービス・アプデを振り返ってみた
oshanqq
0
180
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
540
NilAway による静的解析で「10 億ドル」を節約する #kyotogo / Kyoto Go 56th
ytaka23
3
380
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Side Projects
sachag
452
42k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
The Cost Of JavaScript in 2023
addyosmani
45
7k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Designing for Performance
lara
604
68k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
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
͓ΘΓ