Memory Leak in V2.0 in cvDecomposeProjectionMatrix (Bug #2041)
Description
in cvDecomposeProjectionMatrix the call to cvGetCols modifies the data address of tmpMatrix here's the fix:
....
CvMat tmpMatrixSquare;//MY FIX HERE TO PREVENT MEMORY LEAK (was using tmpMatrix but that already has memory allocated
cvGetCols(projMatr, &tmpMatrixSquare, 0, 3); // M is first square matrix of P.
assert(cvDet(&tmpMatrixSquare) != 0.0); // So far only finite cameras could be decomposed, so M has to be nonsingular [det(M) != 0].
cvRQDecomp3x3(&tmpMatrixSquare, calibMatr, rotMatr, rotMatrX, rotMatrY, rotMatrZ, eulerAngles);
....
Your welcome! cost me a day
by the way v2.4 leaks like a sieve so I just went back to 2.0 and fixed that.
Related issues
duplicates Bug #2042: Memory Leak in V2.0 in cvDecomposeProjectionMatrix | Cancelled | 2012-06-13 |
Associated revisions
Merge pull request #2041 from ilya-lavrenov:tapi_mul_div
History
Updated by Andrey Kamaev over 12 years ago
Duplicate.
- Status changed from Open to Cancelled
- Category set to trash