Commit b2cff440 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #11682 from alalek:fix_pylint

parents 9c2b924d dcb9bc25
...@@ -23,7 +23,7 @@ class Bindings(NewOpenCVTests): ...@@ -23,7 +23,7 @@ class Bindings(NewOpenCVTests):
try: try:
cv.imshow("", None) # This causes an assert cv.imshow("", None) # This causes an assert
self.assertEqual("Dead code", 0) self.assertEqual("Dead code", 0)
except cv.error as e: except cv.error as _e:
pass pass
handler_called = [False] handler_called = [False]
...@@ -34,7 +34,7 @@ class Bindings(NewOpenCVTests): ...@@ -34,7 +34,7 @@ class Bindings(NewOpenCVTests):
try: try:
cv.imshow("", None) # This causes an assert cv.imshow("", None) # This causes an assert
self.assertEqual("Dead code", 0) self.assertEqual("Dead code", 0)
except cv.error as e: except cv.error as _e:
self.assertEqual(handler_called[0], True) self.assertEqual(handler_called[0], True)
pass pass
...@@ -42,7 +42,7 @@ class Bindings(NewOpenCVTests): ...@@ -42,7 +42,7 @@ class Bindings(NewOpenCVTests):
try: try:
cv.imshow("", None) # This causes an assert cv.imshow("", None) # This causes an assert
self.assertEqual("Dead code", 0) self.assertEqual("Dead code", 0)
except cv.error as e: except cv.error as _e:
pass pass
......
...@@ -174,7 +174,7 @@ while cv.waitKey(1) < 0: ...@@ -174,7 +174,7 @@ while cv.waitKey(1) < 0:
net.setInput(blob) net.setInput(blob)
if net.getLayer(0).outputNameToIndex('im_info') != -1: # Faster-RCNN or R-FCN if net.getLayer(0).outputNameToIndex('im_info') != -1: # Faster-RCNN or R-FCN
frame = cv.resize(frame, (inpWidth, inpHeight)) frame = cv.resize(frame, (inpWidth, inpHeight))
net.setInput(np.array([inpHeight, inpWidth, 1.6], dtype=np.float32), 'im_info'); net.setInput(np.array([inpHeight, inpWidth, 1.6], dtype=np.float32), 'im_info')
outs = net.forward(getOutputsNames(net)) outs = net.forward(getOutputsNames(net))
postprocess(frame, outs) postprocess(frame, outs)
......
...@@ -71,7 +71,7 @@ if __name__ == '__main__': ...@@ -71,7 +71,7 @@ if __name__ == '__main__':
if debug_dir: if debug_dir:
vis = cv.cvtColor(img, cv.COLOR_GRAY2BGR) vis = cv.cvtColor(img, cv.COLOR_GRAY2BGR)
cv.drawChessboardCorners(vis, pattern_size, corners, found) cv.drawChessboardCorners(vis, pattern_size, corners, found)
path, name, ext = splitfn(fn) _path, name, _ext = splitfn(fn)
outfile = os.path.join(debug_dir, name + '_chess.png') outfile = os.path.join(debug_dir, name + '_chess.png')
cv.imwrite(outfile, vis) cv.imwrite(outfile, vis)
......
...@@ -91,7 +91,7 @@ def create_board_model(extrinsics, board_width, board_height, square_size, draw_ ...@@ -91,7 +91,7 @@ def create_board_model(extrinsics, board_width, board_height, square_size, draw_
# draw calibration board # draw calibration board
X_board = np.ones((4,5)) X_board = np.ones((4,5))
X_board_cam = np.ones((extrinsics.shape[0],4,5)) #X_board_cam = np.ones((extrinsics.shape[0],4,5))
X_board[0:3,0] = [0,0,0] X_board[0:3,0] = [0,0,0]
X_board[0:3,1] = [width,0,0] X_board[0:3,1] = [width,0,0]
X_board[0:3,2] = [width,height,0] X_board[0:3,2] = [width,height,0]
......
...@@ -18,7 +18,7 @@ src = cv.cvtColor(src, cv.COLOR_BGR2GRAY) ...@@ -18,7 +18,7 @@ src = cv.cvtColor(src, cv.COLOR_BGR2GRAY)
## [Convert to grayscale] ## [Convert to grayscale]
## [Apply Histogram Equalization] ## [Apply Histogram Equalization]
dst = cv.equalizeHist(src); dst = cv.equalizeHist(src)
## [Apply Histogram Equalization] ## [Apply Histogram Equalization]
## [Display results] ## [Display results]
......
...@@ -88,7 +88,7 @@ def main(argv): ...@@ -88,7 +88,7 @@ def main(argv):
def display_caption(caption): def display_caption(caption):
global dst global dst
dst = np.zeros(src.shape, src.dtype) dst = np.zeros(src.shape, src.dtype)
rows, cols, ch = src.shape rows, cols, _ch = src.shape
cv.putText(dst, caption, cv.putText(dst, caption,
(int(cols / 4), int(rows / 2)), (int(cols / 4), int(rows / 2)),
cv.FONT_HERSHEY_COMPLEX, 1, (255, 255, 255)) cv.FONT_HERSHEY_COMPLEX, 1, (255, 255, 255))
......
...@@ -33,7 +33,7 @@ if src is None: ...@@ -33,7 +33,7 @@ if src is None:
print('Could not open or find the image: ', args.input) print('Could not open or find the image: ', args.input)
exit(0) exit(0)
# Convert the image to Gray # Convert the image to Gray
src_gray = cv.cvtColor(src, cv.COLOR_BGR2GRAY); src_gray = cv.cvtColor(src, cv.COLOR_BGR2GRAY)
## [load] ## [load]
## [window] ## [window]
......
...@@ -94,7 +94,7 @@ while True: ...@@ -94,7 +94,7 @@ while True:
break break
frame_HSV = cv.cvtColor(frame, cv.COLOR_BGR2HSV) frame_HSV = cv.cvtColor(frame, cv.COLOR_BGR2HSV)
frame_threshold = cv.inRange(frame_HSV, (low_H, low_S, low_V), (high_H, high_S, high_V)); frame_threshold = cv.inRange(frame_HSV, (low_H, low_S, low_V), (high_H, high_S, high_V))
## [while] ## [while]
## [show] ## [show]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment