-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24b2c13
commit 39f48ac
Showing
4 changed files
with
40 additions
and
19 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.9 KB
assignements/Assignement_01/Problem03/output/lena_swapped_colors.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
################################################################################ | ||
#Bioengineering.DIP.Spring2024.BY: Dr.Saleh Hussein. | ||
#Author: Taha Mahmoud.210100552. email: dr.taha.libya@gmail.com. | ||
#Date: 31.05.2024 | ||
################################################################################ | ||
#Assignment 01, Problem 03 | ||
#swabing color channels | ||
# save to output folder | ||
################################################################################ | ||
clc , clear all , close all | ||
|
||
% Step (b): Read the color image and display it | ||
J1 = imread('lena512color.jpg'); | ||
|
||
% Display the original color image | ||
figure; | ||
imshow(J1); | ||
title('Original Color Image (J1)'); | ||
|
||
% Step (c): Initialize the new image J2 and swap the color bands | ||
J2 = J1; | ||
|
||
% Swap the color bands | ||
J2(:,:,1) = J1(:,:,3); % Red band of J2 = Blue band of J1 | ||
J2(:,:,2) = J1(:,:,1); % Green band of J2 = Red band of J1 | ||
J2(:,:,3) = J1(:,:,2); % Blue band of J2 = Green band of J1 | ||
|
||
% Display the new image with swapped color bands | ||
figure; | ||
subplot(1,2,1); | ||
imshow(J1); | ||
title('Original Image (J1) '); | ||
subplot(1,2,2); | ||
imshow(J2); | ||
title('Color Image with Swapped colors (J2)'); | ||
|
||
% Step (d): Save images to output | ||
imwrite(J1, './output/lena_original.jpeg'); | ||
imwrite(J2, './output/lena_swapped_colors.jpeg'); | ||
|