2017. 11. 11. 00:24
#include "opencv.hpp"
using namespace cv;
using namespace std;
int main()
{
Mat srcImage = imread("lena.jpg"); // BGR-Color
if (srcImage.empty())
return -1;
vector<Mat> planes;
split(srcImage, planes);
// imshow("srcImage", srcImage);
imshow("planes[0]", planes[0]); //Blue
imshow("planes[1]", planes[1]); //Green
imshow("planes[2]", planes[2]); //Red
// planes[0] = 0;
// Mat dstImage(srcImage.rows, srcImage.cols, srcImage.type());
Mat dstImage;
merge(planes, dstImage);
imshow("dstImage", dstImage);
waitKey();
return 0;
}
'OpenCV' 카테고리의 다른 글
ROI설정 (0) | 2017.11.11 |
---|---|
블러함수들 (0) | 2017.11.11 |
inrange 이진화 영상 (0) | 2017.11.11 |
Template Matching 이용해 모양찾기 (0) | 2017.11.04 |
OpenCV 이미지 크기 조정하기 (0) | 2017.11.04 |