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
Pythonによる工業用カメラ画像取得事例
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
OHNO
August 08, 2020
Programming
1.5k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Pythonによる工業用カメラ画像取得事例
OHNO
August 08, 2020
More Decks by OHNO
See All by OHNO
自社データを生成AIに活用
planeta
0
120
生成系AIで自データを扱うには
planeta
0
240
外観検査の難しさ
planeta
0
560
儲かるPython
planeta
0
260
画像処理ライブラリOpenCVの使い方0910
planeta
0
1.5k
画像処理ライブラリOpenCVの使い方
planeta
0
1.1k
SONYのNNC
planeta
0
640
機械学習による動作認識
planeta
0
790
画像類似度計算
planeta
0
2.1k
Other Decks in Programming
See All in Programming
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2.1k
Heart of Swift Concurrency
koher
0
890
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
490
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
1.7k
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
280
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
500
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
340
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
3
180
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
3k
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
290
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
5
3.3k
【高い買い物LT会】初任給で話題の国産フィジカルAIを買った話
akagami
PRO
0
160
Featured
See All Featured
Code Review Best Practice
trishagee
74
20k
Amusing Abliteration
ianozsvald
1
310
Building Adaptive Systems
keathley
44
3.2k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
890
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
420
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
300
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
480
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
380
Building a Scalable Design System with Sketch
lauravandoore
464
34k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
500
Transcript
Pythonによる工業用カメラ 画像取得事例 TensorFlow User Group Niigata #3 大野 宏
画像分類をするためには ・製造業で画像分類や傷を検査するためには、多くの高 解像度の画像が必要 ・PythonではUSBカメラの画像の取得は容易であるが、高 解像度の工業用カメラは・・・ ・メーカが提供するライブラリは、C、C#、C++ ・画像取り込みはC、画像分類はPython → 同じ言語で画像取り込みから分類まで出来るとよい 露光時間、フレームレート等を制御可能
Basler 社のカメラ https://www.baslerweb.com/jp/products/software/basler-pylon- camera-software-suite/pylon-open-source-projects/
Pythonライブラリ https://github.com/basler/pypylon
PythonによるUSBカメラ画像取得 ・画像処理ライブラリOpenCVを使ったプログラム import cv2 capture = cv2.VideoCapture(1) while(True): ret, frame
= capture.read() cv2.imshow('title',frame) if cv2.waitKey(1) & 0xFF == ord('q'): break
Pythonプログラム1/3 from pypylon import pylon from pypylon import genicam import
sys import cv2 import numpy as np width = 2044 height = 1536 img1 = np.zeros((height, width, 1), np.uint8) countOfImagesToGrab = 10 exitCode = 0 try: camera =pylon.InstantCamera(pylon.TlFactory.GetInstance().CreateFirstDevice()) camera.Open() print("Using device ", camera.GetDeviceInfo().GetModelName()) new_width = camera.Width.GetValue() - camera.Width.GetInc()
Pythonプログラム2/3 if new_width >= camera.Width.GetMin(): camera.Width.SetValue(new_width) camera.MaxNumBuffer = 5 while
True: camera.StartGrabbingMax(1) while camera.IsGrabbing(): grabResult = camera.RetrieveResult(5000, pylon.TimeoutHandling_ThrowException) if grabResult.GrabSucceeded(): img = grabResult.Array cv2.imshow("img",img) key=cv2.waitKey(1) else: print("Error: ", grabResult.ErrorCode, grabResult.ErrorDescription) if key=='q’: break grabResult.Release()
Pythonプログラム3/3 camera.Close() except genicam.GenericException as e: # Error handling. print("An
exception occurred.") print(e.GetDescription()) exitCode = 1 sys.exit(exitCode)