Ask Your Question
0

VirtualCamera .getImage() outputs 'NoneType'

asked 2014-10-01 11:03:22 -0500

ppipat gravatar image

I'm trying to track a circular blob object in a video. I have a script that will filter out the blob I want and outputs the (x,y) position. What I want to do is for the script to do that using a video input. I currently have to extract each frame into an image directory which gets really large and requires external software. I want to use VirtualCamera and just use it a loop but I am not getting anything from the getImage() function.

vid = VirtualCamera('Cut2TO.mp4','video')
while True:
    vid.getImage().show()

This is the error I get:

   AttributeError                            Traceback (most recent call last)
   <ipython-input-21-8fe70a4b5497> in <module>()
          1 vid = VirtualCamera('Cut2TO.mp4','video')
          2 while True:
   ----> 3     vid.getImage().show()

  AttributeError: 'NoneType' object has no attribute 'show'

Any thoughts on the reason this is not working? Or a better way to track a blob object from a video where I just care about the centroid location of the blob from frame to frame. Eventually, I will want to track 2 or 3 blobs from the video.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2014-10-08 04:46:02 -0500

Neha gravatar image

Just check if it is able to find the video file. Generally it would give an error saying that 'Cut2T0.mp4' was not found.

edit flag offensive delete link more

Comments

It would error on line 1 if it couldn't find the file (I got that error when I typed the name wrong).

ppipat gravatar imageppipat ( 2014-10-14 17:34:54 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-10-01 11:03:22 -0500

Seen: 379 times

Last updated: Oct 08 '14