Exploring digital images: Interactive design (Part 2)
In the previous blog, we have seen the use of msgbox to have interaction with user. Let us know, use another interactive tool, called the menu to have more interaction with user. Octave code: clc; clear all; input_image = imread("ubuntu.jpg"); [height width channels] = size(input_image); figure, imshow(input_image); title("Input Image"); if channels == 3 msgbox("Input image is a color image"); choice = menu("Do you want to convert into grayscale", "Yes", "No"); if choice == 1 grayscale_image = rgb2gray(input_image); figure, imshow(grayscale_image); title("Grayscale Image"); else msgbox("Exiting execution prcoess"); close all; end else disp("Input image is grayscale image") imshow(input_image); end Output: Octave code Interactive msgbox Interactive menu option Output of above code Explanation: Menu is a interactive di...