Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % BV Praktikum Nr1 Aufgabe 3 - Benjamin Naas - 373522
- %
- % Linkes und rechtes Bild einlesen
- links_rgb = imread('Bild_links.JPG');
- rechts_rgb = imread('Bild_rechts.JPG');
- %vom linken nur roten Alphakanal extrahieren
- links_rot = links_rgb(:,:,1);
- %vom rechten den grünen und blauen Alphakanal extrahieren
- rechts_gruen = rechts_rgb(:,:,2);
- rechts_blau = rechts_rgb(:,:,3);
- % Rote Colormap erstellen
- lrmap = 0:1/255:1;
- lrmap = lrmap';
- lrmap(:,2) = 0;
- lrmap(:,3) = 0;
- % Grüne Colormap aus roter erstellen
- rgrmap = lrmap;
- rgrmap(:,2) = rgrmap(:,1);
- rgrmap(:,1) = 0;
- rgrmap(:,3) = 0;
- % Blaue Colormap aus roter erstellen
- rblmap = lrmap;
- rblmap(:,3) = rblmap(:,1);
- rblmap(:,1) = 0;
- rblmap(:,2) = 0;
- % Kolorierte Bilder erstellen zur Weiterverarbeitung
- imwrite(links_rot,lrmap,'links_rot.JPG','JPG');
- imwrite(rechts_gruen,rgrmap,'rechts_gruen.JPG','JPG');
- imwrite(rechts_blau,rblmap,'rechts_blau.JPG','JPG');
- % Bilder wieder einlesen
- links_rot_ausgabe = imread('links_rot.JPG');
- rechts_gruen_ausgabe = imread('rechts_gruen.JPG');
- rechts_blau_ausgabe = imread('rechts_blau.JPG');
- %Ausgangsbild erstellen
- ausgabe = imadd(links_rot_ausgabe,rechts_gruen_ausgabe);
- ausgabe = imadd(ausgabe,rechts_blau_ausgabe);
- figure,imshow(ausgabe);
Add Comment
Please, Sign In to add comment