mkalten / reacTIVision

computer vision framework for tangible interactive surfaces
Other
308 stars 65 forks source link

Yamaarashi symbols giving 0, 0 coordinates #40

Closed DavidGasku closed 2 years ago

DavidGasku commented 3 years ago

Testing the new Yamaarashi symbols, they are detected, but give 0, 0 position, so their numbers appear together at top left corner of the screen.

this is the verbose output:

set obj 0 (80) 0 0 3.89442 0 0 0.117961 0 3.3703 set obj 0 (80) 0 0 3.89442 0 0 0 0 -3.18812 set obj 0 (80) 0 0 3.91981 0 0 0.0985694 0 2.40413

DavidGasku commented 3 years ago

Ok, I found the error in FidtrackFinder.cpp (line 493)

if ((pixel>=0) || (pixel<width*height)) {
    yama->x = dmap[ pixel ].x/width;
    yama->y = dmap[ pixel ].y/height;
}

there should be a float cast. Btw, shouldn't the guard be &&, as we are basically making sure that the index exists?

I changed my version to the following code, and it works fine:


if ((pixel>=0) && (pixel<width*height)) {
    yama->x = dmap[ pixel ].x/(float)width;
    yama->y = dmap[ pixel ].y/(float)height;
}
mkalten commented 2 years ago

Thanks for the heads up ... fixed that.