How can I make a screenshot in the BGE (numpy of pixel values) without saving to disk? I'm doing a computer vision simulation in blender game engine, so I need to make screenshots that will give me an array/numpy of pixels to do image processing on at each frame. Saving it as PNG through bge.render.makeScreenshot(path) and then reading values through there won't work since that will be very slow for this task.
you might try something like this:

import bge

source = texture.ImageRender(world,sensorView_Cam) 

source.capsize = [640,480]

imageArray = texture.imageToArray(source, 'RGB') 

charArray = imageArray.to_list()


works ok for me (Although, i dont know if it is fast enough for you and if there are faster ways)