Ask Your Question

Revision history [back]

kdtreeparams with 3 dims mat problem

Hi!

I have a problem trying to k-d tree decomposition with 3 dimensional mat. I tried to check the problem, and I found the problem may be for the reason that the matrix's rows are -1. (So, when I tried to execute "myMat.size()", errors occurred).

How can I solve the problem? The situation is...


I made the matrix like... int sz[] = {300,300,300}; cv::Mat myMat(3, sz, CV_32FC1, cv::Scalar::all(0)); and I assigned the values like... myMat.at<int>(x, y, z) = grayMat<int>(r,c);

and to execute kdtree decomposition... cv::flann::KDTreeIndexParams kdparams(64); // to make 64bins... cv::flann::Index kdtreeIndex(myMat, kdparams);

and it makes errors!

Also, I checked the "myMat"'s size std::cout<<" myMat"<<", rows:"<<mymat.rows&lt;<std::endl; and="" it="" returns="" -1="" value.<="" p="">


Please give me any advice. Thanks.

kdtreeparams with 3 dims mat problem

Hi!

I have a problem trying to k-d tree decomposition with 3 dimensional mat. I tried to check the problem, and I found the problem may be for the reason that the matrix's rows are -1. (So, when I tried to execute "myMat.size()", errors occurred).

How can I solve the problem? The situation is...


I (I made the matrix like... matrix)

int sz[] = {300,300,300}; cv::Mat myMat(3, sz, CV_32FC1, cv::Scalar::all(0)); and I assigned the values like... values--> myMat.at<int>(x, y, z) = grayMat<int>(r,c);

and (and to execute kdtree decomposition... decomposition...)

cv::flann::KDTreeIndexParams kdparams(64); // to make 64bins... 64bins...

cv::flann::Index kdtreeIndex(myMat, kdparams);

and (and it makes errors!errors!)

Also, I checked the "myMat"'s size std::cout<<" myMat"<<", rows:"<<mymat.rows&lt;<std::endl; and="" it="" returns="" -1="" value.<="" p=""> size and it returns -1 value.


Please give me any advice. Thanks.

kdtreeparams with 3 dims mat problem

Hi!

I have a problem trying to k-d tree decomposition with 3 dimensional mat. I tried to check the problem, and I found the problem may be for the reason that the matrix's rows are -1. (So, when I tried to execute "myMat.size()", errors occurred).

How can I solve the problem? The situation is...


(I made the matrix)

int sz[] = {300,300,300}; cv::Mat myMat(3, sz, CV_32FC1, cv::Scalar::all(0)); cv::Scalar::all(0));

and

(and I assigned the values--> values)

myMat.at<int>(x, y, z) = grayMat<int>(r,c);

(and to execute kdtree decomposition...)

cv::flann::KDTreeIndexParams kdparams(64); // to make 64bins...

cv::flann::Index kdtreeIndex(myMat, kdparams);

(and it makes errors!)

Also, I checked the "myMat"'s size and it returns -1 value.


Please give me any advice. Thanks.

kdtreeparams with 3 dims mat problem

Hi!Hi

I have a problem trying in dealing with 3dim mat data (i.e., rgb form)

When I try to k-d tree decomposition with 3 dimensional mat. use it in kdtreeindexparams, error occurs. I tried to check the problem, and I found the problem may be guess it is for the reason that the matrix's rows are -1. (So, when I tried to execute "myMat.size()", errors occurred).its type is 3c (cv_32fc3).

How can I solve the problem? The situation is...Is there any solutions for dealing with 3d data in flann?


(I made the matrix)

int sz[] = {300,300,300}; cv::Mat myMat(3, sz, CV_32FC1, cv::Scalar::all(0));

(and I assigned the values)

myMat.at<int>(x, y, z) = grayMat<int>(r,c);

(and to execute kdtree decomposition...)

cv::flann::KDTreeIndexParams kdparams(64); // to make 64bins...

cv::flann::Index kdtreeIndex(myMat, kdparams);

(and it makes errors!)

Also, I checked the "myMat"'s size and it returns -1 value.


Please give me any advice. Thanks.