I've created a microscope application using a Raspberry Pi 2 and a Raspberry Pi camera board. I'm programming in Python using PyGame, cv2 and picamera 1.10.
Works great, with one exception.
Previewing to the screen looks great, with a very responsive image, good colors and excellent reaction to changing light conditions. However when I capture, the image takes on strange hues and the white balance appears to be performing poorly. Capture seems unable to adjust to various lighting conditions, at least compared to preview. If I could, I'd capture exactly what I'm seeing in preview mode and manipulate that image in pygame.
I've tried querying all preview settings such as awb_gains and forcing that upon the capture, but the results look worse. I've queried and observed that the digital_gain is different when previewing and capturing, but I have no control over that. I've tried capturing from the video port, but similar results.
Remember, this is a microscope application so the lighting is unique and the FOV might be cut off. Could the camera be making white balance decisions based upon the whole FOV, instead of just the center where I'm later cropping?