ct);

// Create a mask of logo and create its inverse mask also
cv.cvtColor(logo, mask, cv.COLOR_RGBA2GRAY, 0);
cv.threshold(mask, mask, 100, 255, cv.THRESH_BINARY);
cv.bitwise_not(mask, maskInv);

// Black-out the area of logo in ROI
cv.bitwise_and(roi, roi, imgBg, maskInv);

// Take only region of logo from logo image
cv.bitwise_and(logo, logo, imgFg, mask);

// Put logo in ROI and modify the main image
cv.add(imgBg, imgFg, sum);

dst = src.clone();
for (let i = 0; i < logo.rows; i++) {
    for (let j = 0