| 5529 | |
| 5530 | |
| 5531 | void read( const FileNode& node, Mat& mat, const Mat& default_mat ) |
| 5532 | { |
| 5533 | if( node.empty() ) |
| 5534 | { |
| 5535 | default_mat.copyTo(mat); |
| 5536 | return; |
| 5537 | } |
| 5538 | void* obj = cvRead((CvFileStorage*)node.fs, (CvFileNode*)*node); |
| 5539 | if(CV_IS_MAT_HDR_Z(obj)) |
| 5540 | { |
| 5541 | Mat((const CvMat*)obj).copyTo(mat); |
| 5542 | cvReleaseMat((CvMat**)&obj); |
| 5543 | } |
| 5544 | else if(CV_IS_MATND_HDR(obj)) |
| 5545 | { |
| 5546 | Mat((const CvMatND*)obj).copyTo(mat); |
| 5547 | cvReleaseMatND((CvMatND**)&obj); |
| 5548 | } |
| 5549 | else |
| 5550 | { |
| 5551 | cvRelease(&obj); |
| 5552 | CV_Error(CV_StsBadArg, "Unknown array type"); |
| 5553 | } |
| 5554 | } |
| 5555 | |
| 5556 | void read( const FileNode& node, SparseMat& mat, const SparseMat& default_mat ) |
| 5557 | { |
no test coverage detected