Hello ,
Im working with C++ and OpenCV. I havenĀ“t work with C++ since the unviersity, and i need to refresh some things: I have this code:
void uconstant( const CvMat* mat, int i,const CvMat *thresh,float *Wsize1) {
float fila=CV_MAT_ELEM(*mat,float,i,0);
float colum=CV_MAT_ELEM(*mat,float,i,1);
if ((thresh->rows == 1) && (thresh->cols ==1))
{Wsize1[1] = CV_MAT_ELEM(*thresh,float,0,0);
Wsize1[2] = CV_MAT_ELEM(*thresh,float,0,0);
}
else{
Wsize1[1] =CV_MAT_ELEM(*thresh,float,0,0);
Wsize1[2] =CV_MAT_ELEM(*thresh,float,0,1);
}
}
void Uniqueness(const CvMat* centre,IplImage* Img,const CvMat *thresh,const CvMat *Wthresh,int method,float *Wsize1,int i)
{
switch (method){
case 1:
uconstant(centre,i,thresh,Wsize1);
break;
}
}
// In the main program i call this function
float Wsize1[]={10,10};
for( int i=0;i< Tcentres->rows;i++){
//TWs = Uniqueness(Tcentres(t,:),Timg,Uthresh,Wthresh,Umethod);
Uniqueness(Tcentres,Timg,Uthresh,Wthresh,Umethod,Wsize1,i);
// I NEED THAT THE FUNCTION Uniqueness return a Matrix Wsize1 to copy this one to another matrix called TWs
}
Can some one help me? Thanks...
Last edited on