title: cv2.cvtColor(img,cv2.COLOR_BGR2RGB) not working
body: <p>I am trying to create a screen recorder using mss and Opencv in python, the video I am capturing has a very different colours than original computer screen. I tried to find the solution online, Everyone saying it should be fixed using cvtColor() but I already have it in my code.</p>
  
  <pre><code>import cv2
  from PIL import Image
  import numpy as np
  from mss import mss
  import threading
  from datetime import datetime
  </code></pre>
  
  <p>`</p>
  
  <pre><code>def thread_recording():
  
      fourcc=cv2.VideoWriter_fourcc(*'mp4v')
      #fourcc=cv2.VideoWriter_fourcc(*'XVID')
      out=cv2.VideoWriter(vid_file,fourcc,50,(width,height))
      mon = {"top": 0, "left": 0, "width":width, "height":height}
      sct = mss()
  
      thread1=threading.Thread(target=record,args=(mon,out,sct))
      thread1.start()
  
  def record(mon,out,sct):
  
      global recording
      recording=True
  
      while recording:
          frame= np.array(sct.grab(mon))
          frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
          out.write(frame)
  
      out.release()
  </code></pre>
  
  <p>the vid_file variable contains a string of output file name with mp4 extension</p>
  
  <p><a href="https://i.stack.imgur.com/ndiBv.png" rel="nofollow noreferrer">Screenshot of my screen</a></p>
  
  <p><a href="https://i.stack.imgur.com/YW5yw.png" rel="nofollow noreferrer">Screenshot from recorded video</a></p>