| 1642 | |
| 1643 | |
| 1644 | CV_IMPL double |
| 1645 | cvDet( const CvArr* arr ) |
| 1646 | { |
| 1647 | if( CV_IS_MAT(arr) && ((CvMat*)arr)->rows <= 3 ) |
| 1648 | { |
| 1649 | CvMat* mat = (CvMat*)arr; |
| 1650 | int type = CV_MAT_TYPE(mat->type); |
| 1651 | int rows = mat->rows; |
| 1652 | uchar* m = mat->data.ptr; |
| 1653 | int step = mat->step; |
| 1654 | CV_Assert( rows == mat->cols ); |
| 1655 | |
| 1656 | #define Mf(y, x) ((float*)(m + y*step))[x] |
| 1657 | #define Md(y, x) ((double*)(m + y*step))[x] |
| 1658 | |
| 1659 | if( type == CV_32F ) |
| 1660 | { |
| 1661 | if( rows == 2 ) |
| 1662 | return det2(Mf); |
| 1663 | if( rows == 3 ) |
| 1664 | return det3(Mf); |
| 1665 | } |
| 1666 | else if( type == CV_64F ) |
| 1667 | { |
| 1668 | if( rows == 2 ) |
| 1669 | return det2(Md); |
| 1670 | if( rows == 3 ) |
| 1671 | return det3(Md); |
| 1672 | } |
| 1673 | return cv::determinant(cv::Mat(mat)); |
| 1674 | } |
| 1675 | return cv::determinant(cv::cvarrToMat(arr)); |
| 1676 | } |
| 1677 | |
| 1678 | |
| 1679 | CV_IMPL double |
nothing calls this directly
no test coverage detected