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...
Opencv is used for image processing and only type described here are authorized
Have you tried to add the element directly in the Mat? Why do you need a custom object? What does it represent? Does it contains numbers? "The class Mat represents an n-dimensional dense numericalsingle-channel or multi-channel array"
Maybe you can use the template class (or OpenCV3 docs)
1)As I understand Mat object is multidimensional array mainly used for image manipulation. I wanted to represent more information about the image for each of the pixel for one of my research purpose.For me it made more sense to include the information in the pixel position if I want to mark the pixel or to store some additional information. 2)Mat is only for image manipulation? 3) Have you tried to add the element directly in the Mat? Santhosh>Yes Why do you need a custom object? What does it represent? Does it contains numbers? Santhosh>For example to flag a pixel.Or for example in case of some feature extraction of pixel.I want to store feature information at the pixel.contains no or text "The class Mat represents an n-dimensional dense numericalsingle-channel or multi-channel array