Mat Type Coherence: always returning CV_64FC1 Mat (Feature #443)
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!!!
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.
Ubuntu Linux 9.10, OpenCV 2.1, g++ 4.4.1