OpenCV 3.1 32bit build (github master downed on 2016-12-19)
- 32bit version
- no cuda
- with tbb
- built by Visual studio 2013
Sharing link
https://www.amazon.com/clouddrive/share/wmZzLHBKQ5GNllALxAOUiw3zesq5Kj6sQ08DnyFUJDA?ref_=cd_ph_share_link_copy
12/18/2016
OpenCV 3.1 32bit build
12/16/2016
Gpu Mat, Cpu Mat example 2
unsigned long AAtime = 0, BBtime = 0;
cuda::GpuMat gpuImg, gpuImg_out;
Mat img, img_out, img_out2;
img = imread("2mb.jpg");
gpuImg.upload(img);
AAtime = getTickCount();
cuda::bitwise_not(gpuImg, gpuImg_out);
Ptr< cv::cuda::filter > filter = cuda::createSobelFilter(img.type(), img.type(), 1, 0);
filter->apply(gpuImg_out, gpuImg_out);
BBtime = getTickCount();
gpuImg_out.download(img_out);
printf("gpu : %.2lf second \n", (BBtime - AAtime) / getTickFrequency());
AAtime = getTickCount();
bitwise_not(img, img_out2);
Sobel(img_out2, img_out2, img_out2.depth(), 1, 0);
BBtime = getTickCount();
printf("cpu : %.2lf second \n", (BBtime - AAtime) / getTickFrequency());
imshow("cpu_img", img_out);
imshow("cpu_img", img_out2);
waitKey(0);
Gpu Mat, Cpu Mat example code 1
...
#include "opencv2/opencv.hpp" #include "opencv2/highgui.hpp" #include "opencv2/cudaarithm.hpp" #include <iostream> #ifdef _DEBUG #pragma comment(lib, "opencv_core331d.lib") #pragma comment(lib, "opencv_highgui331d.lib") #pragma comment(lib, "opencv_imgcodecs331d.lib") #pragma comment(lib, "opencv_objdetect331d.lib") #pragma comment(lib, "opencv_imgproc331d.lib") #pragma comment(lib, "opencv_videoio331d.lib") #pragma comment(lib, "opencv_cudaarithm331d.lib") #else #pragma comment(lib, "opencv_core331.lib") #pragma comment(lib, "opencv_highgui331.lib") #pragma comment(lib, "opencv_imgcodecs331.lib") #pragma comment(lib, "opencv_objdetect331.lib") #pragma comment(lib, "opencv_imgproc331.lib") #pragma comment(lib, "opencv_videoio331.lib") #pragma comment(lib, "opencv_cudaarithm331d.lib") #endif using namespace std; using namespace cv; int main() { cuda::GpuMat gpuImg; Mat img = imread("ss.jpg"); gpuImg.upload(img); //upload vector< cuda::GpuMat> rgbGpuMat(3); cuda::split(gpuImg, rgbGpuMat); //cuda processing Mat r, g, b; rgbGpuMat[0].download(b); //download rgbGpuMat[1].download(g); rgbGpuMat[2].download(r); namedWindow("r", 0); //make window imshow("r", r); //show namedWindow("g", 0); //make window imshow("g", g); //show namedWindow("b", 0); //make window imshow("b", b); //show waitKey(0); return 0; }...
SVD (singular value decomposition) example in opencv
//Singular value decomposition : Mat w, u, v; SVDecomp(data, w, u, v); // A = U W V^T //The flags cause U and V to be returned transposed(does not work well without the transpose flags). cout << u << endl; cout << w << endl; cout << v << endl;
Eigen analysis(of a symmetric matrix) in opencv exmaple code
//Eigen analysis(of a symmetric matrix) :
float f11[] = { 1, 0.446, -0.56, 0.446, 1, -0.239, -0.56, 0.239, 1 };
Mat data(3, 3, CV_32F, f11);
cout << "input data" << endl;
cout << data << endl;
Mat value, vector;
eigen(data, value, vector);
cout << "Eigenvalues" << endl << value << endl;
cout << "Eigenvectors" << endl << vector << endl;
proof
cout << vector << endl; cout << endl << "AV" << endl; cout << data * vector << endl; cout << "vV" << endl; Mat ValueEye = Mat::eye(3, 3, CV_32F); ValueEye.at< float>(0, 0) = value.at< float>(0, 0); ValueEye.at< float>(1, 1) = value.at< float>(1, 0); ValueEye.at< float>(2, 2) = value.at< float>(2, 0); cout << vector*ValueEye << endl;
Labels:
eigen value,
eigen vector,
OpenCV,
Total
Inhomogeneous linear system solver in opencv (Example code)
double dm2[3][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
Mat A(3, 3, CV_64FC1, dm2);
Mat x(3, 1, CV_64FC1);
double vvb[] = { 14, 32, 52 };
Mat b(3, 1, CV_64FC1, vvb);
cv::solve(A, b, x, DECOMP_SVD); //// solve (Ax=b) for x
cout << x << endl;
Labels:
Inhomogeneous linear system,
OpenCV,
solve,
Total
12/14/2016
ctime_s and ctime example
#include < time.h >
#include < stdio.h >
int main(void)
{
time_t result = time(NULL);
//printf("%ld \n", result);
//printf("%s \n", ctime(&result));
char str[26];
ctime_s(str,sizeof str,&result);
printf("%s \n", str);
}
-> result
Thu Dec 15 02:29:54 2016
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...
-
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. ...
-
Image size of origin is 320*240. Processing time is 30.96 second took. The result of stitching The resul...
-
RTSP(Real Time Streaming Protocol) is video streaming, it usually sent from network camera. VideoCapture function in opencv also can get r...
-
Background subtractor example souce code. OpenCV support about 3 types subtraction algorithm. Those are MOG, MOG2, GMG algorithms. Det...
-
Created Date : 2011.2 Language : C/C++ Tool : Microsoft Visual C++ 2010 Library & Utilized : OpenCV 2.2 Reference : Interent Refer...
-
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...
-
After training SVM, we should test the trained XML data is reliable or not.. The method to extract HOG feature is refer to -> http://fe...
-
EMD(earth mover distance) method is very good method to compare image similarity. But processing time is slow. For using the EMD compare, ...
-
The MNIST dataset is a dataset of handwritten digits, comprising 60 000 training examples and 10 000 test examples. The dataset can be downl...