Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. % whiteandgold
  2. img = imread('dress.jpg');
  3.  
  4. white_pt = [243, 210];
  5. gold_pt = [537, 339];
  6. white_rgb = squeeze(img(white_pt(1), white_pt(2), :));
  7. gold_rgb = squeeze(img(gold_pt(1), gold_pt(2), :));
  8.  
  9. figure; subplot(1, 3, 1);
  10. imagesc(img);
  11. title('original image');
  12. hold on;
  13. plot(white_pt(2), white_pt(1), 'g*');
  14. text(white_pt(2), white_pt(1), 'white', 'color','r','Fontsize',18);
  15. plot(gold_pt(2), gold_pt(1), 'g*');
  16. text(gold_pt(2), gold_pt(1), 'gold', 'color','r','Fontsize',18);
  17.  
  18.  
  19. white_panel = ones(512, 512, 3, 'uint8');
  20. white_panel(:, :, 1) = white_panel(:, :, 1) .* white_rgb(1);
  21. white_panel(:, :, 2) = white_panel(:, :, 2) .* white_rgb(2);
  22. white_panel(:, :, 3) = white_panel(:, :, 3) .* white_rgb(3);
  23.  
  24. subplot(1, 3, 2);
  25. imagesc(white_panel);
  26. title('white panel');
  27.  
  28. gold_panel = ones(512, 512, 3, 'uint8');
  29. gold_panel(:, :, 1) = gold_panel(:, :, 1) .* gold_rgb(1);
  30. gold_panel(:, :, 2) = gold_panel(:, :, 2) .* gold_rgb(2);
  31. gold_panel(:, :, 3) = gold_panel(:, :, 3) .* gold_rgb(3);
  32.  
  33. subplot(1, 3, 3);
  34. imagesc(gold_panel);
  35. title('gold panel');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement