mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 01:13:28 +08:00
Merge pull request #11682 from alalek:fix_pylint
This commit is contained in:
commit
b2cff44084
@ -23,7 +23,7 @@ class Bindings(NewOpenCVTests):
|
||||
try:
|
||||
cv.imshow("", None) # This causes an assert
|
||||
self.assertEqual("Dead code", 0)
|
||||
except cv.error as e:
|
||||
except cv.error as _e:
|
||||
pass
|
||||
|
||||
handler_called = [False]
|
||||
@ -34,7 +34,7 @@ class Bindings(NewOpenCVTests):
|
||||
try:
|
||||
cv.imshow("", None) # This causes an assert
|
||||
self.assertEqual("Dead code", 0)
|
||||
except cv.error as e:
|
||||
except cv.error as _e:
|
||||
self.assertEqual(handler_called[0], True)
|
||||
pass
|
||||
|
||||
@ -42,7 +42,7 @@ class Bindings(NewOpenCVTests):
|
||||
try:
|
||||
cv.imshow("", None) # This causes an assert
|
||||
self.assertEqual("Dead code", 0)
|
||||
except cv.error as e:
|
||||
except cv.error as _e:
|
||||
pass
|
||||
|
||||
|
||||
|
@ -174,7 +174,7 @@ while cv.waitKey(1) < 0:
|
||||
net.setInput(blob)
|
||||
if net.getLayer(0).outputNameToIndex('im_info') != -1: # Faster-RCNN or R-FCN
|
||||
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))
|
||||
|
||||
postprocess(frame, outs)
|
||||
|
@ -71,7 +71,7 @@ if __name__ == '__main__':
|
||||
if debug_dir:
|
||||
vis = cv.cvtColor(img, cv.COLOR_GRAY2BGR)
|
||||
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')
|
||||
cv.imwrite(outfile, vis)
|
||||
|
||||
|
@ -91,7 +91,7 @@ def create_board_model(extrinsics, board_width, board_height, square_size, draw_
|
||||
|
||||
# draw calibration board
|
||||
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,1] = [width,0,0]
|
||||
X_board[0:3,2] = [width,height,0]
|
||||
|
@ -18,7 +18,7 @@ src = cv.cvtColor(src, cv.COLOR_BGR2GRAY)
|
||||
## [Convert to grayscale]
|
||||
|
||||
## [Apply Histogram Equalization]
|
||||
dst = cv.equalizeHist(src);
|
||||
dst = cv.equalizeHist(src)
|
||||
## [Apply Histogram Equalization]
|
||||
|
||||
## [Display results]
|
||||
|
@ -88,7 +88,7 @@ def main(argv):
|
||||
def display_caption(caption):
|
||||
global dst
|
||||
dst = np.zeros(src.shape, src.dtype)
|
||||
rows, cols, ch = src.shape
|
||||
rows, cols, _ch = src.shape
|
||||
cv.putText(dst, caption,
|
||||
(int(cols / 4), int(rows / 2)),
|
||||
cv.FONT_HERSHEY_COMPLEX, 1, (255, 255, 255))
|
||||
|
@ -33,7 +33,7 @@ if src is None:
|
||||
print('Could not open or find the image: ', args.input)
|
||||
exit(0)
|
||||
# Convert the image to Gray
|
||||
src_gray = cv.cvtColor(src, cv.COLOR_BGR2GRAY);
|
||||
src_gray = cv.cvtColor(src, cv.COLOR_BGR2GRAY)
|
||||
## [load]
|
||||
|
||||
## [window]
|
||||
|
@ -94,7 +94,7 @@ while True:
|
||||
break
|
||||
|
||||
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]
|
||||
|
||||
## [show]
|
||||
|
Loading…
Reference in New Issue
Block a user