Save IPL_DEPTH_IMAGE for later processing
Is there a way to store an image开发者_如何学编程 with IPL_DEPTH_IMAGE depth on the hdd for later processing? If I save it with cvSaveImage or the cvBlobs render function it gets converted to 8bit and therefore not all labeled are stored ;( Thanks, Durin
Have a look at cvFileStorage. It should be able to save the IPL_DEPTH_IMAGE for you.
Here is a short example from OpenCV docs:
#include "cxcore.h"
int main( int argc, char** argv )
{
CvMat* mat = cvCreateMat( 3, 3, CV_32F );
CvFileStorage* fs = cvOpenFileStorage( "example.yml", 0, CV_STORAGE_WRITE );
cvSetIdentity( mat );
cvWrite( fs, "A", mat, cvAttrList(0,0) );
cvReleaseFileStorage( &fs );
cvReleaseMat( &mat );
return 0;
}
Hope you find that helpful!
精彩评论