Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nftSimple tracking not working on linux #173

Open
subjectdenied opened this issue Jan 19, 2020 · 9 comments
Open

nftSimple tracking not working on linux #173

subjectdenied opened this issue Jan 19, 2020 · 9 comments

Comments

@subjectdenied
Copy link

i just tried this example on linux using my laptop webcam on a xps13 9380, and it doesnt do any tracking. however when trying the asm examples using jsartoolkit5, the cam has no problem tracking the famous pinball image. tried released binaries as well as compiling myself

@kalwalt
Copy link

kalwalt commented Jan 23, 2020

Hi @subjectdenied do you receive some message from the console? Note that for jsartoolkit5 we can't use the same code because is multithreaded. We use a modified version. Maybe wasn't enabled the -pthread flag during compilation? i don't know... just making supposition.

@subjectdenied
Copy link
Author

hi, no there is no error, it just doesnt seem to detect the image at all, while telling me that 8 threads for tracking where started. i get however an error when the v4l2 cam is initialzed, telling about an ioctl error, so i guess it has something to do with with the webcam-support in linux using v4l2

btw this project is amazing (but sadly doesnt get the love from opensource-community that it would deserve), and i really want to congratulate you guys for getting NFT working on the web - this is an amazing achievement

@kalwalt
Copy link

kalwalt commented Jan 23, 2020

Thank you @subjectdenied ! It was a collective effort! Btw i had a similar issue trying the tracking2d (with artoolkitX) feature under Linux, no errors in the console only an error regarding the camera as you said. I have fear that Artoolkit5 under Linux is not well tested...

@kalwalt
Copy link

kalwalt commented Jan 23, 2020

@subjectdenied should test also the other examples if the issue persist also for the simple example , maybe is something is broken for Linux OS.

@subjectdenied
Copy link
Author

i looked into the v4l2 code a bit, and i think that values regarding cam capabilities (brightness, saturation, ...) are wrongly parsed which then leads to this ioctl error. i might try to fix this, if i can find the time

yes it is a problem with every example, also debugging mode in simpleTest doesn't refresh, but only shows the first frame always

@kalwalt
Copy link

kalwalt commented Jan 23, 2020

i looked into the v4l2 code a bit, and i think that values regarding cam capabilities (brightness, saturation, ...) are wrongly parsed which then leads to this ioctl error. i might try to fix this, if i can find the time

yes it is a problem with every example, also debugging mode in simpleTest doesn't refresh, but only shows the first frame always

Good to know, ping me if you have an update on this.

@subjectdenied
Copy link
Author

@kalwalt actually i fixed it, first it doesnt work at all with v4l2, you have to use the gstreamer pipe like this (this is for my notebook-webcam)

nftSimple -device=GStreamer "v4l2src device="/dev/video0" ! videoconvert ! video/x-raw,format=RGB,width=640,height=480,framerate=30/1 ! identity name=artoolkit sync=true ! fakesink"

but there is also another issue with cli-args (precisely the gstreamer arg) not parsed correctly, the beginning of main in nftSimple has to look like this (it is exactly how simpleTest is parsing the args):

'
...
int main(int argc, char** argv)
{
char glutGamemode[32];
char *cparam_name = NULL;
char vconf[512];
const char markerConfigDataFilename[] = "Data2/markers.dat";
int i;

if( argc == 1 ) vconf[0] = '\0';
else {
    strcpy( vconf, argv[1] );
    for( i = 2; i < argc; i++ ) {strcat(vconf, " "); strcat(vconf,argv[i]);}
}

#ifdef DEBUG
arLogLevel = AR_LOG_LEVEL_DEBUG;
#endif

//
// Library inits.
//

glutInit(&argc, argv);

...
'

after that the pinball image works showing a small cube

@kalwalt
Copy link

kalwalt commented Jan 25, 2020

Glad to know! It will be nice to fix this in the repo, and maybe testing with the other OS (Mac and Windows) @ThorstenBux can you take a look at? I would also test your changes @subjectdenied

@kalwalt
Copy link

kalwalt commented Feb 13, 2020

@subjectdenied i tested the binaries from https://github.com/artoolkitx/artoolkit5/releases/tag/5.4.0 an i have the same result, no errors and no tracking. I will test and try to rebuild the project with your proposed changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants