How to detect a mirrored image?

Hello,

I’m using multiple line cameras to capture images from objects on a moving conveyor belt. Depending on which camera and its configuration, it sometimes happens that the image is mirrored along one axis. This makes image detection of surface markers such as ArUco or QR codes difficult since they can’t be detected when they are mirrored.

Are there any markers that can easily be detected when they are mirrored and allow identification of a mirrored image?

uh, you could run your detection on the mirrored image. that’s 2x the original execution cost, for zero effort to implement.

cheaper to execute, but more effort to implement (or find impls): both QR and aruco detect the same if they’re mirrored. it’s just the decoding where it would need to try a mirrored bit pattern if the straight pattern doesn’t decode. that ought to be cheap to execute because the expensive part is finding the things and reading the patterns from the image.

I don’t know of libraries that do it (I’m not remotely omniscient, there might be ones). if you can’t find one that does it, you could pick one that doesn’t, but looks easy to hack. then just hack it to do that.

why would that line scan camera’s data be mirrored? can you check that once during physical setup, and then always mirror it? or flip a bit in its configuration so it stops doing that? I’m sure those things have at least that much config in them.

True, running the detection on the mirrored image is the easiest solution. Not the most elegant, but it definitely works. Thanks for your input.

I don’t think I currently have to skills to dive into bit battern generation or detection. I only know python, no C++.

You’d be surprised by how janky some cameras can be. We are using one where you can’t even set it to trigger only on every n-th trigger signal. Since we plan to sell that setup to different customers we expect some cameras to record mirrored sometimes, that’s why an automatic detection would be handy.