资源描述:
《opencv矩阵操作函数源代码》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、/*////////////////////////////////////////////////////////////////////////CvMat,CvMatND,CvSparceMatandIplImagesupportfunctions//(creation,deletion,copying,retrievingandsettingelementsetc.)////*/#include"_cxcore.h"staticstruct{Cv_iplCreateImageHeadercreateHead
2、er;Cv_iplAllocateImageDataallocateData;Cv_iplDeallocatedeallocate;Cv_iplCreateROIcreateROI;Cv_iplCloneImagecloneImage;}CvIPL;//MakesthelibraryusenativeIPLimageallocatorsCV_IMPLvoidcvSetIPLAllocators(Cv_iplCreateImageHeadercreateHeader,Cv_iplAllocateImageDataa
3、llocateData,Cv_iplDeallocatedeallocate,Cv_iplCreateROIcreateROI,Cv_iplCloneImagecloneImage){CV_FUNCNAME("cvSetIPLAllocators");__BEGIN__;if(!createHeader
4、
5、!allocateData
6、
7、!deallocate
8、
9、!createROI
10、
11、!cloneImage){if(createHeader
12、
13、allocateData
14、
15、deallocate
16、
17、createROI
18、
19、
20、cloneImage)CV_ERROR(CV_StsBadArg,"Eitherallthepointersshouldbenullor""theyallshouldbenon-null");}CvIPL.createHeader=createHeader;CvIPL.allocateData=allocateData;CvIPL.deallocate=deallocate;CvIPL.createROI=createROI;CvIPL.cloneImage=cloneImage;otherstaffofth
21、eCentre.Duringthewar,ZhuwastransferredbacktoJiangxi,andDirectorofthenewOfficeinJingdezhen,JiangxiCommitteeSecretary.Startingin1939servedasrecorderoftheWestNorthOrganization,SecretaryoftheSpecialCommitteeAfterthevictoryofthelongMarch,hehasbeentheNorthwestOffic
22、eoftheFederationofStateenterprisesMinister,ShenmufuguSARmissions,DirectorofNingxiaCountypartyCommitteeSecretaryandrecorderoftheCountypartyCommitteeSecretary,Ministersand__END__;}/********************************************************************************
23、*********CvMatcreationandbasicoperations*****************************************************************************************///CreatesCvMatandunderlyingdataCV_IMPLCvMat*cvCreateMat(intheight,intwidth,inttype){CvMat*arr=0;CV_FUNCNAME("cvCreateMat");__BE
24、GIN__;CV_CALL(arr=cvCreateMatHeader(height,width,type));CV_CALL(cvCreateData(arr));__END__;if(cvGetErrStatus()<0)cvReleaseMat(&arr);returnarr;}staticvoidicvCheckHuge(CvMat*arr){if((int64)