Go to advanced search

by 111Muhammad
Sun Apr 21, 2019 6:45 pm
Forum: Python
Topic: openCV2 putText for certain time only
Replies: 1
Views: 116

openCV2 putText for certain time only

hi guys, cv2.putText(frame, "display for 3 seconds ?", (10, 100), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2) i want to display the above code for 3 seconds only and then remove the displayed text after 3 seconds exactly . pls does anyone have an idea on how i can implement it? i tried using time...
by 111Muhammad
Fri Apr 12, 2019 10:20 am
Forum: Troubleshooting
Topic: urllib.error.URLError
Replies: 5
Views: 141

Re: urllib.error.URLError

previously been able to access Internet sites
Im using an SSH Connection: Pi-Mac
other devices can access the internet
i can even browse on the pi browser
it was working for some time....but then it stopped
thanks
by 111Muhammad
Fri Apr 12, 2019 8:24 am
Forum: Troubleshooting
Topic: urllib.error.URLError
Replies: 5
Views: 141

Re: urllib.error.URLError

i cant ping 8.8.8.8
error message:

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 169.254.47.70 icmp_seq=1 Destination Host Unreachable

sudo nano /etc/resolv.conf contents:

# Generated by resolvconf
nameserver 192.168.1.1
nameserver fe80::1%wlan0
nameserver 8.8.8.8
nameserver 8.8.8.8
by 111Muhammad
Fri Apr 12, 2019 1:40 am
Forum: Troubleshooting
Topic: urllib.error.URLError
Replies: 5
Views: 141

urllib.error.URLError

im getting this error when i try to open a website from a code in my pi

urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>

pls how can i fix this?

i googled. but nothing useful came
by 111Muhammad
Wed Apr 03, 2019 6:38 pm
Forum: Troubleshooting
Topic: raspberry pi 3b+ boot error
Replies: 0
Views: 87

raspberry pi 3b+ boot error

hi guys, i modified swap file size, boot options, and memory split in my raspberry pi to install dlib faster here are the modifications 1. Increased the swap file size to 1024. 2. Switched the boot option to autologin (B2). 3. Updated the GPU/RAM split to 16MB (intially 64MB. my problem is: i tried ...
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: 1541

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: 1541

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: 1541

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: 1541

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: 1541

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: 140

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: 151

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: 1330

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: 1330

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: 1330

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: 1330

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: 1330

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: 1330

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: 1330

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: 1330

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: 1330

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: 1330

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: 1330

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: 1330

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

Go to advanced search