Ask Your Question
0

Can anybody tel me how to create a n-dimensional space

asked 2013-04-26 03:53:41 -0600

roomini gravatar image

I have 10 activities 435 features and 100 samples for each activity. so now, i need to create a 435-dimensional feature space to place these features for 100 samples of 10 activities. Can anybody help me in this?? Thanks in advance

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2013-04-26 04:04:31 -0600

What you could do is creating a matrix for each activity and the 100 samples. The creating layers for the actual features using the vector type. Pseudo code would look like:

Mat activities = Mat::zeros(10, 100, CV_8UC1); //change type depending on your feature values
vector<Mat> complete_data;    
for(int i = 0; i < 435; i ++){
    complete_data.push_back(activities);
}

You can now loop over the layers and then iterate through the matrix using the at<uchar> operator.

Or you could do it the other way around and create for sample a 436 x 100 matrix and create a vector of size 10. It can be as dynamic as you prefer.

edit flag offensive delete link more

Comments

can u please this in detail??

roomini gravatar imageroomini ( 2013-04-26 06:29:18 -0600 )edit
1

I will act like I have not just read your comment. Basically my answer to it however is NO. The code is almost exactly what you should do. This is a forum that pushes people to go head on with their problems and try to tackle problems themselves with suggestions given. I will not finish your project for you... read the FAQ for guidelines...

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-26 06:42:20 -0600 )edit

@StevenPuttrmans u did not understand my problem!

roomini gravatar imageroomini ( 2013-05-03 03:23:03 -0600 )edit

Seriously? My suggestion does exactly what you are asking. Your second question about explaining it in details, is basically asking for code. Tell me what is not to understand from it...

StevenPuttemans gravatar imageStevenPuttemans ( 2013-05-03 03:27:41 -0600 )edit

ok just tel me how to create 435 planes so that i can place the features of the 10 activities in that plane..

roomini gravatar imageroomini ( 2013-05-04 01:39:29 -0600 )edit
1

The code does exactly that! It creates a vector of matrices. You can access each plane by using complete_data[plane_number] and then use the .at<uchar>(x,y) operator on the selected matrix to access its elements and assign your values...

StevenPuttemans gravatar imageStevenPuttemans ( 2013-05-04 04:47:43 -0600 )edit

yup i understood.. s it possible that i can use multivariate variables in a single matrix..?? like one variable is a 3d-coordinate and other is an angular value, quaternion function and so on... ??

roomini gravatar imageroomini ( 2013-05-08 03:58:52 -0600 )edit

They overal vector element contains matrices, and each matrix can have its own data type, however, it cannot handle multiple data types in a single matrix, which should also be a bad practice.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-05-08 04:12:25 -0600 )edit

Question Tools

Stats

Asked: 2013-04-26 03:53:41 -0600

Seen: 169 times

Last updated: Apr 26 '13