Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % whiteandgold
- img = imread('dress.jpg');
- white_pt = [243, 210];
- gold_pt = [537, 339];
- white_rgb = squeeze(img(white_pt(1), white_pt(2), :));
- gold_rgb = squeeze(img(gold_pt(1), gold_pt(2), :));
- figure; subplot(1, 3, 1);
- imagesc(img);
- title('original image');
- hold on;
- plot(white_pt(2), white_pt(1), 'g*');
- text(white_pt(2), white_pt(1), 'white', 'color','r','Fontsize',18);
- plot(gold_pt(2), gold_pt(1), 'g*');
- text(gold_pt(2), gold_pt(1), 'gold', 'color','r','Fontsize',18);
- white_panel = ones(512, 512, 3, 'uint8');
- white_panel(:, :, 1) = white_panel(:, :, 1) .* white_rgb(1);
- white_panel(:, :, 2) = white_panel(:, :, 2) .* white_rgb(2);
- white_panel(:, :, 3) = white_panel(:, :, 3) .* white_rgb(3);
- subplot(1, 3, 2);
- imagesc(white_panel);
- title('white panel');
- gold_panel = ones(512, 512, 3, 'uint8');
- gold_panel(:, :, 1) = gold_panel(:, :, 1) .* gold_rgb(1);
- gold_panel(:, :, 2) = gold_panel(:, :, 2) .* gold_rgb(2);
- gold_panel(:, :, 3) = gold_panel(:, :, 3) .* gold_rgb(3);
- subplot(1, 3, 3);
- imagesc(gold_panel);
- title('gold panel');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement