The addWeighted function can be defined as cv2.addWeighted(src1, alpha, src2, beta, gamma[, dst[, dtype]]) → dst
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. dst – output array that has the same size and number of channels as the input arrays. gamma – scalar added to each sum. 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().
but in case of image addition src1 and src2 will be the two images we want to add .. How these images are converted into arrays ? as addweighted takes argument in terms of arrays