我想在我确定的坐标处将图像放置在捕获的视频帧上。
我之前问过,我被告知使用 cvCopy
和 cvSetImageROI
但我不想在那些坐标上裁剪我想添加另一个图像。
也许这是正确的方法,但我不明白(如果正确请解释)。
最佳答案
我刚才用 SetRoi 做了这个,它是这样的。我有两张图片,一张是名为 thumb_frame 的缩略图,它是我将包含在大图片 show_frame 中的小图片
//I set the ROI to the same size as the thumb_frame
cvSetImageROI(show_frame.image, cvRect(thumbnail_x_pos,
thumbnail_y_pos, thumb_frame->width, thumb_frame->height));
//I add the image to the designated ROI
cvAddWeighted(thumb_frame, alpha, show_frame, beta, 0, show_frame);
就是这样。
关于c++ - 在图像上放置图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1571683/