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
20181130.pdf
Search
sug1t0m0
December 20, 2018
Technology
0
670
20181130.pdf
sug1t0m0
December 20, 2018
Tweet
Share
More Decks by sug1t0m0
See All by sug1t0m0
ECS+S3でスクレイピングを試してみた
sug1t0m0
0
980
単純パーセプトロンで遊んでみたかった
sug1t0m0
0
690
渡る世間はナベばかり」でカルタ遊びをしてみての感想(大津の手法で「ナベ」カードを検出してみた)
sug1t0m0
0
830
Other Decks in Technology
See All in Technology
C++26 エラー性動作
faithandbrave
2
820
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
290
LINE Developersプロダクト(LIFF/LINE Login)におけるフロントエンド開発
lycorptech_jp
PRO
0
150
UI State設計とテスト方針
rmakiyama
3
790
JVM(JavaVM)の性能分析者観点で探るInstanaの可能性
instanautsjp
0
120
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
2
120
Work as an App Engineer
lycorp_recruit_jp
0
360
開発生産性向上! 育成を「改善」と捉えるエンジニア育成戦略
shoota
2
460
GitHub Copilot のテクニック集/GitHub Copilot Techniques
rayuron
39
16k
PHP ユーザのための OpenTelemetry 入門 / phpcon2024-opentelemetry
shin1x1
3
1.4k
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
300
TypeScript開発にモジュラーモノリスを持ち込む
sansantech
PRO
2
650
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Optimising Largest Contentful Paint
csswizardry
33
3k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Building Your Own Lightsaber
phodgson
103
6.1k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
Side Projects
sachag
452
42k
Transcript
͜͜Λ͜͏ͨ͠Β͘ͳͬͨ!! (OpenCVͷαϯϓϧίʔυΛ ίϐϖ͔Γ͍͕ͯͨ͠ ؾ͍ͮͯΑ͔ͬͨͱࢥ͏͜ͱ) Sugiyama.T (@sug1t0m0_agrict) #WaterCell Tech Night #2
Python OpenCVͷجૅ ըૉͷΞΫηε (άάΔͱ͙͢ʹग़ͯ͘Δͭ) • ըૉ͝ͱʹ৭Λऔಘ͢Δ blue = img[10, 20,
0] green = img[10, 20, 1] red = img[10, 20, 2] pixelValue = img[Y࠲ඪ, X࠲ඪ, νϟϯωϧ] • ըૉͷॻ͖͑ img[10, 20, 0] = 255 img[10, 20, 1] = 255 img[10, 20, 2] = 255 img[10, 20] = [255, 255, 255] or
Python OpenCVͷجૅ ըૉͷΞΫηε (NumpyΛ͏ͱ) • img_1ͷըૉ(x,y)͕50Ҏ্ͷͱ͖ img_2ͷըૉ(x,y)ͷΛ52ʹ͍ͨ͠ for y in
range(height): for x in range(weight): if img_1[y, x, 0] >= 50 : img_2[y, x, 0] = 52 ɹɹɹɹɹɹɹɹɹɹɹɹɹͱͬͯ͠·͏ • ͰnumpyΛ͏ͱɺɺɺ cond = img_1 >= 50 img_2[cond] = 52 ɹɹɹɹɹɹɹɹɹɹͰɺ͍͚Δʂ
ͬ͘͟Γ(͔ͳΓదʹ)ൺֱ for y in range(height): for x in range(weight): if
img_1[y, x, 0] >= 50 : img_2[y, x, 0] = 52 • time : 0.779437780380249[sec] cond = img_1 >= 50 img_2[cond] = 52 • time : 0.004307746887207031[sec] • Pythonͷfor͍ • ΠϯλϓϦλͷΦʔόʔϔουʁ • ੩తͳܕఆٛΛ࣋ͨͳ͍͔Βʁ
͜ΕBoolean Indexͱ͍͏ͷΒ͍͠ • numpyͷྻൺֱԋࢉࢠͰܭࢉΛߦ͏ͱਅ ِͷྻʹɺɺɺ • ্هͷਅِͷྻΛ͏͜ͱͰɺըૉͷॻ ͖͕͑ߴʹߦ͑Δɺɺɺ
5 5 ' 5 ' 5 5 5 ' =< 2 img [ ]=2 EW W EW EW 5 5 ' 5 ' 5 5 5 '
To দҪ͞Μ