Skip to content

Commit bc224a4

Browse files
committed
PEP8 E275
1 parent 53a6996 commit bc224a4

28 files changed

+36
-36
lines changed

Diff for: abs_difference.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def nothing(x):
6565
try:
6666
# to use a non-buffered camera stream (via a separate thread)
6767

68-
if not(args.video_file):
68+
if not (args.video_file):
6969
import camera_stream
7070
cap = camera_stream.CameraVideoStream(use_tapi=False)
7171
else:
@@ -205,7 +205,7 @@ def nothing(x):
205205

206206
# toggle grayscale usage (when they press 'g')
207207

208-
use_greyscale = not(use_greyscale)
208+
use_greyscale = not (use_greyscale)
209209

210210
# if the previous frame we stored also has 3 channels (colour)
211211
if (len(prev_frame.shape) != 3):

Diff for: bilateral_filter.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def nothing(x):
6363
try:
6464
# to use a non-buffered camera stream (via a separate thread)
6565

66-
if not(args.video_file):
66+
if not (args.video_file):
6767
import camera_stream
6868
cap = camera_stream.CameraVideoStream(use_tapi=False)
6969
else:
@@ -144,7 +144,7 @@ def nothing(x):
144144
# check neighbourhood is greater than 3 and odd
145145

146146
neighbourhood = max(3, neighbourhood)
147-
if not(neighbourhood % 2):
147+
if not (neighbourhood % 2):
148148
neighbourhood = neighbourhood + 1
149149

150150
# perform Gaussian smoothing using NxN neighbourhood

Diff for: butterworth_high_pass_filter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def reset_butterworth_filter(_):
106106
try:
107107
# to use a non-buffered camera stream (via a separate thread)
108108

109-
if not(args.video_file):
109+
if not (args.video_file):
110110
import camera_stream
111111
cap = camera_stream.CameraVideoStream(use_tapi=False)
112112
else:

Diff for: butterworth_low_pass_filter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def reset_butterworth_filter(_):
106106
try:
107107
# to use a non-buffered camera stream (via a separate thread)
108108

109-
if not(args.video_file):
109+
if not (args.video_file):
110110
import camera_stream
111111
cap = camera_stream.CameraVideoStream(use_tapi=False)
112112
else:

Diff for: camera_stream.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def __init__(self, src=None, backend=None,
127127
self.backend_default = cv2.CAP_ANY # auto-detect via OpenCV
128128

129129
# if a source was specified at init, proceed to open device
130-
if not(src is None):
130+
if not (src is None):
131131
self.open(src, backend)
132132

133133
def open(self, src=0, backend=None):
@@ -182,7 +182,7 @@ def update(self):
182182
# otherwise, read the next frame from the stream
183183
# provided we are not suspended (and get timestamp)
184184

185-
if not(self.suspend):
185+
if not (self.suspend):
186186
(self.grabbed, self.frame) = self.camera.read()
187187
self.timestamp = self.camera.get(cv2.CAP_PROP_POS_MSEC)
188188

Diff for: capture_camera.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
# open camera device (and check it worked)
6161

62-
if not(cap.open(args.camera_to_use)):
62+
if not (cap.open(args.camera_to_use)):
6363
print("Cannot open camera - check connection and operation as suggested.")
6464
sys.exit
6565

Diff for: clahe_equalization.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def nothing(x):
8484
try:
8585
# to use a non-buffered camera stream (via a separate thread)
8686

87-
if not(args.video_file):
87+
if not (args.video_file):
8888
import camera_stream
8989
cap = camera_stream.CameraVideoStream(use_tapi=False)
9090
else:

Diff for: colour_object_tracking.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def nothing(x):
103103
try:
104104
# to use a non-buffered camera stream (via a separate thread)
105105

106-
if not(args.video_file):
106+
if not (args.video_file):
107107
import camera_stream
108108
cap = camera_stream.CameraVideoStream(use_tapi=False)
109109
else:

Diff for: contrast_stretching.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def hist_lines(hist):
7474
try:
7575
# to use a non-buffered camera stream (via a separate thread)
7676

77-
if not(args.video_file):
77+
if not (args.video_file):
7878
import camera_stream
7979
cap = camera_stream.CameraVideoStream(use_tapi=False)
8080
else:

Diff for: correlation_template_matching.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def on_mouse(event, x, y, flags, params):
9393
try:
9494
# to use a non-buffered camera stream (via a separate thread)
9595

96-
if not(args.video_file):
96+
if not (args.video_file):
9797
import camera_stream
9898
cap = camera_stream.CameraVideoStream(use_tapi=False)
9999
else:

Diff for: dct_low_pass_filter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def nothing(x):
9090
try:
9191
# to use a non-buffered camera stream (via a separate thread)
9292

93-
if not(args.video_file):
93+
if not (args.video_file):
9494
import camera_stream
9595
cap = camera_stream.CameraVideoStream(use_tapi=False)
9696
else:

Diff for: exponential.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def exponential_transform(image, c, alpha):
8080
try:
8181
# to use a non-buffered camera stream (via a separate thread)
8282

83-
if not(args.video_file):
83+
if not (args.video_file):
8484
import camera_stream
8585
cap = camera_stream.CameraVideoStream(use_tapi=False)
8686
else:

Diff for: fourier.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
try:
6363
# to use a non-buffered camera stream (via a separate thread)
6464

65-
if not(args.video_file):
65+
if not (args.video_file):
6666
import camera_stream
6767
cap = camera_stream.CameraVideoStream(use_tapi=False)
6868
else:

Diff for: gamma.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def powerlaw_transform(image, gamma):
8383
try:
8484
# to use a non-buffered camera stream (via a separate thread)
8585

86-
if not(args.video_file):
86+
if not (args.video_file):
8787
import camera_stream
8888
cap = camera_stream.CameraVideoStream(use_tapi=False)
8989
else:

Diff for: high_pass_filter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def nothing(x):
8383
try:
8484
# to use a non-buffered camera stream (via a separate thread)
8585

86-
if not(args.video_file):
86+
if not (args.video_file):
8787
import camera_stream
8888
cap = camera_stream.CameraVideoStream(use_tapi=False)
8989
else:

Diff for: histogram.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def hist_lines(hist):
8585
try:
8686
# to use a non-buffered camera stream (via a separate thread)
8787

88-
if not(args.video_file):
88+
if not (args.video_file):
8989
import camera_stream
9090
cap = camera_stream.CameraVideoStream(use_tapi=False)
9191
else:

Diff for: histogram_equalize.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def hist_lines(hist):
7474
try:
7575
# to use a non-buffered camera stream (via a separate thread)
7676

77-
if not(args.video_file):
77+
if not (args.video_file):
7878
import camera_stream
7979
cap = camera_stream.CameraVideoStream(use_tapi=False)
8080
else:

Diff for: hsv_viewer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
try:
6060
# to use a non-buffered camera stream (via a separate thread)
6161

62-
if not(args.video_file):
62+
if not (args.video_file):
6363
import camera_stream
6464
cap = camera_stream.CameraVideoStream(use_tapi=False)
6565
else:
@@ -168,7 +168,7 @@
168168
if (key == ord('x')):
169169
keep_processing = False
170170
elif (key == ord('c')):
171-
colour_map_hue = not(colour_map_hue)
171+
colour_map_hue = not (colour_map_hue)
172172

173173
# close all windows
174174

Diff for: jpeg_compression_noise.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def nothing(x):
6666
try:
6767
# to use a non-buffered camera stream (via a separate thread)
6868

69-
if not(args.video_file):
69+
if not (args.video_file):
7070
import camera_stream
7171
cap = camera_stream.CameraVideoStream(use_tapi=False)
7272
else:

Diff for: logarithmic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def logarithmic_transform(image, c, sigma):
8383
try:
8484
# to use a non-buffered camera stream (via a separate thread)
8585

86-
if not(args.video_file):
86+
if not (args.video_file):
8787
import camera_stream
8888
cap = camera_stream.CameraVideoStream(use_tapi=False)
8989
else:

Diff for: low_pass_filter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def nothing(x):
8484
try:
8585
# to use a non-buffered camera stream (via a separate thread)
8686

87-
if not(args.video_file):
87+
if not (args.video_file):
8888
import camera_stream
8989
cap = camera_stream.CameraVideoStream(use_tapi=False)
9090
else:

Diff for: mean_filter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def nothing(x):
6262
try:
6363
# to use a non-buffered camera stream (via a separate thread)
6464

65-
if not(args.video_file):
65+
if not (args.video_file):
6666
import camera_stream
6767
cap = camera_stream.CameraVideoStream(use_tapi=False)
6868
else:

Diff for: median_filter.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def nothing(x):
6262
try:
6363
# to use a non-buffered camera stream (via a separate thread)
6464

65-
if not(args.video_file):
65+
if not (args.video_file):
6666
import camera_stream
6767
cap = camera_stream.CameraVideoStream(use_tapi=False)
6868
else:
@@ -126,7 +126,7 @@ def nothing(x):
126126
# check it is greater than 3 and odd
127127

128128
neighbourhood = max(3, neighbourhood)
129-
if not(neighbourhood % 2):
129+
if not (neighbourhood % 2):
130130
neighbourhood = neighbourhood + 1
131131

132132
# perform median filtering using NxN neighbourhood

Diff for: nlm_filter.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def nothing(x):
6363
try:
6464
# to use a non-buffered camera stream (via a separate thread)
6565

66-
if not(args.video_file):
66+
if not (args.video_file):
6767
import camera_stream
6868
cap = camera_stream.CameraVideoStream(use_tapi=False)
6969
else:
@@ -141,7 +141,7 @@ def nothing(x):
141141
# check neighbourhood is greater than 3 and odd
142142

143143
neighbourhood = max(3, neighbourhood)
144-
if not(neighbourhood % 2):
144+
if not (neighbourhood % 2):
145145
neighbourhood = neighbourhood + 1
146146

147147
# in opencv blur() performs filtering with a NxN kernel where each

Diff for: rgb_viewer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
try:
5656
# to use a non-buffered camera stream (via a separate thread)
5757

58-
if not(args.video_file):
58+
if not (args.video_file):
5959
import camera_stream
6060
cap = camera_stream.CameraVideoStream(use_tapi=False)
6161
else:

Diff for: save_image.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323
if img is not None:
2424

25-
# performing logical inversion (see manual entry for bitwise_not()
25+
# performing logical inversion (see manual entry for bitwise_not ()
2626

27-
inverted = cv2.bitwise_not(img)
27+
inverted = cv2.bitwise_not (img)
2828

2929
# write inverted image to file
3030

Diff for: skeleton.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
try:
5555
# to use a non-buffered camera stream (via a separate thread)
5656

57-
if not(args.video_file):
57+
if not (args.video_file):
5858
import camera_stream
5959
cap = camera_stream.CameraVideoStream(use_tapi=False)
6060
else:

Diff for: ycrcb_viewer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
try:
5858
# to use a non-buffered camera stream (via a separate thread)
5959

60-
if not(args.video_file):
60+
if not (args.video_file):
6161
import camera_stream
6262
cap = camera_stream.CameraVideoStream(use_tapi=False)
6363
else:
@@ -176,7 +176,7 @@
176176
if (key == ord('x')):
177177
keep_processing = False
178178
elif (key == ord('s')):
179-
perform_chroma_subsampling = not(perform_chroma_subsampling)
179+
perform_chroma_subsampling = not (perform_chroma_subsampling)
180180

181181
# close all windows
182182

0 commit comments

Comments
 (0)