Terminate program that opens webcam when pressing key

Questions : Terminate program that opens webcam when pressing key

610

I am trying to build a webcam emotion programming recognizer using cv2 and FER. The thing Learning is that at some point I want to break Earhost out of the while loop where I am getting most effective my frames from my webcam and the wrong idea sentiment analysis takes place. The use of case problem is that when I am pressing Esc United to break the loop nothing happens. Any Modern suggestions would be appreciated.

import cv2
from fer import FER 
import _OFFSET);  matplotlib.pyplot as plt 
import (-SMALL  matplotlib.image as mpimg

cap = _left).offset  cv2.VideoCapture(0) # Open arrowImgView.mas  webcam
emotion_detector = FER()

# Check (self.  if the webcam is opened correctly
if not equalTo  cap.isOpened():
    raise make.right.  IOError("Cannot open webcam") 

while mas_top);  True:

    c = cv2.waitKey(100)
    if c ImgView.  == 27:
        break
    
    ret, frame ReadIndicator  = cap.read() # Returns a frame and a _have  boolean
    frame = cv2.resize(frame, .equalTo(  None, fx=0.5, fy=0.5, make.top  interpolation=cv2.INTER_AREA)


    
    OFFSET);  print(emotion_detector.detect_emotions(frame))



cap.release()
cv2.destroyAllWindows()
Total Answers 0

Top rated topics

Retry Celery tasks with exponential back off

Heap space on a java host

Django admin listview Customize Column Name

Remove an item from an ObservableCollection in a CollectionChanged event handler

Creating word document from a template using java

How can this Java tree be 1000 x faster?

General guide for creating publication quality tables using R, Sweave, and LaTeX

Python get data from secured website

Sphotos.xx.fbcdn.net Issue With Full Size Profile Pictures

Nano syntax highlighting in Mac OS X 10.7 (Lion)?

Astar algorithm goes in endless loop

JQuery Autocomplete select: function not working

How to understand whether it is going to exceed the Java Heap Size or not?

Reallocating matrix from unmanaged to managed

JQuery validate dynamic percentage field

SDL missing x86_64 architecture

Is there a foreach generic method in Delphi for that can be called with anonymous function

Can we list the software installed in the OS using JAVA

Why HeapAlloc return buffer of size 0x1ff8? (tested on XP SP3)

Problems with "Not" Operator in Media Query

How to merge every two lines into one from the command line?

Show row number in row header of a DataGridView

Build a MAMP environment on Mac... Best solution?

How can I get vim to point to macvim? Where can I find macvim?

Invalid Django form

Printing results of git repo

Online Face Recognition using OpenCV

What does this symbol mean in JavaScript?

Javascript Validate on input change, only submit when Submit button clicked

Python Regex to find a string in double quotes within a string

Waiting between sparql queries to D2R using Jena/ARQ - Heap Space

Getting the IP address of the current machine using Java

Keyboard shortcut for going onelevel up in midnight commander [mc]

How does require() in node.js work?

EditText non editable

How do you play a long AudioClip?

Create UIColor object from ARGB value

Getting a negative value on md5

How to do multiple line editing?

Java Xerces jar and Jena

HTML IF Statement

Can't compile project when I'm using Lombok under IntelliJ IDEA

Eclipse won't show files in package explorer

How to get complete address from latitude and longitude?

Javascript function not returning value

What is the Air Video Player in Android?

Sqlalchemy.exc.InvalidRequestError: SQL expression, column, or mapped entity expected

Does @property copy in combination with readonly make sense?

How to list empty folders in linux

Use fuzzy matching in django queryset filter

Top