WinSize = 105;
filter = double(zeros(WinSize,WinSize));
filter(:,:) = 1/(WinSize*WinSize);

alphaB = imfilter(double(bMask),filter);

alphaB3 = cat(3,alphaB,alphaB,alphaB);

output = uint8(double(source).*alphaB3 + (double(target)-double(target).*alphaB3));

imshow(output);