Ask Your Question

Shaba1's profile - activity

2015-01-23 19:39:19 -0600 commented answer Blue square not showing oh screen

YES!!!! Finally something works :) I do not understand HOW it works or what it is doing but that is a goal for further study. Thanks you very much all those who took the time to answer.

2015-01-23 11:38:56 -0600 received badge  Enthusiast
2015-01-20 22:13:51 -0600 received badge  Editor (source)
2015-01-20 21:12:01 -0600 answered a question Blue square not showing oh screen

Here is the code that Ityped in from the tutorial that I linked to in my original message. I did not think to post the code since the code is displayed in the video as long as its onscreen

#-------------------------------------------------------------------------------

Name: OpenCV Example of Face Detection from Youtube demo

Purpose:

#

Author: DD

#

Created: 12/01/2015

Copyright: (c) DD 2015

Licence: <your licence="">

-------------------------------------------------------------------------------

Facebook.com/RaspberryVi

import numpy as np import cv2

some comment in a foreign language which I cannot understand. I will put it

thru Altavista later

face_cascade = cv2.CascadeClassifier('haarscascade_frontalface_default.xml')

video_capture = cv2.VideoCapture(0)

while True: ret, frame = video_capture.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) #My failed attempt at usig this code to capture test with image. #img = cv2.imread("wyld2.jpg") # gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

faces = face_cascade.detectMultiScale(gray,1.3,5)
for(x,y,w,h) in faces:
    cv2.rectangle(frame,(x,y),(x+w,y+h),(255,0,0),2)




cv2.imshow('video', frame)
#some more foreign comments
if cv2.waitKey(1) & 0xFF == ord('q'):
    break

video_capture.release() cv2.destroyAllWindows()

def main(): pass

if __name__ == '__main__': main()

2015-01-18 23:15:51 -0600 asked a question Blue square not showing oh screen

Hello folk. I just started using opencv--python.

Intially I typed in some code found here.

link text

But when I typed in the code to my windows 7 64 bit computer and ran it. After a few syntax errors and typos on my part it ran just fine. I dectected the web camera that I have plugged in and it displayed the cameras video in a window. But I do not get that blue square that says it has detected my face. I am using a celron 2200 mhz with 2gb of ram so its not the fastest computer . Is it just that my computer is slow or is there something wrong with the code?

Ok here is the code. It was in the youtube video on the link that I posted,

import numpy as np
import cv2

#some comment i a foreign language which I cannot understand. I will put it
#thru Altavista later
face_cascade = cv2.CascadeClassifier('haarscascade_frontalface_default.xml')

video_capture = cv2.VideoCapture(0)

while True:
    ret, frame = video_capture.read()
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    #capture test with image.
    #img = cv2.imread("wyld2.jpg")
   # gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)  

    faces = face_cascade.detectMultiScale(gray,1.3,5)
    for(x,y,w,h) in faces:
        cv2.rectangle(frame,(x,y),(x+w,y+h),(255,0,0),2)  

    cv2.imshow('video', frame)
    #some more foreign comments
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
video_capture.release()
cv2.destroyAllWindows()