Ask Your Question

Philia's profile - activity

2019-11-05 06:40:15 -0600 received badge  Popular Question (source)
2018-07-24 13:43:21 -0600 commented question Choosing which image to take as input with a dialogue box.

uni_code=easygui.fileopenbox() img_path = unicodedata.normalize('NFKD',uni_code).encode('ascii','ignore') img = cv2.im

2018-07-24 13:42:43 -0600 commented question Choosing which image to take as input with a dialogue box.

uni_code=easygui.fileopenbox() img_path = unicodedata.normalize('NFKD',uni_code).encode('ascii','ignore') img =

2018-07-24 13:42:35 -0600 commented question Choosing which image to take as input with a dialogue box.

uni_code=easygui.fileopenbox() img_path = unicodedata.normalize('NFKD',uni_code).encode('ascii','ignore') img = cv2.imre

2018-07-24 13:42:06 -0600 commented question Choosing which image to take as input with a dialogue box.

uni_code=easygui.fileopenbox() img_path = unicodedata.normalize('NFKD',uni_code).encode('ascii','ignore')

2018-07-24 13:41:52 -0600 commented question Choosing which image to take as input with a dialogue box.

uni_code=easygui.fileopenbox() img_path = unicodedata.normalize('NFKD',uni_code).encode('ascii','ignore')

2018-07-24 13:41:03 -0600 commented question Choosing which image to take as input with a dialogue box.

uni_code=easygui.fileopenbox() img_path = unicodedata.normalize('NFKD',uni_code).encode('ascii','ignore')

2018-07-18 12:47:32 -0600 received badge  Editor (source)
2018-07-18 12:47:32 -0600 edited question Choosing which image to take as input with a dialogue box.

Choosing which image to take as input with a dialogue box. So, I am trying to browse through a directory and choose whic

2018-07-18 12:47:08 -0600 asked a question Choosing which image to take as input with a dialogue box.

Choosing which image to take as input with a dialogue box. So, I am trying to browse through a directory and choose whic

2018-05-22 05:48:51 -0600 asked a question Shift Rectangle up using Python?

Shift Rectangle up using Python? Here's what I'm using to draw the rectangle cv2.rectangle(img,(x,y), (x+w,y+h),(0

2018-05-19 05:07:32 -0600 commented answer View webcam feed before it takes a snap?

I tried your code...and it keeps taking images....But I want it to stop after taking one image. It should take a snap if

2018-05-18 13:38:22 -0600 asked a question View webcam feed before it takes a snap?

View webcam feed before it takes a snap? So my code should detect an object with opencv and once it detects it it should

2018-04-17 09:06:20 -0600 commented answer Take a snapshot with the webcam in python?

It somewhat worked.....but it keeps taking snaps. I want it to take one picture and stop. Also it doesn't show me the we

2018-04-17 09:01:28 -0600 received badge  Enthusiast
2018-04-17 07:32:23 -0600 marked best answer Take a snapshot with the webcam in python?

So I am trying a write a program to detect objects using openCV libraries using Python.

The code to detect object is somewhat satisfactory. When I run the code, it opens the webcam and when the object the system has been trained to detect is visible with the cam it detects it and draws a rectangle and writes what the object is. So far so good. However I want the program to take a snap for the first time it detects something. And close the webcam and shows the pic instead. Here's the code I have written so far:

import cv2
import numpy as np


cascade1 = cv2.CascadeClassifier('xcascade.xml')
cascade2 = cv2.CascadeClassifier('ycascade.xml')

def TakeSnapAndSave():
    cap = cv2.VideoCapture(0)

    num = 0
    while num<1000:
        ret, img = cap.read()
        gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)

        object1 = xcascade.detectMultiScale(gray, 10, 10)
        for(x,y,w,h) in object1:
            font = cv2.FONT_HERSHEY_SIMPLEX
            cv2.rectangle(img,(x,y), (x+w,y+h),(255,255,0),5)
            cv2.putText(img, 'Something',(x,y-40), font, 1.5, (255,255,0),5, cv2.LINE_AA)
            object2 = ycascade.detectMultiScale(gray, 15, 15)
            for(x,y,w,h) in object2:
                font = cv2.FONT_HERSHEY_SIMPLEX
                cv2.rectangle(img,(x,y), (x+w,y+h),(0,255,255),5)
                cv2.putText(img, 'Something Else',(x+100,y+80), font, 0.8, (0,0,255),2, cv2.LINE_AA)        


        cv2.imwrite('opencv'+str(num)+'.jpg',img)
        num = num+1
    cap.release()
    cv2.destroyAllWindows()

The code keeps taking snapshots without doing any detection.....

2018-04-16 12:26:13 -0600 commented question Take a snapshot with the webcam in python?

Because I am a noob....thanks....I will try it out, when I get back to my PC

2018-04-16 11:16:27 -0600 asked a question Take a snapshot with the webcam in python?

Take a snapshot with the webcam in python? So I am trying a write a program to detect objects using openCV libraries usi

2018-04-04 12:29:27 -0600 commented question Detecting Brain Tumor?

Should I try tensorflow object detection?

2018-04-04 10:36:47 -0600 commented question Detecting Brain Tumor?

Is it that hopeless?

2018-04-04 09:27:44 -0600 commented question Detecting Brain Tumor?

Well mister I need to do it for a project. If it is somewhat decent it would still do. It doesn't have to be super accur

2018-04-03 22:56:57 -0600 commented question Detecting Brain Tumor?

Why not ?

2018-04-03 12:46:40 -0600 asked a question Detecting Brain Tumor?

Detecting Brain Tumor? Hey there guys. Newbie here. I am trying to train a haar cascade file to detect tumors. Here