写一个ROI叠加的小例子
时间紧任务重,只能抽时间写一个ROI叠加的小例子了。主要用到了addWeight()方法,它的参数如下:
Parameters:
src1 first input array.
alpha weight of the first array elements.
src2 second input array of the same size and channel number as src1.
beta weight of the second array elements.
gamma scalar added to each sum.
dst output array that has the same size and number of channels as the input arrays.
dtype optional depth of the output array; when both input arrays have the same depth, dtype can be set to -1, which will be equivalent to src1.depth().
叠加的公式是:
dst = src1*alpha + src2*beta + gamma;
代码不长:
先到这里吧,拜拜~