setTo masking example
gist start
gist end
CopyTo masking example
gist start
gist end
Showing posts with label copyTo. Show all posts
Showing posts with label copyTo. Show all posts
2/14/2017
6/09/2016
OpenCV Mat copyTo, Clone, ROI example code
OpenCV Mat copyTo, Clone, ROI example code
...
Mat img = imread("ss.jpg"); Rect r(img.cols / 4, img.rows / 4, img.cols / 4 * 2, img.rows / 4 * 2); //clone #1 Mat img2 = img.clone(); bitwise_not(img2, img2); //clone #2 Mat img5 = img(r).clone(); //copyTo #1 Mat cimg; img.copyTo(cimg); //copyTo #2 Mat cimg2; img(r).copyTo(cimg2); //copyTo #3 Mat cimg3( Size(img.cols*2, img.rows), img.type() ); cimg3.setTo(255); img.copyTo(cimg3(Range::all(), Range(0, img.cols))); img2.copyTo(cimg3(Range::all(), Range(img2.cols, img2.cols * 2))); //set roi Mat roi(img, r); //invert color bitwise_not(roi, roi); namedWindow("img2", 0); //make window imshow("img2", cimg); //show namedWindow("img3", 0); //make window imshow("img3", cimg2); //show namedWindow("img4", 0); //make window imshow("img4", cimg3); //show namedWindow("img5", 0); //make window imshow("img5", img5); //show namedWindow("img", 0); //make window imshow("img", img); //show waitKey(0);...
Subscribe to:
Posts (Atom)
-
Logistic Classifier The logistic classifier is similar to equation of the plane. W is weight vector, X is input vector and y is output...
-
I use MOG2 algorithm to background subtraction. The process is resize to small for more fast processing to blur for avoid noise affectio...
-
This is data acquisition source code of LMS511(SICK co.) Source code is made by MFC(vs 2008). The sensor is communicated by TCP/IP. ...
-
Background subtractor example souce code. OpenCV support about 3 types subtraction algorithm. Those are MOG, MOG2, GMG algorithms. Det...
-
Image size of origin is 320*240. Processing time is 30.96 second took. The result of stitching The resul...
-
Created Date : 2009.10. Language : C++ Tool : Visual Studio C++ 2008 Library & Utilized : Point Grey-FlyCapture, Triclops, OpenCV...
-
As you can see in the following video, I created a class that stitching n cameras in real time. https://www.youtube.com/user/feelmare/sear...
-
The MNIST dataset is a dataset of handwritten digits, comprising 60 000 training examples and 10 000 test examples. The dataset can be downl...
-
This post is about how to copy Mat data to vector and copy vector data to Mat. Reference this example source code. printf ( "/////...
-
This example source code is to extract HOG feature from images. And save descriptors to XML file. The source code explain how to use HOGD...