Skip to content

Commit a39f167

Browse files
Removing additional processing from deep learning detection
1 parent 6f0ed8a commit a39f167

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

detection/deeplearning.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,8 @@ def detect(
149149
)
150150
calc.frame_up()
151151

152-
# Additional Processing: Apply special filter (sharpen)
153-
kernel = np.array([[0, -1, 0], [-1, 5, -1], [0, -1, 0]], dtype=np.float32)
154-
processed = cv2.filter2D(image, -1, kernel)
155-
156152
# Convert the image as required by the TFLite model.
157-
rgb_image = cv2.cvtColor(processed, cv2.COLOR_BGR2RGB)
153+
rgb_image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
158154

159155
# Create a TensorImage object from the RGB image.
160156
input_tensor = vision.TensorImage.create_from_array(rgb_image)
@@ -398,7 +394,6 @@ def capture(self, true_label: str, all_images: bool, vid_filename: str):
398394
)
399395

400396
calc.frame_up()
401-
image = cv2.flip(image, 1)
402397

403398
# Convert the image as required by the TFLite model.
404399
rgb_image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

0 commit comments

Comments
 (0)