display cv2.VideoCapture image inside Pygame surface
I'm trying to use opencv (cv2) to stream a webcam feed into a pygame surface object. The problem is the colors aren't displaying correctly. I think it is the type casting, but I'm having trouble understanding the pygame surface documentation to know what it expects. This code demonstrates what I'm talking about import pygame from pygame.locals import * import cv2 import numpy color=False#True#False camera_index = 0 camera=cv2.VideoCapture(camera_index) camera.set(3,640) camera.set(4,480) #This shows an image the way it should be cv2.namedWindow("w1",cv2.CV_WINDOW_AUTOSIZE) retval,frame=camera