我在OpenCV的两个图像:图像甲和图像B.
图像A是来自摄像机的输出帧.
图像B是通过掩蔽一个图像获得的阿尔法透明图像.
在屏蔽图像B之前,它会被扭曲cvWarpPerspective()
cvAddWeighted()
-当你给出alpha和beta值时,它会失去强度请帮我解决混合后输出图像中没有强度损失的问题.
提前致谢
我终于得到了答案。它由 5 个步骤组成......
步骤1
cvGetPerspectiveTransform(q,pnt,warp_matrix);
//where pnt is four point x and y cordinates and warp_matrix is a 3 x 3 matrix
Run Code Online (Sandbox Code Playgroud)
第2步
cvWarpPerspective(dst2, neg_img, warp_matrix,CV_INTER_LINEAR)
//dst2 is overlay image ,neg_img is a blank image
Run Code Online (Sandbox Code Playgroud)
步骤 - 3
cvSmooth(neg_img,neg_img,CV_MEDIAN); //smoothing the image
Run Code Online (Sandbox Code Playgroud)
步骤4
cvThreshold(neg_img, cpy_img, 0, 255, CV_THRESH_BINARY_INV);
//cpy_img is a created image from image_n
Run Code Online (Sandbox Code Playgroud)
步骤 - 5
cvAnd(cpy_img,image_n,cpy_img);// image_n is a input image
cvOr(neg_img,cpy_img,image_n);
Run Code Online (Sandbox Code Playgroud)
输出 - image_n(不损失输入图像的强度)
归档时间: |
|
查看次数: |
3328 次 |
最近记录: |