title: is there a clue to determine whether colorspace conversion via cvtcolor is needed
body: <p>I used imread to upload an image from the disk (I thought BGR is the default output of cv::imread ). Then, I used cvtcolor to convert the image from BGR (the default of OpenCV) to RGBA (the default of CUDA).</p>
  
  <p>I thought I should make sure that the image was converted correctly so I displayed ( and saved) the converted image. However, the image colors were distorted &amp; looked Bluish when I used imshow &amp; imwrite. For debug purposes, I tried to revert the conversion to the image debugImage &amp; surprisingly it was displayed correctly.</p>
  
  <pre><code>  cv::Mat image;
    image = cv::imread("input_image.jpg", CV_LOAD_IMAGE_COLOR);
    if (image.empty()) {
          std::cerr &lt;&lt; "Couldn't open file: " &lt;&lt; filename &lt;&lt; std::endl;
          exit(1);
    }
    int type1 = image.type(); //16 --&gt; CV_8UC3
    cv::namedWindow("image window", cv::WINDOW_AUTOSIZE); 
    cv::imshow("image window", image);
    cv::waitKey(0);
    cv::destroyWindow("image window");
  
    cv::Mat imageRGBA1(image.rows, image.cols, CV_8UC4);
    cv::cvtColor(image, imageRGBA1, CV_BGR2RGBA); // BGR2RGBA DIDNOT WORKED!!
    int type2 = imageRGBA1.type(); // 24 --&gt; CV_8UC4
    cv::namedWindow("imageRGBA1 window", cv::WINDOW_AUTOSIZE);
    cv::imshow("imageRGBA1 window", imageRGBA1); // BLUISH IMAGE
    cv::waitKey(0);
    cv::destroyWindow("imageRGBA1 window");
  
    cv::Mat debugImage(image.rows, image.cols, CV_8UC4);
    cv::cvtColor(imageRGBA1, debugImage, CV_RGBA2BGR);
    int debugtype = debugImage.type(); // 24 --&gt; CV_8UC4
    cv::namedWindow("debugImage window", cv::WINDOW_AUTOSIZE); 
    cv::imshow("debugImage window", debugImage); // CORRECT IMAGE
    cv::waitKey(0);
    cv::destroyWindow("debugImage window");
  </code></pre>
  
  <p>When I assume the image obtained from imread was the RGB image the conversion works:</p>
  
  <pre><code>cv::Mat image;
    image = cv::imread("input_image.jpg", CV_LOAD_IMAGE_COLOR);
    if (image.empty()) {
          std::cerr &lt;&lt; "Couldn't open file: " &lt;&lt; filename &lt;&lt; std::endl;
          exit(1);
    }
    int type1 = image.type(); //16 --&gt; CV_8UC3
    cv::namedWindow("image window", cv::WINDOW_AUTOSIZE); 
    cv::imshow("image window", image);
    cv::waitKey(0);
    cv::destroyWindow("image window");
  
    cv::Mat imageRGBA1(image.rows, image.cols, CV_8UC4);
    cv::cvtColor(image, imageRGBA1, CV_RGB2RGBA); // CV_RGB2RGBA WORKED!!
    int type2 = imageRGBA1.type(); // 24 --&gt; CV_8UC4
    cv::namedWindow("imageRGBA1 window", cv::WINDOW_AUTOSIZE);
    cv::imshow("imageRGBA1 window", imageRGBA1); // CORRECT IMAGE
    cv::waitKey(0);
    cv::destroyWindow("imageRGBA1 window");
  </code></pre>
  
  <p>what am I missing?</p>