Sunday 17 June 2018

Image Layer Splitting

               OpenCV C++ Image Splitting


Source Code:

#include  <opencv2/opencv.hpp>
#include  <opencv2/imgproc/imgproc.hpp>
//#include <opencv2/highgui/highgui.hpp>
#include <iostream>
//#include <iostream>
//#include <opencv2/imgcodecs/imgcodecs.hpp>
//using namespace std;
using namespace cv;
using namespace std;


int main()
{
Mat image;
image=imread("appa.jpg",CV_LOAD_IMAGE_ANYCOLOR);
Mat r, g, b;
r=image;
// splitting
Mat src;
vector<Mat> rgbChannels(3);
split(src,rgbChannels);
Mat fin_img;
g=Mat::zeros(Size(image.cols,image.rows),CV_8UC1);
{

vector<Mat>channels;
channels.push_back(g);
//channels.push_back(g);
//channels.push_back(rgbChannels[2]);
merge(channels,fin_img);
namedWindow("Green",1);
imshow("Green",fin_img);
}
imshow("Image_input",image);
waitKey(0);

//waitKey(0);
destroyAllWindows();



}


                                                   Installation Pacakges
1.Python
2.Opencv

1 comment:

  1. Deep dream Python
    https://medium.com/@omaraymanomar/deepdream-428fe9aa5201

    ReplyDelete