I put the following python code in the NAO robot to capture and get the frame from one if its camera.
import cv2
cap= cv2.VideoCapture(0)
frame = cap.read() #This is where the error takes place
the program returns
VIDIOC_QBUF: Invalid argument
I solved the problem, I used pyQt, the instructions are in the NAO's official page, and then convert QImage to OpenCV, the solution can be founded in google.