From b9cade32e839b8846f1f917555c847a3fb18bd14 Mon Sep 17 00:00:00 2001 From: Sanjiv01 Date: Wed, 4 Aug 2021 12:20:44 +0530 Subject: [PATCH] fixed issue #16 --- app/__pycache__/__init__.cpython-37.pyc | Bin 234 -> 255 bytes app/__pycache__/effects.cpython-37.pyc | Bin 3095 -> 3859 bytes app/__pycache__/routes.cpython-37.pyc | Bin 968 -> 2852 bytes app/effects.py | 7 +++---- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/__pycache__/__init__.cpython-37.pyc b/app/__pycache__/__init__.cpython-37.pyc index 3902cd6e2c518c2087b9b975409a00c549b8740c..d576318f7c4955ada97979a6d4eb36adc5322e9a 100644 GIT binary patch delta 76 zcmaFG_@9y2iI0ceaWNElw>ejtNf8%gQW^aY-%CF3B&5@h?ct eQwYv4ElN&}Dagn#$yZ2COG`~IDJhw_%>)3R5*n@m delta 55 zcmey*_==I&iIej)`;(_6Ut}NiEJU$uEdW&n(F( JO`3Sx1OUIe5?%CL9n4)V21_yqPy|=Kc1~d(W%cY+8cn z#>Z*rml;X=6`8X~gU$-P;k!VnL}g#HC92pmRc+XohB? zP0<{khBi%S=q$8TbdJtLo1qKz3ba|8r&poP(Q9y~>+uxZ* zA@IQ#EiJ(tE&z$7o=oLPYAB~lM?QO2tjG zR(Y`TB-Rgbq9Dgw$o!pG61QO0pXJhL)kh)YVYTA48s0&5jfHzr(5`N@S?hKs*yk>* zws(UlxIH*)6b)E1V5?5MT}`Z5Y9GfIAzsUi2ub0g5m!k*Sr{>M=}chEOcWGm=AhG& z8er%t*e?u}%LRoSFdmzn`OFDfLFV`gg#`nGyTv9Ul=*~YfH~WGetc^&KipXd!6Cr! z19P@>Rq4uIB~p4Sl{)}7@M>4_XAu!X)37>3`z1Li&&VfNMok(@ zjTwa-3OF~RGig*q?P(qGZmOKBXk-a)6*1lpd?)gPR)SDkAjGpEF95QQBjHW~noH8RX zB8=BYVH_2{7|9h-@j8+TavIENh$NL0I9U@o@#`qC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wG)((TSXf z3Z$(WH8?XeMG(znn?oI(NRgVr%u-v)de+s_SZ|WZ(W_+YBWXkiYT?@{tqbFAzQND8 zi7h8crC=ywCsAF z41L4;78#;kSly^bP^; zkl7{kUj%5J2B>_fVx{ll7-jl9Mf%skl_B2_m5OoU7u(JUHw4%#3Qz{GjtHlLKDid* zqc@9C2Ct3?5=Ig?dV_}|?m(ZsS%flpWkhI%fi_A_agV)!Lx9p=a1C4;^6Rt*V)gscJFmVTL1Gr_Ae;w&C)>M`3Lo9X|4bO diff --git a/app/__pycache__/routes.cpython-37.pyc b/app/__pycache__/routes.cpython-37.pyc index 524f31b3cfa7148c943c292af99d7351562c8300..363f0199c4529515665638c031102a0327297e52 100644 GIT binary patch literal 2852 zcmc&$OK;mo5ZWNX z6BpBK34}*55{ok?nBYDOSdVd(4W9=_&j<>=0<8=FQc&y_Ig{*VNi1D)x)-mwD2eh5 zcF8Y!uPjWl{DSpNvRPoOh$`B8%cQA+W<{)$#u9b02EG-tG{CYhHpo&X%_eBJM3Xc% zu`Or{!Wf6CMZSBdI`D0-3Sj+%sWRMXdiCwWe*ecr zs-%D9hEKg`{l_vn(^1_2E|y{IC>p7O?8m2(j#?8GT2GeFWZ4J&eHD$gO!nf7agm~x z5C|e-1+@(G0LZ5cbvO`u(t_!H=Q(@HuGp_!@aMbwG4Iphl^P5x4gg|%FfeR4r^A;O0e2cu%R4=QakhvWVf6pa9kwK_4XBJ zYg`!0unIzgxEVLNX((K$mCiFy$jCX7Qp{u<15vgcAZVt!HZGwE1sBF|2BA*vVB~8r zc9rg&w*&87infx#?LdCsI*vx6aMi_^6M%ed23{aFY{@Ptd^d$xMU?)fY9bL}>lzjU zn55cJDqxC5sd?vz2tLQ`2CUOsC+{+ovj3A_ zjJ=RvwGP%UqRptqb-FTx^bNn+wfydGqIg`(dv`y}A=m`@9gw|s42R&EbWOw1X9U4f0GM-3*1Tv~J0@KeyQ0EgrRe;{BbClQMc*rah6=v~MVuiO3iqopZmy?L mccI2&ei1}sg|k&mXmM&$aZIFR zut#W&OKNd;Nq#|0dS*#RY0~76j7p5GlSP>N7^5aHW>S{n2AWmO1~QS6iIIb;2*j^q z(=W?RNzI>pkR@iaGqVsQ_hfBWSqUz%V0>C?YKkC87ZXSqQxWgvZssImQ6v#QAlpxq tdvY3=DL2TxB3=-|H`#zyV)6$rPH{$%T96_hMgc}1CJsgsRt`2H7635ZE~x+j diff --git a/app/effects.py b/app/effects.py index d4ae88d..c5b6569 100644 --- a/app/effects.py +++ b/app/effects.py @@ -7,7 +7,7 @@ class effects_lib (object): ds_factor = 0.8 def __init__(self): - self.video = cv2.VideoCapture(0) + self.video = cv2.VideoCapture(0,cv2.CAP_DSHOW) # added second parameter to resolve the terminating async callback warning def __del__(self): self.video.release() @@ -55,8 +55,8 @@ def warming_effect(self): def edge_detection(self): frame_status, frame = self.video.read() #modify frame here - - + frame = cv2.Canny(frame,100,200) + 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 +112,3 @@ 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() -