srobo / libkoki

A computer vision library for detecting and estimating the position of fiducial markers
GNU General Public License v3.0
7 stars 7 forks source link

Fails with higher-resolution images #8

Open sersorrel opened 5 years ago

sersorrel commented 5 years ago

In RoboCon 2018, we ran into an issue with libkoki when using the Raspberry Pi camera module, which can produce significantly higher-resolution images than the webcams SR typically use can. libkoki would intermittently fail this assertion:

https://github.com/srobo/libkoki/blob/5b3c679c1f84b8fae9ab3cc5a93125dc58643a85/src/labelling.c#L277-L278

The fix we used is systemetric/libkoki@d84c77f119ff6f98f5862d0ef1b5200464228227, which just changes label_t from a 16-bit uint to a 32-bit uint and bumps KOKI_LABEL_MAX accordingly. I had (and still have) no idea if that's the correct thing to do, or if anything else needs changing as a result of that, but it seemed to work for us :)

No opinion on whether you should take this change or not, mostly just wanted to document an issue that we ran into.

(before shelling out for better cameras for SR, it's probably worth checking if high-resolution images actually help the marker recognition at all; I don't remember what the conclusion from my year of RoboCon was, but from what I've heard from this year, it's not clear if increasing the resolution actually has any effect apart from making it slower)

rgilton commented 5 years ago

Aye, I have used a similar fix for similar things in the past (processing images from a DSLR). Thanks for reporting the problem. I will dig out my patches for this. We can't just ship this immediately, as it will have a performance impact that needs assessing.