diff --git a/chromakey/alpha.png b/chromakey/alpha.png index 7408e26..3c2bf66 100644 Binary files a/chromakey/alpha.png and b/chromakey/alpha.png differ diff --git a/chromakey/bluescreen.m b/chromakey/bluescreen.m index f50c82d..d0827c1 100644 --- a/chromakey/bluescreen.m +++ b/chromakey/bluescreen.m @@ -28,7 +28,7 @@ im = im2double(imread(img_name)); im_rgb = imresize(im, 1); se = strel('square',3) -ref_rgb = toRef([0 0.5 1], size(im_rgb)); +ref_rgb = toRef([0.0 0.5 0.95], size(im_rgb)); close all; @@ -36,11 +36,11 @@ figure; imshow(ref_rgb); figure; -despilled_rgb_matte = im_rgb - k_sb*ref_rgb; +despilled_rgb_matte = max(0, im_rgb - k_sb*ref_rgb); imshow(despilled_rgb_matte); figure; -despilled_rgb = im_rgb - k_ds*ref_rgb; +despilled_rgb = max(0, im_rgb - k_ds*ref_rgb); imshow(despilled_rgb); figure; @@ -55,6 +55,10 @@ figure; edges = coloredges(despilled_rgb_matte, ref_rgb); imshow(edges); +figure; +final = max(0, despilled_rgb.*matte - edges.*ref_rgb); +imshow(final); + imwrite(final, 'final.png','png','alpha', matte); imwrite(matte, 'alpha.png','png'); diff --git a/chromakey/final.png b/chromakey/final.png index 8b1cc89..1aab552 100644 Binary files a/chromakey/final.png and b/chromakey/final.png differ