Skip to content

Commit

Permalink
added problem 3
Browse files Browse the repository at this point in the history
  • Loading branch information
taha-mahmoud-ly committed May 31, 2024
1 parent 24b2c13 commit 39f48ac
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 19 deletions.
19 changes: 0 additions & 19 deletions assignements/Assignement_01/Problem03/negative_image.m

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions assignements/Assignement_01/Problem03/sawping_channels.m
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');

0 comments on commit 39f48ac

Please sign in to comment.