/*************************************************
// Method: convertTo3Channels
// Description: 将单通道图像转为三通道图像
// Returns: cv::Mat
// Parameter: binImg 单通道图像对象
*************************************************/
Mat convertTo3Channels(const Mat& binImg)
{
Mat three_channel = Mat::zeros(binImg.rows,binImg.cols,CV_8UC3);
vector<Mat> channels;
for (int i=0;i<3;i++)
{
channels.push_back(binImg);
}
merge(channels,three_channel);
return three_channel;
}