t-oster / VisiCam

A Java application, that turns a webcam into a VisiCut compatible network camera with marker detection and perspective correction. Uses OpenCV through JavaCV
Other
36 stars 12 forks source link

Cache response, always update homography matrix except on Raspi #25

Closed mgmax closed 7 years ago

mgmax commented 8 years ago

I spent some time on implementing a special kind of caching, so that multiple concurrent requests are answered with the same response. I'm not sure if this works on Raspi because the intermediate results need some RAM and some copy operations are probably rather CPU expensive.

If the raspi integration is not active, the code now always calculates the homography matrix for the current image, as it did before the raspi integration was merged in. I'd like to explain the reason behind this change: When testing the previous version it was very annoying that even for the smallest possible value of refreshSeconds the homography matrix is calculated for the previous image (because an extra image is being taken) and there is a large delay between updates. Because our camera is attached to the lasercutter lid that often moves a bit, you had to wait a long time until the image was stable and inbetween wrong images were displayed.

I tested the code locally with 6+ VisiCut instances as clients and a dummy shellscript serving four different pictures with different distortion.

mgmax commented 8 years ago

Please feel free to wait a bit before merging, we @fau-fablab will test this and report if it works good enough.

mgmax commented 7 years ago

We've been testing this for about two years now, and it works well. Please consider merging.

t-oster commented 7 years ago

Hi, please rebase, so in can merge fast forward

mgmax commented 7 years ago

Is now rebased and tested.