Ask Your Question

belan's profile - activity

2017-06-07 08:30:40 -0600 asked a question Integral Projection

Is there anyone knowing about Integral projection? and i wish you give me a sample of code of integral projection ? I don't know about integral projection. This's very important for my final project. please help me. thank you.

2017-01-31 08:48:05 -0600 asked a question Matrix Deviation

I want to make dev1,dev2,dev3 to array mat like ( dev[d] )but i can't.

Mat dev1,dev2,dev3;
        dev1=Mat(align[0])-average; 
        dev2=Mat(align[1])-average; 
        dev3=Mat(align[2])-average;

is there anyone can help me? thank you

2017-01-25 04:36:01 -0600 commented question Convert Mat 5x5 to Vector

It contains matrix (x,y). is that wrong?

2017-01-25 04:12:35 -0600 asked a question Convert Mat 5x5 to Vector

This is Matrix 5x5 , I want to convert it to vector. But it failed. I use reshape(0,1) and the error says bad number of row.

 [ 3.76666679e+001, -1., 40., -1., 3.06666660e+001, -1.,3.06666660e+001, -1., 27., -1., 
40., -1., 4.46666679e+001, -1.,3.53333321e+001, -1., 3.43333321e+001, -1., 30., -1.,
3.06666660e+001, -1., 3.53333321e+001, -1., 3.03333340e+001, -1.,28., -1., 24., -1., 
3.06666660e+001, -1., 3.43333321e+001, -1., 28., -1., 29., -1., 25., -1., 
27., -1., 30., -1., 24., -1., 25.,-1., 2.23333340e+001, -1. ]

Any somebody knows my problem? My code always difficult to reshape. Thank you

2017-01-21 08:02:25 -0600 commented question Calculate Eigen Vector and Eigen Value for PCA

The data is vector x y -> 25 data. and I change/ reshape it to nxn = 5x5 (this is int). after that I convert to 32F. and that the result. any i idea for change it to 1 channel matrix with row n column same . thank you

2017-01-21 07:44:04 -0600 asked a question How to change 2 channel matrix to 1 channel matrix

Mat covmat ; //is 2 channel matrix , and 5 row*5 col and I wanna change it to 1 channel matrix. How? I have tried to change with reshape(1,n), I got 1 channel matrix, but the column changed to 10. I want to get 1 channel matrix but the row and col still same. Any Idea? Thank you.

2017-01-21 06:14:26 -0600 commented answer Calculate Eigen Vector and Eigen Value for PCA

Ok, thank you, I will try it.

2017-01-21 01:30:11 -0600 commented answer Calculate Eigen Vector and Eigen Value for PCA

So, how to make it, to be single channel? I'm a beginner in opencv.

2017-01-21 01:27:43 -0600 asked a question Error to get eigenvector and eigenvalue in opencv

I want to get eigen vector and eigen value from PCA value. this's my part of code. Data from txt file (matdev)

%YAML:1.0 Point: !!opencv-matrix
rows: 5 cols: 5 dt: "2f"
data: [ 0., 0., 1., 0., -1., 0., 0., 0., 0., 0., 0., 0., -1., 0., -1., 0., 0., 0., -1., 0., 0., 0., 0., 0., 1., 0., -1., 0., 0., 0., 1., 0., 1., 0., -1., 0., 0., 0., -1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. ]

        PCA pt_pca(covmat, Mat(), CV_PCA_DATA_AS_ROW, 0);
        Mat pt_eig_vals = pt_pca.eigenvalues;
        for (int i = 0; i < 4; ++i)
        cout << pt_eig_vals.at<float>(i, 0) <<endl;

This is the error. OpenCV error: Assertion Failed <data.channerls&lt;&gt; =="1"> in unknown function, file ......\src\opencv\modules\core\src\matmul.cpp Please somebody help me. :(. Thank you so much

2017-01-21 01:19:32 -0600 asked a question Error to get EigenVector and Eigen Value

I want to get eigen vector and eigen value from PCA value. this's my part of code. Data from txt file (matdev) %YAML:1.0 Point: !!opencv-matrix rows: 5 cols: 5 dt: "2f" data: [ 0., 0., 1., 0., -1., 0., 0., 0., 0., 0., 0., 0., -1., 0., -1., 0., 0., 0., -1., 0., 0., 0., 0., 0., 1., 0., -1., 0., 0., 0., 1., 0., 1., 0., -1., 0., 0., 0., -1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. ]

Mat covmat=((matdevmatdev.t())/3); //data float matrix 55, this's working. but when I add with PCA function. It's break. PCA pt_pca(covmat, Mat(), CV_PCA_DATA_AS_ROW, 0); Mat pt_eig_vals = pt_pca.eigenvalues; for (int i = 0; i < 4; ++i) cout << pt_eig_vals.at<float>(i, 0) <<endl;< p="">

This is the error. OpenCV error: Assertion Failed <data.channerls&lt;&gt; =="1"> in unknown function, file ......\src\opencv\modules\core\src\matmul.cpp
Please somebody help me. :(. Thank you so much
2017-01-21 01:15:11 -0600 commented question Calculate Eigen Vector and Eigen Value for PCA

matdev is matrix data from txtfile like this.

%YAML:1.0
Point: !!opencv-matrix
   rows: 5
   cols: 5
   dt: "2f"
   data: [ 0., 0., 1., 0., -1., 0., 0., 0., 0., 0., 0., 0., -1., 0., -1.,
       0., 0., 0., -1., 0., 0., 0., 0., 0., 1., 0., -1., 0., 0., 0., 1.,
       0., 1., 0., -1., 0., 0., 0., -1., 0., 0., 0., 0., 0., 0., 0., 0.,
       0., 0., 0. ]