convertTo from CV_32f to CV_8U
I want to do a bilateral filter and my image has to be type CV_8UC1/C3 for this.
To convert it would appear I have to use convertTo, but this is simply not working.
This is what I am doing:
Mat Temp= Mat(CurrentMat.size(),CV_8U);
CurrentMat.convertTo(Temp,CV_8UC3);
Mat Result=Temp.clone();
qDebug()<<CV_8UC1<<CV_8UC3;
qDebug()<<"Type"<<Temp.type()<<Result.type()<<CurrentMat.type();
qDebug()<<"Data"<<Result.data<<CurrentMat.data;
bilateralFilter ( CurrentMat, Result, 5, 15, 15 );
Via the output I can clearly see that the type of Temp is 24 and not 0 or 16 which it should become.
Appreciated.