Created
February 27, 2015 04:28
-
-
Save aksimhal/5b18b3695b569e913f30 to your computer and use it in GitHub Desktop.
#whiteandgold
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % 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'); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
img source: http://41.media.tumblr.com/a391a1b4b46dd6b498d379e50f96ecbc/tumblr_nkcjuq8Tdr1tnacy1o1_1280.jpg