1 | initial version |
What I would do in your place is to create some additional classes that may help. For example:
an image that has some pixels marked can be represented by a mask that has non-zero values in the positions of marked pixels:
class ImageWithMask { private: cv::Mat image // initial image; cv::Mat mask; // mask that marks just the wanted pixels public: // constructor + methods };
You can also use the existent functions for manipulating the image just in the wanted pixels or not (as you can see, there are a lot of functions that have the mask parameter for applying the transformation just in special places)
You can also create another class that have information about some pixels you can create some other class that contains information about one pixel:
class PixelInfo { private: cv::Point position; std::vector< float > featureDescriptors; // ... };
But this is already implemented with keypoints and descriptors. You can extract the descriptors once for each pixel and store it in some variable.
IMHO it is not a good practice to store exhaustive information about the image in each pixel position, You'll end up with "not enough memory" problems.
What you can do about the "no or text" pixels is to use the mask; maybe you can create 2 masks if needed...