Ask Your Question

RiSaMa's profile - activity

2017-08-29 16:45:47 -0500 received badge  Notable Question (source)
2016-11-07 14:57:06 -0500 received badge  Popular Question (source)
2016-01-25 08:57:06 -0500 received badge  Student (source)
2015-08-18 07:40:26 -0500 asked a question Detect if a video is wrongly rotated

Dear everyone,

I have to develop a software which detect when a video is wrongly rotated (for example this one https://youtu.be/F4zqCHfzudw?t=25s)

We cannot assume things like there are/aren't people or there is/is not sky... I have been thinking about how to address this issue:

  • Analyse the global movement in the video using differences between frames and HOGH transform... But this one doesn't work very good on a static videos.
  • Try to analyse which kind of image is: people, landscape, city and then look for characteristic features of each situation...
  • Look for text ...

I am quite stuck in this task... Could give me your opinion to try to find the way to address this ?

Thank you so much!

2015-03-04 04:59:21 -0500 commented answer Create CMake file from Visual Studio Project

I have achieve create the makeFile. It's working properly in Windows. I execute cmake and from the code files it create the visual studio project properly and it works fine.

BUT when I try to execute the make command in LINUX I get errors :S: *In function ..... error: 'infinity' des not name a type const auto.... *.... error: 'infinity' was not declared in this scope *.... error: 'infinity' was not declared in this scope *.... error: 'infinity' was not declared in this scope

The line where is the problem is this one:

const auto infinity = std::numeric_limits<int>::infinity();

It's a line from this project: https://github.com/soimy/munkres-open...

I think the problem is defining a infinity limit... Could anyone lead me to solve this problem?

THANKS!!!

2015-03-03 04:06:45 -0500 commented answer Create CMake file from Visual Studio Project

Thanks for your answer. It was usefull but I have a problem Vimba libraries doesn't work with find_package.... I have code files, and libraries (dll, lib). How can write the proper lines for include this vimba libraries??

THANKS!!!

2015-03-02 09:23:35 -0500 asked a question Create CMake file from Visual Studio Project

I have finished a project developed in Visual Studio 2013 (Windows) using OpenCV. Now, my manager told me he needs the code files and the CMAKE file.

I'm reading this documents:

but I don't understand properly and I don't know if they are what I need...

I can explain a little bit more my project: My project has:

  • main.cpp
  • Some .cpp created by myshelf.
  • Some .h created by myshelf.
  • I use OpenCV libraries (lib, dll, ...).
  • I use Vimba libraries (lib, dll, ...).

I have never worked with CMAKE files... Could anyone lead me about how create this file/s?? I'm really missed...

THANKS in advance!!! Any help is welcome!

2015-02-25 04:34:10 -0500 commented answer Calculate weight of a cluster in Opencv

OK Thank you everyone helped me! I finally implemented recalling the train function using the LABELS modified how input. THANKS

2015-02-25 03:24:33 -0500 commented answer Calculate weight of a cluster in Opencv

OK, thank you for your explanations.

But I have a doubt...

If I use how input a cloud of points (particles x, y) ... What determines the weight of the clusters??

  • Dense cluster -> high weight?
  • No dense cluster -> low weight?

THANKS!!!

2015-02-25 03:23:49 -0500 answered a question Calculate weight of a cluster in Opencv

OK, thank you for your explanations.

But I have a doubt...

If I use how input a cloud of points (particles x, y) ... What determines the weight of the clusters??

- Dense cluster -> high weight? - No dense cluster -> low weight?

THANKS!!!

2015-02-24 03:13:12 -0500 received badge  Enthusiast
2015-02-23 07:14:57 -0500 commented answer Calculate weight of a cluster in Opencv

I think we aren't understanding properly.

I have some particles with this values: position (x,y) and label(empty before execute the EM).

At this moment I execute the trainE using like INPUT only the position (x,y). And I get (output):

  • Labels from EM and I assign these to the particles.
  • Weights, covs and means.

At this moment we have the particles with its new labels.

Now I CHANGE some labels based in others things.... And I want get the weights of these modified clusters!

How could I achieve these new weights??

THANKS in advance and thanks for your patience!!

2015-02-23 07:14:33 -0500 answered a question Calculate weight of a cluster in Opencv

I think we aren't understanding properly.

I have some particles with this values: position (x,y) and label(empty before execute the EM).

At this moment I execute the trainE using like INPUT only the position (x,y). And I get (output):

  • Labels from EM and I assign these to the particles.
  • Weights, covs and means.

At this moment we have the particles with its new labels.

Now I CHANGE some labels based in others things.... And I want get the weights of these modified clusters!

How could I achieve these new weights??

THANKS in advance and thanks for your patience!!

2015-02-23 06:14:49 -0500 commented answer Calculate weight of a cluster in Opencv

But the labels aren't a input of the clustering... I use positions (x,y) how input of the clustering I have "particles" like these:

  • X | Y | .... | LABEL | .....

I use like input: (x,y) I use like OUTPUT label for asign labels at each particle.

Do you think I need restart trainE? With labels like input? because if I use the (x,y) (which have not been modified) I will get the same result....

I don't understand what is the meaning of the weight... is related with the distance between input and means of the clusters?

THANKS for your HELP!!!

2015-02-23 03:29:12 -0500 received badge  Critic (source)
2015-02-23 03:29:00 -0500 commented answer Calculate weight of a cluster in Opencv

Thank you for your answer! I think this one isn't the correct solution because... I currently do:

  • I call trainE
  • I modify things using these results like the labels...
  • If I recall trainE I will get the same clustering that the previous call.... and I want the weight of the clusters with the new labels which I'm modified...

I hope someone could hit the mark!

THANKS!!

2015-02-20 08:06:03 -0500 asked a question Calculate weight of a cluster in Opencv

Dear forum followers I have a issue which I don't know how deal with it.

I'm developing a tracker (track people in videos) from a particle filter. I have particles along the image and I cluster them using EM (http://docs.opencv.org/modules/ml/doc...) in Opencv.

After clustering, I can check the next values about the output clusters:

  • Mean of the cluster (position)
  • Weight of the cluster
  • Covariance of the clusters

At this point everything is fine.

After I modify some of this clusters and particles and the final step would be recalculate mean, weight and covariance. I calculcate these variables:

  • Mean: calculating the average position of the particles.
  • Covariance: calculateing the covariance of the particles.
  • Weight: here is my doubt... HOW can I calculate the weight of each cluster??

Extend information: I'm currently doing: - I call trainE - I modify things using these results like the labels... -And I want calculate the weight of the clusters; with the labels modified...

I hope you can help me!!! Thank in advanced!!!

2015-02-20 07:54:35 -0500 commented answer Calculate covariance in Opencv

Exactly!!! We need to divide between number of rows -1!!

You are a genius!!!

2015-02-20 07:53:05 -0500 received badge  Scholar (source)
2015-02-20 07:53:03 -0500 received badge  Supporter (source)
2015-02-20 07:12:36 -0500 asked a question Calculate covariance in Opencv

Dear forum followers I have a issue which I don't know how solve it.

I have a Mat like:

500.0   350.2
500.5   355.8
498.7   352.0
............

And I need calculate the covariance. The result would be something like:

0.8633    1.2167
1.2167    8.1733

Of course, the function which I need is calcCovarMatrix.... BUT if I execute these code:

cv::Mat a = (cv::Mat_<double>(3, 2) << 500.0, 350.2, 500.5, 355.8, 498.7, 352.0);
cv::Mat mu, new_covs;
cv::calcCovarMatrix(a, new_covs, mu, CV_COVAR_NORMAL | CV_COVAR_COLS);
The result is a incomprehensible 3x3 matrix...
new_covs=
[11220.02, 10838.03, 10987.83;
  10838.03, 10469.045, 10613.745;
  10987.83, 10613.745, 10760.445]

Another question:

If I have a set of clusters could I get the weight of these clusters like Expectation Maximization does it. How?: (http://docs.opencv.org/modules/ml/doc...)

I hope you can help my with my problem!! Thank you in advanced!

2015-01-21 07:30:21 -0500 asked a question Calculate mode in OpenCV

Hi guys, Do you know how is the best and simply way to calculate the mode of a matrix?? For example in this matrix: [1 1 2 2 3 3 3 3] The mode is 3... How can I calculate it? THANKS!!!!

2015-01-12 05:21:36 -0500 commented question Fill a std::vector with cv:Mat's

PERFECT!!! I LOVE YOU!! :)

2015-01-12 05:13:01 -0500 asked a question Fill a std::vector with cv:Mat's

Hi guys! I need your help, I hope you can help me.

I've created a struct:

struct clusters_t { 
        cv::Mat ids;
        cv::Mat means;
        vector<cv::Mat> covs;
        cv::Mat weights;
    } clusters;

And I have a problem filling the "covs". I reserve memory like I show below but... how can I copy a Mat inside the vector of mats??

clusters.covs.clear();
clusters.covs.reserve(0);

cv::Mat matrix;

newCovs.copyTo(clusters.covs.at(0));  //<-- DONT WORK... HOW CAN I COPY matrix inside the vector?

THANK YOU!!!!!!!!!!!!!!!!!!

2014-11-13 03:38:22 -0500 commented answer Stack around the variable Opencv & C++

Another problem :'(... If I don't release (delete) the memory dinamically allocated --> work fine.. If I use delete idx --> CRASH: "HEAP CORRUPTION DETECTED: after normal block. CRT detected that the application wrote to memory after end of heap buffer"... What you recommended me to do?

THANKS YOU!

2014-11-12 03:14:57 -0500 answered a question Stack around the variable Opencv & C++

Finally I could solve the problem.

I needed declare dinamically the int:

int *idx = nullptr;  // new pointer declared
idx = new int();    // memory dynamically allocated

Now it's working propertly!

2014-11-11 06:22:34 -0500 commented question Stack around the variable Opencv & C++

How can I share my code with you? I;m going crazy... I can;t found the error!!

THANKS YOU FOR YOUR HELP!!

2014-11-07 06:19:19 -0500 commented question Stack around the variable Opencv & C++

Thanks you very much for your answer!! The error appear when the program finish this function... Then the problem could is in everywhere in THIS function, no? This code (complete code) is working properly in a Mac... I don't understand why it fail in Windows (VS2013)... Thanks you!!

2014-11-07 04:45:36 -0500 asked a question Stack around the variable Opencv & C++

Hi! I'm working in a project with particle filter. This is a snippet of my code. When the program is executing, when leave this function VS2013 tell me a error: "Run-Time Check Failure #2 - Stack around the variable 'idx' was corrupted." Do you want any idea what is the problem??

Thanks you!

PS: additional info. If I execute the program in release mode it problem disappear...

void Particles::mergeClusters(cv::Mat image) {

    cv::Mat ids_new(0, 0, CV_32SC1);
    cv::Mat means_new(0, 0, CV_64FC1);
    vector<cv::Mat> covs_new(0);
    cv::Mat weights_new(0, 0, CV_64FC1);

    cv::Mat ids(0, 0, CV_32SC1);
    cv::Mat means(0, 0, CV_64FC1);
    vector<cv::Mat> covs(0);
    cv::Mat weights(0, 0, CV_64FC1);

    // temporary objects used to store non-chosen elements
    // this is the set I in the paper of Vo (Table II)
    clusters.ids.copyTo(ids);
    clusters.means.copyTo(means);
    clusters.covs.swap(covs);
    clusters.weights.copyTo(weights);

    int l = 0;
    while (!means.empty()) {

        cv::Mat means_t(0, 0, CV_64FC1);
        cv::Mat weights_t(0, 0, CV_64FC1);
        vector<cv::Mat> covs_t(0);

        int idx = 0;
        cv::minMaxIdx(weights, NULL, NULL, NULL, &idx);

        cv::Mat m_t(0, 0, CV_64FC1);
        cv::Mat w_t(0, 0, CV_64FC1);
        vector<cv::Mat> c_t(0);

        vector<int> L(0);

        for (int j=0; j<means.rows; j++) {
            cv::Mat u = (means.row(j)-means.row(idx)) * covs[j].inv() * (means.row(j)-means.row(idx)).t();
            if (u.at<double>(0) <= param.U) {
                m_t.push_back(means.row(j));
                w_t.push_back(weights.row(j));
                c_t.push_back(covs[j]);
                L.push_back(j);
            }
            else {
                means_t.push_back(means.row(j));
                weights_t.push_back(weights.row(j));
                covs_t.push_back(covs[j]);
            }
        }

        // Weight
        double W = sum(w_t)[0];
        // Mean
        cv::Mat M(0, 0, CV_64FC1);
        cv::repeat(w_t, 1, m_t.cols, M);
        cv::multiply(M, m_t, M);
        cv::reduce(M, M, 0, CV_REDUCE_SUM);
        cv::divide(M, W, M);
        // Covariance
        cv::Mat C(0, 0, CV_64FC1);
        C = cv::Mat::zeros(covs[0].rows, covs[0].cols, CV_64FC1);
        for (int k=0; k<m_t.rows; k++) {
            C = C + w_t.at<double>(k) * (covs[k] + ((M-m_t.row(k)).t() * (M-m_t.row(k))) );
        }
        cv::divide(C, W, C);

        ids_new.push_back(idx);
        means_new.push_back(M);
        covs_new.push_back(C);
        weights_new.push_back(W);

        l++;

        // update I
        means.release();
        weights.release();
        covs.clear();

        means_t.copyTo(means);
        weights_t.copyTo(weights);
        covs_t.swap(covs);

        means_t.release();
        weights_t.release();
        covs_t.clear();
    }

    ids_new.copyTo(clusters.ids);
    means_new.copyTo(clusters.means);
    weights_new.copyTo(clusters.weights);
    covs_new.swap(clusters.covs);
}
2014-11-03 05:05:34 -0500 commented question Change settings Prosilica camera Vimba C++

I know it... but the VIMBA SDK documentation is very bad!! I did it!... res = m_pCamera->GetFeatureByName( "ExposureTimeAbs", featPtr ); featPtr->SetValue(EXPOSURE );

2014-11-03 04:26:25 -0500 asked a question Change settings Prosilica camera Vimba C++

Good morning everyone! Currently I have working a prosilica ethernet camera (GC1020C) with API vimba in VS2010. I catch a frame, process it and iterate it.

I want change some camera settings. For example I want change the EXPOSURE TIME. Someone can help me with this task!?? I can't find a good documentation about this things...

THANKS YOU VERY MUCH!!!

2014-10-29 04:37:25 -0500 commented question Change resolution Prosilica Camera OpenCV

If I try change the resolution in "AVT Vimba Viewer" and change the actual resolution (the max: 1024 x 768) to another, for example 640x480 the software dont resize the image... the software CROP the image!! Is it normal? :S

I will want know how affect each parameter to the algorithm:

hog.detectMultiScale(image, found, -0.4, cv::Size(8,8), cv::Size(32,32), 1.05, 2);
  • image: is the image found: the detections
  • -0.4: threshold
  • Size(8,8) --> win_stride, what is it? How affect?
  • Size(32,32) --> padding , what is it? How affect?
  • 1.05 --> rescale for image pyramid
  • 2 --> group_threshold , what is it? How affect?

THANKS YOU!!

2014-10-28 09:55:57 -0500 commented question Change resolution Prosilica Camera OpenCV

Of course. Currently the camera is working with #include <VimbaCPP/Include/VimbaCPP.h> (Vimba), no PvAPI. Do you know how can change resolution with vimba in CPP? THANKS YOU!

2014-10-28 09:40:19 -0500 asked a question Change resolution Prosilica Camera OpenCV

Hello, I need our wisdom another time!

I have Prosilica GC1020C Camera (Gethernet) working in my project VS2010 with OpenCV but I want CHANGE resolution frame for example to 360x240 or 480x320.

How can I do this!? I don't find documentation about CPP OpenCV y prosilica camera :(

THANKS YOU!! :)