test_RGBA.cpp

Martin Beckett, 2012-05-11 10:46 pm

Download (732 Bytes)

 
1
#include "test_precomp.hpp"
2
3
//CV_TEST_MAIN("cv")
4
5
int main(int argc, char **argv)
6
{
7
   cv::Mat raw = cv::imread(std::string("OpenCV2.4/opencv_extra/testdata/cv/") + "/cvtcolor/bayer_input.png", CV_LOAD_IMAGE_GRAYSCALE);
8
   cv::Mat rgb;
9
   
10
   cv::cvtColor(raw, rgb, CV_BayerRG2RGB);
11
   cv::imwrite(std::string("OpenCV2.4/opencv_extra/testdata/cv/") + "/cvtcolor/bayer_RGB.png",rgb);
12
13
   cv::Mat ref;        
14
        cv::cvtColor(rgb,ref,CV_RGB2RGBA);
15
        cv::imwrite(std::string("OpenCV2.4/opencv_extra/testdata/cv/") + "/cvtcolor/bayer_REF.png",ref);
16
17
   cv::Mat rgba;
18
   cv::cvtColor(raw, rgba, CV_BayerRG2RGBA);
19
   cv::imwrite(std::string("OpenCV2.4/opencv_extra/testdata/cv/") + "/cvtcolor/bayer_RGBA.png",rgba);
20
   
21
22
}
23