int cvAdd4cMat(cv::Mat &dst, cv::Mat &scr, double scale)
{
if (dst.channels() != 4 || scr.channels() != 4)
{
return true;
}
if (scale < 0.01)
return false;
std::vector<cv::Mat>scr_channels;
std::vector<cv::Mat>dstt_channels;
split(scr, scr_channels);
split(dst, dstt_channels);
CV_Assert(scr_channels.size() == 4 && dstt_channels.size() == 4);
if (scale < 1)
{
scr_channels[3] *= scale;
scale = 1;
}
for (int i = 0; i < 3; i++)
{
dstt_channels[i] = dstt_channels[i].mul(255.0 / scale - scr_channels[3], scale / 255.0);
dstt_channels[i] += scr_channels[i].mul(scr_channels[3], scale / 255.0);
}
merge(dstt_channels, dst);
return true;
}
char* srv_cfgpath=".";
void gen_licenseplate(char* numbers)
{
if(numbers[0]== 0x0)
{
char filename[1024];
snprintf(filename, 1024, "%s/%s/%s", srv_cfgpath,SRV_CAR_MODEL_PATH,
"licenseplate.bmp");
cv::Mat zeroMat(cv::Size
OpenCV 车牌号图片生成
最新推荐文章于 2025-08-04 18:48:37 发布