zk00006 / OpenTLD

OpenTLD is an open source library for real-time 2D tracking of a single object in video. This repository is no longer under development. For latest version see: http://www.tldvision.com/tld2.html
GNU General Public License v3.0
2.09k stars 1.27k forks source link

Bug with the Key Events #20

Open waczkor opened 13 years ago

waczkor commented 13 years ago

Hy

The key event doesn't work for me properly. If I callback is on, it shuts down on any key event. But if I comment it out, it doesn't react at all, but it think function handleKey(~, evnt) should work (tdldemo.m). How can I make this work like in the demo?

And one more thing, I'd like to follow the detection with the cursor, how can I get out the cordinates? I thought maybe I could use the center of the bbox with an other extra cpp (winapi SetCursorPos), but it doesn't work. I mean if I use even const in the SetC..Pos call, it puts the cursor on the left-upper corner (position zero-zero). Do you have any Idea about this?

My idea: In the tdldisplay.m I call bb_cent for the cp.

plot(cp(1,:),cp(2,:),'.','color','red'); bb_cent(cp);

bb_cent looks like this:

include

include "mex.h"

void bb_cent(double *bb1) {

int _x = bb1[0];
int _y = bb1[1];
SetCursorPos(_x, _y);

}

void mexFunction(int nlhs, mxArray plhs[], int nrhs, const mxArray prhs[]) {

switch (nrhs) {

    case 0: {
        mexPrintf("Not enough argument");
        return;
            }

    case 1: {
        // Input
        double *bb1 = mxGetPr(prhs[0]);
        //bb_cent(bb1);
        SetCursorPos(900,450);
        return;
            }
}

} But It doesn't put the cursor to the right point just only to the zero-zero. What causes this error? :S

TheMrtN commented 13 years ago

When using run_TLD.m, TLD quits at any keypress. If you comment out the event handler, it does not. That's the expected behavior.

So what is the bug you are talking about?

waczkor commented 13 years ago

I mean the control keys are expected to work. Or not?

2011/7/8 TheMrtN < reply@reply.github.com>

When using run_TLD.m, TLD quits at any keypress. If you comment out the event handler, it does not. That's the expected behavior.

So what is the bug you are talking about?

Reply to this email directly or view it on GitHub: https://github.com/zk00006/OpenTLD/issues/20#issuecomment-1531296

TheMrtN commented 13 years ago

Do you mean the control keys like N, P, #, Q among others? They are no control keys if you run run_TLD.m, because they quit the application (as you have seen). However, if you run other/run_TLD_demo.m, the keys work like you want them to. The difference is that this script uses tldDemo() in stead of tldExample().