Skip to content

Instantly share code, notes, and snippets.

@aksimhal
Created February 27, 2015 04:28
Show Gist options
  • Select an option

  • Save aksimhal/5b18b3695b569e913f30 to your computer and use it in GitHub Desktop.

Select an option

Save aksimhal/5b18b3695b569e913f30 to your computer and use it in GitHub Desktop.
#whiteandgold
% 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');
@aksimhal

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment