jremmons / pyfakewebcam

A library for writing RGB frames to a fake webcam device on Linux!
GNU Lesser General Public License v3.0
9 stars 2 forks source link

blueish tint added to openCV images. #2

Closed daljeet-hcl closed 6 years ago

daljeet-hcl commented 6 years ago

I tried using your pyfakewebCam. Here is my sample code. https://gist.github.com/daljeet-hcl/9eee797715ac504e1694846d65eb3f78

your software adds a bluish tint to the images produced, can you help to fix it and restore original colors. I am a newbie to python and C.

Regards Daljeet Singh

jremmons commented 6 years ago

OpenCV stores pixels in blue-green-red (BGR) order by default. My fake webcam library expects the frames to be in red-green-blue (RGB) order though. I didn't try running your code, but I think adding the line of code below before scheduling the frame will solve the problem:

frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)

Let me know if that doesn't solve it for you!

daljeet-hcl commented 6 years ago

Great, Thanks a lot jremmons, it did help me solve the problem.