I'm trying to figure out a good way of encoding object segmentation data into a single RGBA image. I'd like to not only distinguish between classes, but also individuals within classes, and be able to have multiple classes and objects per pixel.
For example, I could have a pixel represent both "road sign" and "speed sign" classes, as well as indicating that the particular collection of pixels belongs to one individual.
Is the pairing function my best bet? How would I calculate the maximum number of classes and objects I could encode in a 32bit value? I guess I'm looking for a reversible 32 bit hash function.