I am currently trying to write a C++ program that is able to extract ROI from the Y component of an image and watermark that particular ROI.
I am currently stuck at the implementation of the watermarking technique.
Upon further research , I saw the addweighted function in OpenCV and I understand that it is an implementation of linear blending.
What i want to ask is that is alpha blending considered something like a spatial addition between the pixel of the original image and the watermark ?
If not , could anyone explain the difference between alpha blending and a spatial addition between two images ?
Thank you in advance for any help rendered.
I’m not 100% what “spatial addition” is in this case (and google wasn’t particularly helpful), but I do understand alphablending.
If we have two images,
AandB, then the resulting imageR, when blending with alphaa:r[x, y] = a * A[x, y] + (1-a) * B[x,y];So, basically, adding the pixel colours together, and blending a proportion of each image. Here we’re talking about RGB colours, I have absolutely no idea what happens if you do this in YUV colours – I’m sure there is some way of achieving the same thing – and it may even be called “spatial addition”. But all the graphics projects I’ve worked on that use alpha blending have been using RGB as the intermediate terms [at least in the parts that I’ve touched].
I’m hoping that by describing the process, it helps you understand alphablending, and by that understand what you need to do, whether in RGB or some other format.