RaspTank_pro - Camera R-B color swapped
Camera displays with swapped colors as BGR instead of RGB.What to do? Though I may have found a solution here in FPV.pyfor frame in camera.capture_continuous(rawCapture, format="bgr", use_video_port=True):
swap bgr for rgb.Doesn't work.Try again.
Playing the camera with VLC via VNC desktop shows the correct colors.
Is this a problem with the webpage rather than the capture?
The VLC codec shows it is playing with YUV420, not RGB.I can get it to do MJPEG but only to YUV420.
Switching on the auto brightness, auto gain etc. makes the image very much better.Need to set these in the camera server code. It appears that FPV.py is not used at all for image streaming.FPV used by wevSServer.py hereFPV_Thread only gets used by server, not webServer.
Tested by removing this linethat sends the image.
Where is the image coming from?
The function by webServer is in camera_opencv hereTested putting a rgb to bgr conversion in and it worked.
I don't yet know if the problem is at frame delivery or camera capture. So I don't know where to put the conversion.
Getting somewhere when changing settings in camera_opencv.py
Added camera capture settings to reduce resolution and frame rate.That significantly improves performance of everything.
Added setting to adjust exposure an gain.This makes the image much brighter in low light conditions.Still experimenting with this.
Auto exposure and balance doesn't appear to work yet.
camera.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
camera.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
camera.set(cv2.CAP_PROP_FPS, 10)
camera.set(cv2.CAP_PROP_EXPOSURE, 3000)
camera.set(cv2.CAP_PROP_GAIN, 10)
# camera.set(cv2.CAP_PROP_AUTO_WB, 1)
# camera.set(cv2.CAP_PROP_AUTO_EXPOSURE, 1)
# camera.set(cv2.CAP_PROP_CONVERT_RGB, 1) It seems that VLC is using YUV420 rather than RGB when it plays videos.As far as I can tell, it can only handle YUV420 MJPEG.
Auto brightness, auto gain, and other similar features greatly improve the picture quality.These variables must be defined in the camera server program.
Pages:
[1]