This week's lecture was incredibly engaging, as we explored matrices and image processing in MATLAB. I was amazed by how easily pixel values could be manipulated to create grayscale and color images or even generate a negative of an image. It was fascinating to see how matrix operations translate into practical applications like image editing, especially with the use of control structures such as for-loops.
Dr. Syaza step-by-step taught, starting with basic matrix manipulations and gradually advancing to image processing, made the concepts much easier to understand. The hands-on exercise of creating and modifying images using loops and matrix indexing was particularly satisfying. Learning to generate grayscale and RGB images and invert an image's colors deepened my understanding of how computers process visual data.
Matrix Operations:
Functions like length, size, and sum are essential tools for analyzing and computing matrix properties.
Nested for-loops are effective for performing operations on every element of a matrix.
Grayscale Image Creation:
Pixel values in grayscale images range from 0 (black) to 1 (white).
Grayscale images can be created by iterating through rows and columns using for-loops and assigning appropriate intensity values.
Color Image Creation:
RGB images are represented as 3D matrices, with each layer corresponding to a color channel (Red, Green, Blue).
Modifying specific layers allows for targeted color changes across the image.
Image Manipulation:
The imread function is used to load images, and iterating through matrix values enables advanced manipulations such as color inversion.
Coding of Matrix Operations
Results of Matrix Operations
Nested Loops for Matrix Summation Coding
Results of Nested Loops for Matrix Summation Coding
Coding for Display of Negative Image Using Nested Loops
Output of Coding for Display of Negative Image Using Nested Loops