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
700
20181130.pdf
sug1t0m0
December 20, 2018
Tweet
Share
More Decks by sug1t0m0
See All by sug1t0m0
ECS+S3でスクレイピングを試してみた
sug1t0m0
0
1k
単純パーセプトロンで遊んでみたかった
sug1t0m0
0
730
渡る世間はナベばかり」でカルタ遊びをしてみての感想(大津の手法で「ナベ」カードを検出してみた)
sug1t0m0
0
890
Other Decks in Technology
See All in Technology
人と組織に偏重したEMへのアンチテーゼ──なぜ、EMに設計力が必要なのか/An antithesis to the overemphasis of people and organizations in EM
dskst
6
620
「AI2027」を紐解く ― AGI・ASI・シンギュラリティ
masayamoriofficial
0
100
見てわかるテスト駆動開発
recruitengineers
PRO
5
380
トヨタ生産方式(TPS)入門
recruitengineers
PRO
3
250
AIとTDDによるNext.js「隙間ツール」開発の実践
makotot
6
700
[CV勉強会@関東 CVPR2025 読み会] MegaSaM: Accurate, Fast, and Robust Structure and Motion from Casual Dynamic Videos (Li+, CVPR2025)
abemii
0
190
実践データベース設計 ①データベース設計概論
recruitengineers
PRO
3
270
GitHub Copilot coding agent を推したい / AIDD Nagoya #1
tnir
3
4.6k
退屈なことはDevinにやらせよう〜〜Devin APIを使ったVisual Regression Testの自動追加〜
kawamataryo
3
690
Android Studio の 新しいAI機能を試してみよう / Try out the new AI features in Android Studio
yanzm
0
270
EKS Pod Identity における推移的な session tags
z63d
1
210
Goでマークダウンの独自記法を実装する
lag129
0
220
Featured
See All Featured
Bash Introduction
62gerente
614
210k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.4k
Making Projects Easy
brettharned
117
6.3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
A designer walks into a library…
pauljervisheath
207
24k
Done Done
chrislema
185
16k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
780
KATA
mclloyd
32
14k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
Become a Pro
speakerdeck
PRO
29
5.5k
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 দҪ͞Μ