Thread: Network Tables
View Single Post
  #5   Spotlight this post!  
Unread 30-03-2014, 16:31
lucas.alvarez96's Avatar
lucas.alvarez96 lucas.alvarez96 is offline
Registered User
AKA: Lucas Alvarez
FRC #2576 (Chilean Heart)
 
Join Date: Dec 2013
Rookie Year: 2013
Location: Chile
Posts: 123
lucas.alvarez96 is a name known to alllucas.alvarez96 is a name known to alllucas.alvarez96 is a name known to alllucas.alvarez96 is a name known to alllucas.alvarez96 is a name known to alllucas.alvarez96 is a name known to all
Re: Network Tables

Ok so I tried this:

Code:
import cv2
import numpy as np
import time

camera_ip = "10.25.76.11"

vc = cv2.VideoCapture()
vc.set(cv2.cv.CV_CAP_PROP_FPS, 1)
        
if not vc.open('http://%s/mjpg/video.mjpg' % camera_ip):
    time.sleep(0)

while True:
    retval, img = vc.read(buffer)
    cv2.imshow("img", img)
    if cv2.waitKey(20) == 27:
        break

cv2.destroyAllWindows()
exit(0)
And got this:

Code:
Traceback (most recent call last):
  File "C:/Users/Lucas/Desktop/cdch/render_stream3.py", line 14, in <module>
    retval, img = vc.read(buffer)
TypeError: <unknown> is not a numpy array
So truth be told, I'm not quite sure what's going on...

And yeah, I'd read somewhere that ffmpeg could sometimes be the source of the problem, but I'm on windows and haven't the faintest idea on how to compile from source...

I'm very sorry Dustin if the problem is to obvious, but I've been struggling with this for weeks and my team REALLY needs it for the championships...
__________________
FRC 2576 2015-2016: Mentor
FRC 2576 2013-2015: Programmer & Chairman's Presenter

Los Angeles Regional 2014: Regional Chairman's Award