I need to implement a function which takes an image and return a file say a text file containing a string of bytes. What I have done yet is :
#include <cv.h>
#include <highgui.h>
using namespace cv;
int main( int argc, char** argv )
{
cv::Mat image;
image = cv::imread("imaje.bmp");
if(image.empty())
return 0;
cv::imshow("Image", image);
cv::waitKey();
return 0;
}
Now I need to convert tha cv:Mat image to an array of bytes. Please guide me how to proceed??? Thanks in advance ... :)