Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
nekoIoTLT_SearchBlackObject
Search
NearMugi
October 21, 2020
Technology
720
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
nekoIoTLT_SearchBlackObject
NearMugi
October 21, 2020
More Decks by NearMugi
See All by NearMugi
nekoIoTLT_NearMugiLLM
nearmugi
0
420
nekoIoTLT_CatAndColorSensor
nearmugi
0
990
VisualProgramming_GoogleHome_LINE
nearmugi
1
640
EnebularMeetup_GoogleCalendar
nearmugi
0
320
nekoIoTLT_ToyAndVoiceAnalysis
nearmugi
0
420
nekoIoTLT_Demachi
nearmugi
0
480
nekoIoTLT_nekoDeeplearning
nearmugi
0
360
nekoIoTLT_nekoGohan
nearmugi
0
580
nekoIoTLT_Tsumetogi
nearmugi
1
750
Other Decks in Technology
See All in Technology
Sigmaユーザーのための有用リソース一挙公開 & Sigmaで使えるMCP #sigma_ucj /useful-resources-for-sigma-computing-users-and-mcps-with-sigma
shinyaa31
0
200
データ界隈LT祭 第1回LT登壇
taromatsui_cccmkhd
0
510
AIネイティブプロダクトで顧客価値を最大化するプロダクトエンジニアとFDEの協働
righttouch
PRO
0
260
2026/09/10 Spring Bootから Jakarta EE/MicroProfileへの移行
megascus
0
350
Deploying a Full-Stack Bun-Native Framework on Cloudflare Workers
7nohe
0
150
From Vanilla Kubernetes to a Batteries-Included Platform: Developer Experience at 1,300+ Clusters
yosshi_
0
700
range over func 2年間の軌跡 Issue #56413 はGoのエコシステムをどう変えたか
ryujicre8ive
0
120
20260912_スクフェス三河
kgnkhkr
0
320
消えない 動かない 効かない
yama3133
1
120
Podは生きているのにGoだけが落ちる:GOGCとGOMEMLIMITで追うInvisible OOM Killの謎
tkc66buzz
1
650
Tab5をRubyで動くパソコンにする
kishima
2
360
OpenTelemetry eBPF Instrumentationの舞台裏 / Behind the Scenes of OpenTelemetry eBPF Instrumentation
ymotongpoo
4
1.2k
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
410
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Six Lessons from altMBA
skipperchong
29
4.5k
Done Done
chrislema
186
16k
Documentation Writing (for coders)
carmenintech
77
5.5k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
520
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
280
Un-Boring Meetings
codingconduct
0
410
WCS-LA-2024
lcolladotor
0
830
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
500
Transcript
トイレにある黒い物体を検知する 2020.10.21 夜開催! ねこIoTLT vol.4
自己紹介 NearMugi(ニアムギ) ねこ2匹飼っています。
ねこ紹介 ニア ・3月8日生まれ 11歳 ・もふもふでかわいい ・寒くなってきたのでさらにもふもふに
ねこ紹介 ムギ ・5月8日生まれ 8歳 ・黒猫でかわいい ・メーメー鳴く ・この子も少し毛が伸びた
イントロ みなさんのおうちでこんなこと ありませんか?
イントロ ねこがトイレの前でじっとしている…
イントロ トイレを見てみると中に 黒い物体が。
イントロ 「これを取ってくれ」と言わんばかりに 立っている。
イントロ すぐに取ってあげたい。 気づいてあげたい。
イントロ IoTで解決してみます。
1.トイレの様子を定期的に撮影 2.撮影した画像から黒い物体を検知 3.LINEで通知 大まかな手順
・30分ごとに撮影する ・部屋の明るさの変化を考慮する ・前回撮影した画像と似ている場合は通知しない ・機械学習は使わずに黒い物体を検知する 細かい仕様
1. ESP32+カメラで撮影、GoogleCloudStorage(GCS)へ画像をアップロードする 2. GCSに画像がアップロードされたイベントをトリガーに Cloud Pub/Subからメッセージが 送信される 3. Node-REDフロー内でCloud Pub/Subのメッセージを受信する
4. 画像をGCSから取得して解析する 5. 黒い物体を検知したとき、 LINEに通知する 手順の詳細 GoogleCloudStorage Cloud Pub/Sub GoogleComputeEngine メッセージ受信 画像取得 解析 通知
Cloud Pub/Subのメッセージを受信したら、 画像を取得する 手順の詳細(Node-REDフロー) 前回の画像をGCSから取得する 処理で使うパラメータを GCSから取得する 解析する ログと解析後の画像を GCSへ保存する
黒い物体を検知できたら LINEへ通知する
黒い物体の検知方法 黒い物体を検知するため OpenCVを使いました
黒い物体の検知方法 カメラで撮った画像 → 2値化(白黒)→白黒反転→輪郭を検出→面積を取得 → 面積の大きさから黒い物体があるか判断 画像から黒い物体を検知するまでの処理
黒い物体の検知方法 adaptiveThreshold : 画像をいい感じに2値化(白黒)する findContours : 黒い背景から白い物体の輪郭を検出する contourArea : 輪郭内の面積を取得する
OpenCVの関数
黒い物体の検知方法 -関数の説明(adaptiveThreshold) 元画像 void adaptiveThreshold(const Mat& src, Mat& dst, double maxValue,
int adaptiveMethod, int thresholdType, int blockSize, double C) 定数Cを変化させることで、白黒の範囲を調整できる C:10 白黒割合:0.29 C:20 白黒割合:0.23 C:30 白黒割合:0.18 C:40 白黒割合:0.13 C:60 白黒割合:0.06 C:70 白黒割合:0.04 C:80 白黒割合:0.03 C:90 白黒割合:0.02 C:50 白黒割合:0.09 ここらへんがちょうど良い
黒い物体の検知方法 -関数の説明(findContours, contourArea) void findContours(const Mat& image, vector<vector<Point> >& contours, int
mode, int method, Point offset=Point()) double contourArea(const Mat& contour) 輪郭を検出すると細かい部分も含まれてしまうので、面積の大きさから判断する 元画像に輪郭を検出したデータを合成したもの 面積の大きさにしきい値を設けたもの
通知 黒い物体を検知するとLINEに通知がきます
結果 検出結果をお見せしたいのですが、 黒い物体があれなので 今回は控えさせていただきます。 そこそこの検出具合でした。 明るさの調整が一番難しいです。
黒い物体の検知のポイント 白黒がはっきりしていると検知しやすいので、 大玉の猫砂がおすすめです
まとめ ・機械学習を使わなくてもある程度の検知が出来ると知りました。 照度センサーなどの補助があればもう少し精度が上がりそうです。 ・検知しやすくさせるため砂を平らにならしたり、砂の汚れ具合を 気にするようになりました。 以上となります。 ご清聴ありがとうございました。