Ask Your Question

vlad_tepesch's profile - activity

2020-08-15 16:00:52 -0600 received badge  Popular Question (source)
2020-01-30 01:38:32 -0600 received badge  Popular Question (source)
2014-04-25 04:07:32 -0600 asked a question flann::hierarchicalClustering get labels

i am looking for some clustering with dynamic cluster count. i want to use flann::hierarchicalClustering. iam not directly interestet on the cluster itself but on the label of the input data.
how to get the labels? searching for the nearest cluster of each input vector? that seems to be doubled work since this internally should be calculated already
i expected some label output parameter like the bestLabels argument in kmeans.

or is there another (possibly better) way to cluster the data with dynamicly determined cluster count?

2014-02-12 08:05:51 -0600 received badge  Autobiographer
2014-02-12 03:27:56 -0600 commented question why is cv::invert so incredibly slow?

the first timings are release only the inv(R'R)R' calculation was done in debug. obviously the inv(R'R) should have the same timing as the fist one since it also has a 465x465 matrix to invert. only the timing of the matrix multiplication is added to the time. i added new timings from newer ocv version. i previously used the old one since it is the one we use in the current project so i did not wanted to become incompatible (also we used ocv with the IPP lib - dont know if this would have any influence). the new timings are with a new out of the box opencv

2014-02-11 05:58:08 -0600 received badge  Editor (source)
2014-02-11 05:36:30 -0600 asked a question why is cv::invert so incredibly slow?


why is cv::invert so incredibly slow? inverting a 465x465 matrix using svd takes 2minutes. without svd it still takes ~2sec

octave is much faster

i try to invert a 48984x465 matrix (SVD) and it takes a lot of time (it does not even completed yet) to invert. using octaves pinv finishes in <20sec;

calculating inv(R'*R)*R' in octave takes <10sec in opencv (without SVD) it also took much more time than my patience allowed me to wait.

I use 2.4.1

has anyone a hint?

edit: the second test (inv(R'R)R') was done in debug. obviously it should finish in same time as the first one)


i did some tests with the 2.4.8 ocv version:

inverting 465 x 465 matrix without SVD took 0.5s
inverting 465 x 465 matrix with SVD took 5s
inverting 48984 x 465 matrix with SVD took 10min
inverting 48984 x 465 matrix without SVD (inv(R'R)R') took 18s (only measured the inv(R'*R) part)

indeed there is a speed up in later opencv versions.

octave timings:

tic; inv(rand(465,465)); toc -> Elapsed time is 0.0780001 seconds.
tic; pinv(rand(465,465)); toc -> Elapsed time is 1.232 seconds.
tic; pinv(rand(48984,465)); toc -> Elapsed time is 15.023 seconds.
R = rand(48984,465); tic;inv(R'*R);toc --> Elapsed time is 0.889 seconds.

In comparistion to octave that afaik also uses SVD to calculate pseudoinverses opencv implementation seems to be very slow. But also the normal inversion does not compare very well.

2013-06-03 05:58:33 -0600 commented answer fitLine always crashes

@berak i have not got any exception that sounds like that. The exception that occurred was on crt or os level.

2013-06-03 05:30:23 -0600 commented answer fitLine always crashes

Thank you very much. But now, please point me to the part of documentation that tells me that only float input data is supported.

2013-06-03 05:27:07 -0600 received badge  Scholar (source)
2013-06-03 05:27:04 -0600 received badge  Supporter (source)
2013-06-03 04:37:14 -0600 asked a question fitLine always crashes

Hi i try to use fitLine but it always crashes. I already tried to modify input data (cv::Mat, std::vector<cv::pointd>) and output data(cv::Vect4d, std::vector<cv::pointd>(2), std::vector<double>(4)) formats.

Here is my Code:

std::vector<cv::Point2d> points;
// [...] // push_back some (26) points
std::vector<double> line(4,0);

now it crashes. Iam using winxp VS2010 with a opencv 2.41 build I got no call stack and the crash seems to happen in kernel32.dll xstring

Where is my failure?

2012-09-03 05:23:59 -0600 commented question cv::KalmanFilter some questions

thanks for the link

2012-09-03 05:23:44 -0600 commented answer cv::KalmanFilter some questions

thanks, i know about kalman filters. I wrote my own now, that fits my needs. There is no need to store a post and a pre state (beside to debugging). Normally there is only one state that is changed by predict and update step. if you read the state you always get the best possible estimation regardless whether there was an update or not. Sammy already posted a link to a bug report.

2012-08-30 15:32:12 -0600 received badge  Student (source)
2012-08-30 05:35:21 -0600 asked a question cv::KalmanFilter some questions

Hi, I have some questions about the Kalman filter implementation.

I have an object that contains some state(1d) that should be tracked with an 1D kalman filter. The state of the Kalman should contain the state and its first derivative.

so the Kalmanfilter have to be initilized with init(2,1);

My Questions: qhich of the public members is the current state? statePre or statePost? why are there two states? and which holds the current covariances?

in my understanding the kalman just needs one state (s, s') and a covariance matrix(2x2)
The whole process works like this:

    state <- init from measurement and default derivative
    covar <- initial Covars from measurement variance

    state <- state * transition
    covar <- new covar (build from current covar and process noise)

    state <- fancy calculations using oldstate, newstate and variances
    covar <- more fancy calculations

so state and covar always contain the correct data.

so why cv::Klamnafilter requires statePre and statePost? which one contains the valid state? what happens in the following scenario:

  // no measurement 
  // no measurement 

how does later parts of algorithm should know if they should read statePre or statePost? have i allways to store if there was an update or not and read the other member if i want the current state?

That are all the temp matrices? The class design looks a bit awkward to me.

Thanks Vlad