void PrintMat(CvMat *A)
{
int i, j;
for (i = 0; i < A->rows; i++)
{
printf("\n");
switch (CV_MAT_DEPTH(A->type))
{
case CV_32F:
case CV_64F:
for (j = 0; j < A->cols; j++)
printf ("%8.3f ", (float)cvGetReal2D(A, i, j));
break;
case CV_8U:
case CV_16U:
for(j = 0; j < A->cols; j++)
printf ("%6d",(int)cvGetReal2D(A, i, j));
break;
default:
break;
}
}
printf("\n");
}
Some matrix operations need to be updated.
Thanks ;)
ReplyDeletethanks Weis again!
ReplyDeletecomes handy.
Thanks a lot!
ReplyDeleteIt also seems to support CV_8S, CV_16S for integer matrices.
And it can be written with more arguments: (rowBeg, rowEnd, colBeg, colEnd) to set the printing range, with default arguments being the entire matrix.
Thank you, this is useful
ReplyDeletevery useful code! Thanks a lot.
ReplyDeleteThank you!
ReplyDeletethank you so much. Good code
ReplyDelete