Mat Type Coherence: always returning CV_64FC1 Mat (Feature #443)
Description
When porting my code from C to C++, I noticed that some C++ functions like:
cv::findHomography() or cv::getAffineTransform()
always return a CV_64FC1 cv::Mat, even when passing float (CV_32FCx) data.
Furthermore the cv::findHomography() and cv:convertPointsHomogeneous() only take CV_32 data (Mats).
So when writing code one has to take always care of the type and perform conversions such as:
H=findHomography(ptsA,ptsB,CV_RANSAC,0.05); //returns a CV_64FC1!!!
H.convertTo(H,CV_32FC1,1,0);
In order to perform other algebraic operations without getting a type mismatch error.
This did not happen with corresponding C functions, that where much more flexible (you could pass both double and float CvMat) and coherent (32->32 and 64->64).
I would like to do all my computations with double precision numbers (CV_64) but I cannot because some of these functions do not manage double, but only float data (so why do they return double in many cases??).
Could you please make this function type independent, or at least overload them in a way that also CV_64 data may be taken as input and the type returned is coherent with the input type? Also having back the same flexibility of cvConvertPointHomogeneous would not be bad.
Thanks
Vito
Ubuntu Linux 9.10, OpenCV 2.1, g++ 4.4.1
History
Updated by Alexander Shishkov over 1 year ago
- Description changed from When porting my code from C to C++, I noticed that some C++ functions like: ... to When porting my code from C to C++, I noticed that some C++ functions like: ... More
Updated by Vadim Pisarevsky about 1 year ago
let's lower priority of the task and postpone it till the next release
- Target version set to 3.0
- Priority changed from High to Low
- Assignee set to Vadim Pisarevsky