From 2021862cf34e8eb8caaa40a80800d835269236d4 Mon Sep 17 00:00:00 2001 From: Amanem00 <72438328+amanem1@users.noreply.github.com> Date: Thu, 29 Apr 2021 10:49:15 -0700 Subject: [PATCH 1/2] Update effects.py --- app/effects.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/effects.py b/app/effects.py index d4ae88d..28230e2 100644 --- a/app/effects.py +++ b/app/effects.py @@ -54,9 +54,14 @@ def warming_effect(self): def edge_detection(self): frame_status, frame = self.video.read() - #modify frame here - - + gray=cv2.cvtColor(frame,cv2_COLOR_BGR2GRAY) + blur=cv2.gaussianBlur(gray,(5,5),0) + edges=cv2.Canny(blur,100,200) + cv2.imshow(img,edges) + if cv2.waitKey(1) ==ord(1): + break + cv2.destroyAllWindows() + frame = cv2.resize(frame,None, fx = self.ds_factor, fy = self.ds_factor, interpolation = cv2.INTER_AREA) ret, jpeg = cv2.imencode(".jpg", frame) return jpeg.tobytes() @@ -112,4 +117,4 @@ def black_and_white_sketch(self): frame = cv2.resize(frame,None, fx = self.ds_factor, fy = self.ds_factor, interpolation = cv2.INTER_AREA) ret, jpeg = cv2.imencode(".jpg", frame) return jpeg.tobytes() - + From 5d85491c0e32c86edbf2959535ec4013a0429bb7 Mon Sep 17 00:00:00 2001 From: Amanem00 <72438328+amanem1@users.noreply.github.com> Date: Thu, 29 Apr 2021 10:56:45 -0700 Subject: [PATCH 2/2] Update effects.py --- app/effects.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/effects.py b/app/effects.py index 28230e2..03badba 100644 --- a/app/effects.py +++ b/app/effects.py @@ -54,14 +54,12 @@ def warming_effect(self): def edge_detection(self): frame_status, frame = self.video.read() - gray=cv2.cvtColor(frame,cv2_COLOR_BGR2GRAY) - blur=cv2.gaussianBlur(gray,(5,5),0) + blur=cv2.gaussianBlur(frame,(5,5),0) edges=cv2.Canny(blur,100,200) - cv2.imshow(img,edges) - if cv2.waitKey(1) ==ord(1): - break - cv2.destroyAllWindows() - + cv2.imshow("canny detection",edges) + + + frame = cv2.resize(frame,None, fx = self.ds_factor, fy = self.ds_factor, interpolation = cv2.INTER_AREA) ret, jpeg = cv2.imencode(".jpg", frame) return jpeg.tobytes()