質問編集履歴
7
コード削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -120,8 +120,6 @@
|
|
120
120
|
|
121
121
|
cv_img = cv2.cvtColor(cv_img1, cv2.COLOR_BAYER_BG2BGR)
|
122
122
|
|
123
|
-
cv_img0 = cv_img
|
124
|
-
|
125
123
|
cv_img = cv2.resize(cv_img,(380,270))
|
126
124
|
|
127
125
|
|
6
コード一部削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -71,20 +71,6 @@
|
|
71
71
|
|
72
72
|
|
73
73
|
MainWindow.setCentralWidget(self.centralwidget)
|
74
|
-
|
75
|
-
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
76
|
-
|
77
|
-
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 28))
|
78
|
-
|
79
|
-
self.menubar.setObjectName("menubar")
|
80
|
-
|
81
|
-
MainWindow.setMenuBar(self.menubar)
|
82
|
-
|
83
|
-
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
84
|
-
|
85
|
-
self.statusbar.setObjectName("statusbar")
|
86
|
-
|
87
|
-
MainWindow.setStatusBar(self.statusbar)
|
88
74
|
|
89
75
|
|
90
76
|
|
5
tipo
test
CHANGED
File without changes
|
test
CHANGED
@@ -112,8 +112,6 @@
|
|
112
112
|
|
113
113
|
|
114
114
|
|
115
|
-
global cv_img0
|
116
|
-
|
117
115
|
c = PyCapture2.Camera()
|
118
116
|
|
119
117
|
c.connect(uid)
|
4
全ソースアップ
test
CHANGED
File without changes
|
test
CHANGED
@@ -30,13 +30,69 @@
|
|
30
30
|
|
31
31
|
|
32
32
|
|
33
|
+
# -*- coding: utf-8 -*-
|
34
|
+
|
35
|
+
from PyQt5 import QtCore, QtGui, QtWidgets
|
36
|
+
|
37
|
+
from PyQt5.QtCore import QThread
|
38
|
+
|
39
|
+
import cv2
|
40
|
+
|
41
|
+
import PyCapture2
|
42
|
+
|
43
|
+
import numpy as np
|
44
|
+
|
45
|
+
|
46
|
+
|
33
|
-
class Ui_MainWindow(object):
|
47
|
+
class Ui_MainWindow(object):
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
def __init__(self, parent=None):
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
MainWindow.setObjectName("MainWindow")
|
56
|
+
|
57
|
+
MainWindow.resize(600, 400)
|
58
|
+
|
59
|
+
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
60
|
+
|
61
|
+
self.centralwidget.setObjectName("centralwidget")
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
self.graphicsView = QtWidgets.QGraphicsView(self.centralwidget)
|
66
|
+
|
67
|
+
self.graphicsView.setGeometry(QtCore.QRect(150, 20, 400, 300))
|
68
|
+
|
69
|
+
self.graphicsView.setObjectName("graphicsView")
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
MainWindow.setCentralWidget(self.centralwidget)
|
74
|
+
|
75
|
+
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
76
|
+
|
77
|
+
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 28))
|
78
|
+
|
79
|
+
self.menubar.setObjectName("menubar")
|
80
|
+
|
81
|
+
MainWindow.setMenuBar(self.menubar)
|
82
|
+
|
83
|
+
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
84
|
+
|
85
|
+
self.statusbar.setObjectName("statusbar")
|
86
|
+
|
87
|
+
MainWindow.setStatusBar(self.statusbar)
|
88
|
+
|
89
|
+
|
34
90
|
|
35
91
|
self.Thread = CapThread()
|
36
92
|
|
37
|
-
self.Thread.start()
|
93
|
+
self.Thread.start()
|
38
94
|
|
39
|
-
|
95
|
+
|
40
96
|
|
41
97
|
class CapThread(QThread):
|
42
98
|
|
@@ -50,7 +106,11 @@
|
|
50
106
|
|
51
107
|
def run(QMainWindow):
|
52
108
|
|
53
|
-
|
109
|
+
bus = PyCapture2.BusManager()
|
110
|
+
|
111
|
+
uid = bus.getCameraFromIndex(0)
|
112
|
+
|
113
|
+
|
54
114
|
|
55
115
|
global cv_img0
|
56
116
|
|
@@ -98,6 +158,24 @@
|
|
98
158
|
|
99
159
|
|
100
160
|
|
161
|
+
|
162
|
+
|
163
|
+
if __name__ == "__main__":
|
164
|
+
|
165
|
+
import sys
|
166
|
+
|
167
|
+
app = QtWidgets.QApplication(sys.argv)
|
168
|
+
|
169
|
+
MainWindow = QtWidgets.QMainWindow()
|
170
|
+
|
171
|
+
ui = Ui_MainWindow()
|
172
|
+
|
173
|
+
MainWindow.show()
|
174
|
+
|
175
|
+
sys.exit(app.exec_())
|
176
|
+
|
177
|
+
|
178
|
+
|
101
179
|
```
|
102
180
|
|
103
181
|
|
3
tipo
test
CHANGED
File without changes
|
test
CHANGED
@@ -113,7 +113,3 @@
|
|
113
113
|
### 補足情報(FW/ツールのバージョンなど)
|
114
114
|
|
115
115
|
ホスト:Windows10、FLIRのカメラ使用
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
ここにより詳細な情報を記載してください。
|
2
mainwindow追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -27,6 +27,16 @@
|
|
27
27
|
|
28
28
|
|
29
29
|
```Python3.5
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
class Ui_MainWindow(object):の中で、
|
34
|
+
|
35
|
+
self.Thread = CapThread()
|
36
|
+
|
37
|
+
self.Thread.start() としてThread開始。
|
38
|
+
|
39
|
+
|
30
40
|
|
31
41
|
class CapThread(QThread):
|
32
42
|
|
1
問題の詳細を追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -11,6 +11,8 @@
|
|
11
11
|
|
12
12
|
|
13
13
|
```
|
14
|
+
|
15
|
+
画像はキャプチャできるが、以下のエラーが出続ける。
|
14
16
|
|
15
17
|
QObject::killTimer: Timers cannot be stopped from another thread
|
16
18
|
|