Go to advanced search

by 111Muhammad
Fri Feb 22, 2019 3:55 pm
Forum: Graphics programming
Topic: OpenCV: printing live time countdown on a video display
Replies: 6
Views: 112

Re: OpenCV: printing live time countdown on a video display

I tried
cv2.putText(frame, "Duration: " + time_left + "\r", end=""), (10, 50),cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2)
but its giving an error:

end of statement expected
at ,2)
by 111Muhammad
Fri Feb 22, 2019 3:13 pm
Forum: Graphics programming
Topic: OpenCV: printing live time countdown on a video display
Replies: 6
Views: 112

Re: OpenCV: printing live time countdown on a video display

thanks gordon
I am getting this error
cv2.putText(img,time_left, (10, 100), cv2.FONT_HERSHEY_SIMPLEX, 0.4, (0, 0, 255))
NameError: global name 'img' is not defined

I even tried
from PIL import Image
import PIL.Image
import Image

but sill getting the error
by 111Muhammad
Fri Feb 22, 2019 3:10 pm
Forum: Graphics programming
Topic: OpenCV: printing live time countdown on a video display
Replies: 6
Views: 112

Re: OpenCV: printing live time countdown on a video display

the real python code is: import time stop = 0 start = 3 while stop <= start: m, s = divmod(start, 60) time_left = str(s).zfill(2) #I have syntax problem here, in the line below print(time_left + "\r", end="") time.sleep(1) start -= 1 if stop == start: print("Emergency alert") break I want to transla...
by 111Muhammad
Fri Feb 22, 2019 2:49 pm
Forum: Graphics programming
Topic: OpenCV: printing live time countdown on a video display
Replies: 6
Views: 112

Re: OpenCV: printing live time countdown on a video display

I decided to use multithreading
can u pls help translate this into OpenCV? using putText
python code: print(time_left + "\r", end="")
I am having problem with the syntax.
thanks gordon
by 111Muhammad
Mon Feb 11, 2019 3:24 pm
Forum: Graphics programming
Topic: OpenCV: printing live time countdown on a video display
Replies: 6
Views: 112

OpenCV: printing live time countdown on a video display

hi guys, my code is here in python: def count_time(): stop = 10 start = 0 while stop != start: m, s = divmod(start, 60) time_left = str(s).zfill(2) #im new to OpenCV syntax cv2.putText(frame, "Duration: ".format(time_left + "\r", end=""), (10, 50), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2) time...
by 111Muhammad
Tue Feb 05, 2019 2:36 pm
Forum: Python
Topic: Gtk-WARNING **
Replies: 0
Views: 81

Gtk-WARNING **

hi all, pls I am having problem with this error. (process:1463): Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale. Unable to init server: Could not connect: Connection refused (Consciousness Detection:1463): Gtk-WARNING **: cannot open display: localhost:10.0 connecti...
by 111Muhammad
Fri Feb 01, 2019 7:13 pm
Forum: Python
Topic: User input from a gui form
Replies: 1
Views: 104

User input from a gui form

Hi guys, i am working on a program that should allow users to set an emergency contact number from a gui on rasbperry pi code while execution? Pls is that possible? If yes, any idea?
Thanks guys
by 111Muhammad
Thu Jan 31, 2019 6:54 pm
Forum: Python
Topic: Time counter
Replies: 26
Views: 856

Re: Time counter

another error:

> haarcascade_eye.xml
[INFO] starting video stream thread...
^CTraceback (most recent call last):
File "merger.py", line 49, in <module>
if time.time() - ttrat > 3 and ttrat > 0:
by 111Muhammad
Thu Jan 31, 2019 6:44 pm
Forum: Python
Topic: Time counter
Replies: 26
Views: 856

Re: Time counter

pi@raspberrypi:~/pi-drowsiness-detection $ python merger.py --cascade haarcascade_frontalface_default.xml \ > haarcascade_eye.xml [INFO] starting video stream thread... ^CTraceback (most recent call last): File "merger.py", line 48, in <module> img = vs.read() there is a problem with opening the cam...
by 111Muhammad
Thu Jan 31, 2019 5:54 pm
Forum: Python
Topic: Time counter
Replies: 26
Views: 856

Re: Time counter

I'm getting this error sir, pi@raspberrypi:~/pi-drowsiness-detection $ python merger.py --cascade haarcascade_frontalface_default.xml haarcascade_eye.xml \ > haarcascade_eye.xml File "merger.py", line 17 os.system (path) ^ IndentationError: unexpected indent *****************************************...
by 111Muhammad
Thu Jan 31, 2019 4:15 pm
Forum: Python
Topic: Time counter
Replies: 26
Views: 856

Re: Time counter

this looks amazing gordon. but I think there is a small misunderstanding. I am using video input from camera, not image. as the video is been streamed this features (earlier mentioned) are calculated.
by 111Muhammad
Wed Jan 30, 2019 6:42 am
Forum: Python
Topic: Time counter
Replies: 26
Views: 856

Re: Time counter

Im using Python 3.
I have the eye.xml file but still not working. Did u run the code? I mean did u get the sample output? Actually i need the concept of keeping track of the time only. Something like https://youtu.be/OaPsl84ecrg
Thanks for the help Gordon
by 111Muhammad
Tue Jan 29, 2019 5:11 pm
Forum: Python
Topic: Time counter
Replies: 26
Views: 856

Re: Time counter

the frame is not exiting even when I right click on the image. I have to force quit the window. the EAR is not calculated in the new code. when I run it only the blue rectangle displays and nothing happens. thanks Gordon
by 111Muhammad
Mon Jan 28, 2019 4:00 pm
Forum: Python
Topic: Time counter
Replies: 26
Views: 856

Re: Time counter

Hi gordon thanks for the help. With due respect gordon, Pls is there any way i can contact u?
by 111Muhammad
Sun Jan 27, 2019 7:23 pm
Forum: Python
Topic: Time counter
Replies: 26
Views: 856

Re: Time counter

im getting this error gordon.. pi@raspberrypi:~/pi-drowsiness-detection $ python alternative1.py --cascade haarcascade_frontalface_default.xml \ > OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /home/pi/opencv-3.3.0/modules/objdetect/src/cascadedetect.cpp, line 1698 Traceback (m...
by 111Muhammad
Sat Jan 26, 2019 10:34 am
Forum: Python
Topic: Time counter
Replies: 26
Views: 856

Re: Time counter

Thanks gordon..: ill try it and let you know
by 111Muhammad
Thu Jan 24, 2019 5:38 pm
Forum: Python
Topic: Time counter
Replies: 26
Views: 856

Re: Time counter

here is the full code # import the necessary packages from imutils.video import VideoStream from imutils import face_utils import numpy as np import argparse import imutils import time import dlib import cv2 def euclidean_dist(ptA, ptB): # compute and return the euclidean distance between the two # ...
by 111Muhammad
Thu Jan 24, 2019 5:05 pm
Forum: Python
Topic: Time counter
Replies: 26
Views: 856

Re: Time counter

its a project I'm doing. I have an OpenCV code working. it scans the face and focuses one the eye balls. the only thing I missed is counting the time the eyeballs are closed while been tracked. the time is what triggers other events in the program. so the help I need is just how to count. part of th...
by 111Muhammad
Wed Jan 23, 2019 2:58 am
Forum: Python
Topic: Time counter
Replies: 26
Views: 856

Time counter

hi everyone,
Im making a feature in my project using python and openCV using pi camera.
this feature is to count for how many seconds and/or milliseconds have the eyes been closed. once the eyes are opened, the timer counter should reset to zero. I need urgent help pls

thanks in advance
by 111Muhammad
Thu Oct 11, 2018 4:38 pm
Forum: Java
Topic: Database selection
Replies: 13
Views: 12700

Re: Database selection

Hi guys......Im doing a project related to capturing and storing videos using raspberry pi (coded in python). i want to save these captured videos on a database. which database do you recommend for me?

Go to advanced search