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
720
渡る世間はナベばかり」でカルタ遊びをしてみての感想(大津の手法で「ナベ」カードを検出してみた)
sug1t0m0
0
880
Other Decks in Technology
See All in Technology
関数型プログラミングで 「脳がバグる」を乗り越える
manabeai
1
180
Operating Operator
shhnjk
1
580
「クラウドコスト絶対削減」を支える技術—FinOpsを超えた徹底的なクラウドコスト削減の実践論
delta_tech
4
160
Backlog ユーザー棚卸しRTA、多分これが一番早いと思います
__allllllllez__
1
150
Beyond Kaniko: Navigating Unprivileged Container Image Creation
f30
0
130
品質と速度の両立:生成AI時代の品質保証アプローチ
odasho
1
320
Claude Code に プロジェクト管理やらせたみた
unson
6
3.7k
United airlines®️ USA Contact Numbers: Complete 2025 Support Guide
unitedflyhelp
0
260
B2C&B2B&社内向けサービスを抱える開発組織におけるサービス価値を最大化するイニシアチブ管理
belongadmin
1
6.8k
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
3
960
ドメイン特化なCLIPモデルとデータセットの紹介
tattaka
2
590
Enhancing SaaS Product Reliability and Release Velocity through Optimized Testing Approach
ropqa
1
210
Featured
See All Featured
Side Projects
sachag
455
42k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
5
290
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Statistics for Hackers
jakevdp
799
220k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
What's in a price? How to price your products and services
michaelherold
246
12k
Making Projects Easy
brettharned
116
6.3k
Visualization
eitanlees
146
16k
Being A Developer After 40
akosma
90
590k
Building Applications with DynamoDB
mza
95
6.5k
It's Worth the Effort
3n
185
28k
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 দҪ͞Μ