Guest User

Untitled

a guest
Jan 24th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.23 KB | None | 0 0
  1. % BV Praktikum Nr1 Aufgabe 3 - Benjamin Naas - 373522
  2. %
  3. % Linkes und rechtes Bild einlesen
  4. links_rgb = imread('Bild_links.JPG');
  5. rechts_rgb = imread('Bild_rechts.JPG');
  6. %vom linken nur roten Alphakanal extrahieren
  7. links_rot = links_rgb(:,:,1);
  8. %vom rechten den grünen und blauen Alphakanal extrahieren
  9. rechts_gruen = rechts_rgb(:,:,2);
  10. rechts_blau = rechts_rgb(:,:,3);
  11. % Rote Colormap erstellen
  12. lrmap = 0:1/255:1;
  13. lrmap = lrmap';
  14. lrmap(:,2) = 0;
  15. lrmap(:,3) = 0;
  16. % Grüne Colormap aus roter erstellen
  17. rgrmap = lrmap;
  18. rgrmap(:,2) = rgrmap(:,1);
  19. rgrmap(:,1) = 0;
  20. rgrmap(:,3) = 0;
  21. % Blaue Colormap aus roter erstellen
  22. rblmap = lrmap;
  23. rblmap(:,3) = rblmap(:,1);
  24. rblmap(:,1) = 0;
  25. rblmap(:,2) = 0;
  26. % Kolorierte Bilder erstellen zur Weiterverarbeitung
  27. imwrite(links_rot,lrmap,'links_rot.JPG','JPG');
  28. imwrite(rechts_gruen,rgrmap,'rechts_gruen.JPG','JPG');
  29. imwrite(rechts_blau,rblmap,'rechts_blau.JPG','JPG');
  30. % Bilder wieder einlesen
  31. links_rot_ausgabe = imread('links_rot.JPG');
  32. rechts_gruen_ausgabe = imread('rechts_gruen.JPG');
  33. rechts_blau_ausgabe = imread('rechts_blau.JPG');
  34. %Ausgangsbild erstellen
  35. ausgabe = imadd(links_rot_ausgabe,rechts_gruen_ausgabe);
  36. ausgabe = imadd(ausgabe,rechts_blau_ausgabe);
  37. figure,imshow(ausgabe);
Add Comment
Please, Sign In to add comment