I m using opencv and c++ to save an image's pixels in a file, now i want to restore the image in order to show it again. could you give some suggestions?
[update: included code from OP's comments] I'm using these loops to save my image's pixels in a file
for(int row=0; row<a;row++)
for(int col=0;col<b;col++) {
pixel[row][col]= ((uchar *)(img->imageData + row*img->widthStep))[col*img->nChannels +0];
Now i m trying to read these pixel in order to show the image
do you take all the information in img->imageData and put it in pixel in your original code ?
so, the answer of karlphillip : " you need to mempcy() the pixels read to new_image->imageData" is what i did in my code.