title: How does one convert bayerRG12 to RGB888 image? (Baumer Camera)
body: <p>For what it's worth, I'm using trying to code a <a href="http://www.baumer.com/us-en/products/productfinder/?tx_baumerproductfinder_pf%5Burl%5D=%2Fpfinder_vision%2Fscripts%2Fproduct.php%3Fpid%3DTXG50c%26cat%3DIndustriekameras%26psg%3D%26language%3Den%26r%3D1%26ptk%3D%26sq%3D" rel="nofollow">baumer camera(txg50c model)</a>. The pixel formats available in this camera are BayerRG8, BayerRG12, Mono8, YUV411 Packed, and YUV422 Packed. I suppose the bayerRG12 (for your record, the documentation file says it uses 2 bytes per pixel) will work out. </p>
  
  <p>Now, I'm trying to show the image using Pyqt4 but I keep getting crashes if I directly convert it to RGB888 (standard 24 bit image).</p>
  
  <blockquote>
    <p>self.qImg = QtGui.QImage(imageData.data, width,
    height, QtGui.QImage.Format_RGB888)</p>
  </blockquote>
  
  <p>I've tried like QtGui.QImage.Format_RGB444, it works but it doesn't appear like what I want (the color in the image is messed up, on which i don't know why)
  I tried Mono8/BayerRG8 on the camera with QtGui.QImage.Format_Indexed8 also, but it only showed black and white picture.</p>