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
数独ではじめるアルゴリズム 第三章 OCR
Search
Ryosuke Uchiyama
December 09, 2020
Programming
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
数独ではじめるアルゴリズム 第三章 OCR
Ryosuke Uchiyama
December 09, 2020
More Decks by Ryosuke Uchiyama
See All by Ryosuke Uchiyama
AWSでサーバレスな書籍管理アプリを作る
step63r
0
65
PythonでSlack通知botを作る
step63r
0
23
ChatGPT実践
step63r
1
390
IoT実践! 行先予定表を電子ペーパーで作る
step63r
0
47
React x Socket.ioで人狼サーバを作る 第一章 フロントエンド実装
step63r
0
32
深層強化学習で東方AI 第一章 DQNの基本
step63r
0
330
Build 2021 プレイバック
step63r
0
44
WPFで実践アプリ開発! 第四章 機能の実装 Part 2
step63r
0
62
WPFで実践アプリ開発! 第三章 機能の実装 Part 1
step63r
0
140
Other Decks in Programming
See All in Programming
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
260
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
7.2k
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
150
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
4
2.7k
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
320
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
1
150
スマート反転とウェブアクセシビリティ
camiha
0
210
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
240
FreeBSDでZabbixを動かす.pdf
kenkino
0
280
アクセシビリティから考える情報設計
high_g_engineer
0
380
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
280
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
330
Featured
See All Featured
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
540
Are puppies a ranking factor?
jonoalderson
2
3.9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
910
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
410
Tell your own story through comics
letsgokoyo
1
1.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
KATA
mclloyd
PRO
35
15k
How to Talk to Developers About Accessibility
jct
2
550
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
280
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
520
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Transcript
数独ではじめるアルゴリズム 第三章 OCR Ryosuke Uchiyama step63r
グラフ構造と深さ優先探索(DFS) 0 1 2 3 4 11 5 8 6
7 9 10 12 13 14 前 回 の あ ら す じ
入れられる数字の選択肢が少ないマスから埋めていく 3 6 5 4 8 7 9 4 5
1 9 7 3 5 6 8 9 6 5 4 4 6 5 5 6 5 3 5 3 4 5 6 5 3 4 4 4 6 5 5 5 4 4 5 5 5 4 4 5 5 5 4 7 3 3 4 3 4 4 5 6 4 4 5 6 5 4 4 6 4 5 7 7 4 6 7 7 5 6 6 8 問題 入れられる数字の残数 ここから処理するよりも… この辺から処理した方が速い! 前 回 の あ ら す じ
一意に決まるマスはあらかじめ埋めておく 3 6 5 4 8 7 9 4 5
1 9 7 3 5 6 8 9 問題 5 8 3 6 5 4 8 7 5 9 4 6 5 9 1 5 9 7 3 5 6 8 5 9 5 前処理後の問題 前 回 の あ ら す じ
MVVMパターン View ViewModel Model データ バインディング コマンド メソッド呼出し プロパティ設定 変更通知
変更通知 前 回 の あ ら す じ
Xamarin.Forms Shared C# Backend Shared UI Code iOS Android Windows
前 回 の あ ら す じ
今後やること • UI実装(WPFかXamarinあたり) • モバイル対応(iOSアプリをビルドする環境がない……つらたん……) • OCR(問題をカメラで撮ってAzure Cognitive Servicesとかで盤面認識&自動解答) •
マルチスレッド(たぶんやらないやつ) 前 回 の あ ら す じ
数字の検出
Computer Visionを用いたテキスト抽出 問題発生!
Text = "3", BoundingBox = [ (115, 16), (133, 17),
(132, 39), (114, 38)] どのマスにどの数字が 入るんだ……? 数独のマスも検出する必要があった!
マスの検出
どんなフレームワークが使えるか 案1 Azure Cognitive Servicesの既存モデルを活用 案2 Custom Visionに独自モデルをデプロイ 案3 画像解析ライブラリで交点検出
「数独のマスを検出するAPI」があるわけないので却下。 学習(データ採取)が面倒くさすぎるので却下。 PythonとOpenCVで似たようなことをやったことがあるな? 1)Harrisのコーナー検出 → 精度イマイチ 2)Shi-Tomasiのコーナー検出 → 精度イマイチ 3)Canny → いけそう! 採 用 採 用
XamarinでどうやってOpenCVを使うか Windows ランタイム コンポーネント - UWP applications | Microsoft Docs
Microsoftは神か? OpenCV でのビットマップの処理 - UWP applications | Microsoft Docs 問題発生!
cv::Mat Platform::Collections::Vector マネージ/ネイティブ間のマーシャリング 結局、フレーム検出機能はPythonで実装することに
つくったもの
ソースコード SudokuApp uchi-sudokuapp-functions
全体構成 SudokuApp ローカルストレージ OpenFileAsync RandamAccessStream Function App Cognitive Services DetectSudokuFrame
JSON Response Stream IList<ReadResult>
Demo