寫教學的最大目的是教會未來的自己

OpenCV SURF 儲存方式

資料來源http://blog.csdn.net/lovenessless/article/details/8077012

 

 

//objectKeypoints這些都是cvSeq*   即cvSeq指針

 

CvFileStorage *fs;

fs = cvOpenFileStorage("data.xml", storage, CV_STORAGE_WRITE);

//open file cvWrite(fs, "objectKeypoints", objectKeypoints);

cvWrite(fs, "objectDescriptors", objectDescriptors);

cvWrite(fs, "imageKeypoints", imageKeypoints);

cvWrite(fs, "imageDescriptors", imageDescriptors);

cvReleaseFileStorage(&fs);

 

 

讀取:

 

//objectKeypoints這些都是cvSeq*   即cvSeq指針

    

CvFileStorage *fs;

 

    fs = cvOpenFileStorage("data.xml", storage, CV_STORAGE_READ);

    objectKeypoints = (CvSeq*) cvReadByName(fs, 0, "objectKeypoints");

    objectDescriptors = (CvSeq*)cvReadByName(fs, 0, "objectDescriptors",0);

    imageKeypoints = (CvSeq*)cvReadByName(fs, 0, "imageKeypoints",0);

    imageDescriptors = (CvSeq*)cvReadByName(fs, 0, "imageDescriptors",0);

 

    cvReleaseFileStorage(&fs);

 

 

Post to Twitter Post to Plurk Post to Facebook Send Gmail

發表迴響

Copyright © 2019. All Rights Reserved.

歡迎光臨
初音