Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

VirtualCamera .getImage() outputs 'NoneType'

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:

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.