Skip to content

Instantly share code, notes, and snippets.

@mahdavipanah
Created March 8, 2017 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahdavipanah/682f6cc0cdb11f20687c9796fcb9adb5 to your computer and use it in GitHub Desktop.
Save mahdavipanah/682f6cc0cdb11f20687c9796fcb9adb5 to your computer and use it in GitHub Desktop.
Matlab Image Processing
main_image = imread('image.jpg');
red_part = uint8(zeros(size(main_image)));
red_part(:, :, 1) = main_image(:, :, 1);
green_part = uint8(zeros(size(main_image)));
green_part(:, :, 2) = main_image(:, :, 2);
blue_part = uint8(zeros(size(main_image)));
blue_part(:, :, 3) = main_image(:, :, 3);
subplot(2, 2, 1), imshow(main_image);
subplot(2, 2, 2), imshow(red_part);
subplot(2, 2, 3), imshow(green_part);
subplot(2, 2, 4), imshow(blue_part);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment