Ask Your Question

shideh's profile - activity

2020-05-21 07:31:25 -0600 received badge  Notable Question (source)
2020-05-21 07:28:55 -0600 received badge  Self-Learner (source)
2018-02-28 23:55:07 -0600 received badge  Famous Question (source)
2017-10-24 02:00:22 -0600 received badge  Popular Question (source)
2017-09-29 03:16:37 -0600 received badge  Notable Question (source)
2017-07-04 01:26:35 -0600 received badge  Notable Question (source)
2017-03-23 00:59:13 -0600 received badge  Popular Question (source)
2016-04-02 16:46:05 -0600 received badge  Popular Question (source)
2015-10-15 01:35:30 -0600 received badge  Teacher (source)
2015-06-28 09:13:54 -0600 received badge  Necromancer (source)
2015-03-25 12:15:21 -0600 answered a question Writing/Drawing different things on Video. OpenCV Python
if ((time.time() - start_time) < 5.1):
    cv2.putText(frame, "test!",(50, 50),cv2.FONT_HERSHEY_COMPLEX_SMALL,.7,(0,0,255))
#Shows the change after the certain amount of time    
elif ((time.time() - start_time) < 10.1):
    cv2.putText(frame, "test2!",(50, 50),cv2.FONT_HERSHEY_COMPLEX_SMALL,.7,(0,0,255))
#After all displays are done, resets the start time back to current time
if ((time.time() - start_time) >= 10.1):
    start_time = time.time()
2015-03-24 15:34:08 -0600 asked a question How to put two videos side by side in a single frame?

I'm using python, and I don't know how to put two video streams side by side in a single frame. Please help. Thank you.

2015-03-23 11:51:04 -0600 asked a question Writing/Drawing different things on Video. OpenCV Python

My goal is to draw different things on a video then save the video with said drawings. I want the first drawing to show for 5 seconds for example, then second one in another part of the video for another 5 seconds while first drawing is gone.

I'm also trying to save the video (I'm on a Windows machine) but it doesn't read the file after saving. media player gives an error: I used:

fourcc = cv2.VideoWriter_fourcc(*'DIVX')
out = cv2.VideoWriter('output.MOV',fourcc, 20.0, (640,480))

Here's my code:

import numpy
import cv2

cap = cv2.VideoCapture('video.MOV')

fourcc = cv2.VideoWriter_fourcc(*'DIVX')
out = cv2.VideoWriter('output.MOV',fourcc, 20.0, (640,480))
while(1):

    # read the frames
    _,frame = cap.read()



        #A line
    cv2.line(frame, (500, 400), (640, 480),(0,255,0), 3)


    cv2.putText(frame, "test!",(105, 105),cv2.FONT_HERSHEY_COMPLEX_SMALL,.7,(225,0,0))
    out.write(frame)
    #if key pressed is 'Esc', exit the loop
    cv2.imshow('frame',frame)

    if cv2.waitKey(33)== 27:
        break
out.release()

cv2.destroyAllWindows()
2015-03-20 10:02:55 -0600 asked a question Why doesn't cv2.VideoCapture() not reading videos?

I've checked for solution of this everywhere (Stackoverflow) and I haven't found a solution yet. My code works perfectly fine with webcam, but when I want to feed it a video file (let's say video.MOV), it doesn't read it. I'm using Opencv 3.0 on Anaconda. Using a 32 bit anaconda on a 64 bit machine.

2015-03-20 10:00:00 -0600 received badge  Enthusiast
2015-03-19 11:09:38 -0600 asked a question OpenCv 3.0 Beta Cv2.videoCapture() cannot read from file

I searched this on stackoverflow and on here and didn't find much. I installed 32 bit anaconda on a 64 bit machine. The webcam works perfectly fine but when I try to run a .mp4 video, it returns false. Anyone knows the solution to this?

2015-03-17 09:24:37 -0600 answered a question Background Subtractiom

Try this:

fgbg = cv2.createBackgroundSubtractorMOG2()

2015-03-17 08:25:30 -0600 asked a question What are some easy methods to find objects in image processing?

I have the freedom to choose the type of object I want to detect, so I went with green circle targets, however no matter the pick, it becomes really hard to detect or even see when the sunlight shines directly on the target. Also, circle doesn't really work if I try to use any corner detection algorithms. Any ideas on what works best?

2015-03-11 13:09:15 -0600 asked a question How to add non-free modules to OpenCV 3.0?

I am new to image processing and currently trying to use Freak, Surf, etc and I'd like to know how to add the bindings. I'm using Anaconda on Windows and using Python version 2.7.

I tried to follow the instruction below: link text

I'd specifically like to add this: link text

Any help would be appreciated.