TIDAL-Lab / TopCodes

Tangible Object Placement Codes: A simple computer vision fiducial library for tangible interaction.
GNU General Public License v2.0
27 stars 18 forks source link

Slow Video Framerate for Mobile Devices (Javascript) #3

Open Addict-of-Rice opened 1 week ago

Addict-of-Rice commented 1 week ago

Greetings, I am trying to make use of topcodes.js in a React project. I've managed to successfully implement the scanner on the computer and am very happy with the results. The scanner also works on mobile devices, but the framerate is very low. I suspect that it could be due to the scanner demanding processing power from a weaker system. I'm not sure if it is a processing power issue, and I'm quite lost as to why the framerate is so bad on the phone. I am unable to modify or understand the scanner's logic in topcodes.js as the code seems to be obfuscated. I would like to modify topcodes.js so that i can specify a "sleep" delay between the processing of the video stream in order to help with performance.

Addict-of-Rice commented 1 week ago

I just tried a different browser and it is working much better. Not sure as to why Chrome performs so poorly.

cesarviana commented 1 week ago

I'm not sure about your use case, but if frame rate is really important I think c++ is the best choice. Here is the link of a project I worked on where I used this native android + cpp. https://github.com/cesarviana/rope_ar/tree/master/app/src/main/cpp

Addict-of-Rice commented 3 days ago

Thanks for you suggestion. Unfortunately, I have been asked to recreate it as a mobile website. A native android version of the app already exists and works well. I've tried Microsoft Edge, Chrome Dev, Safari and Samsung Internet. They all seem to perform decent regarding the camera, but for some reason across different devices, Chrome for mobile does not perform well at all.