Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

GUI programming in MATLAB In assignment#4, the description of pushbutton: 'Update for redrawing the collage after some modifications.' may confuse some students. The term 'some

GUI programming in MATLAB image text in transcribed
image text in transcribed
image text in transcribed
In assignment\#4, the description of pushbutton: 'Update for redrawing the collage after some modifications.' may confuse some students. The term 'some modifications' here means any change of the collage, including editing feature, add, delete, up and down. In this assignment, your task is to create a GUl program as an image collage maker. To start with, collect a few images that you'd like to put in your collage. An example collage is shown to the right. Well, yours might not be this fancy, but you can always think about how to add extra features. You will need the following in your program: - Allocate a blank RGB image in your program to hold the collage. You can use a preset size for now. - An axes to show your collage. This allows the editing of the collage in a WYSIWYG manner. - A list box containing the filenames of the images to put in the collage. - The filenames are added one by one. To do this, you need to provide an Add pushbutton. The user gets to select a file when clicking this button. Note: In your file selection dialog box, you should limit the file type to valid image types. Once an image file is added, also load the image itself into your program. (Hint: You can choose one source image as the background or the collage.) - Also provide a Delete pushbutton so that you can removed an image in the list. - When drawing the images onto the collage, follow the order in this list box. - Add Up and Down pushbuttons. Clicking them moves the selected filename up or down in the list. This allows the user to change the order of drawing the images. - The "editing features" that control how a source image is drawn in the collage. - The required ones: Position (top-left corner) and gize (width and height). Note: The size can be different from the size of the source image. - Optional features: Rotation (in degrees), frame (width in \#pixels of an extra boundary around a source image), cropping (you need to specify a cropping rectangle for the source image), etc. You can add other editing features if you want to. - In the program, it's best to collect all the editing features of an image, together with the image itself, in a structure. - When a new source image is added, your program should assign default values of the editing features. - A few edit boxes for modifying the editing features. - Whenever a source image in the image list box is selected, the corresponding editing features should be displayed in these edit boxes. - How to draw the source images onto the collage: - Create an edited version of each source image first. You can use imresize, imrotate, imcrop, etc. for doing this. Do not directly modify the source images. - When copying the edited images onto the collage, be careful about parts of the image that might fall outside of the collage. You need to crop those parts out before copying. - Special care when rotating source images: The function imrotate generates images that contain background pixels (pixels that are not part of the original image), shown as black regions in the illustration to the right. To avoid copying the background pixels to the collage, what you can do is: Create a binary image the same size as the source image and set all its pixels to true, then apply imrotate to this image as well. When copying the rotated source image, use this rotated binary image as a logical mask, copying only those pliels that are "true" in the mask. - A pushbutton Update for redrawing the collage after some modifications. For a GUI program, an easy-to-use layout is important. So 5% of your grade will be based on you GUI design, although this part is to be judged subjectively by the TAs. In addition to the program, also submit two image files: (1) A collage created using your program. (2) A screenshot of your GUI taken while editing the submitted collage. Name these two images P4_\#\#\#\#\#\#\#_out.jpg and P4_\#\#\#\#\#\#_gui.jpg, respectively. These image files will not be graded for their qualities; instead, they are intended to prove that your program is actually usable. There will be a 10% deduction of your grade for failing to submit these images. A "copy detection" will be applied to your submissions, and those found to have copied assignments will receive zero points for the assignment. Your code should include sufficient comments. This will be part of the grade. Include your name and ID at the top of your code. The best collages will be collected and shared with the class later. I do hope you all have some fun doing this assignment and make some nice collages, even during this stressful end-of-semester period. There will be no demo session for this assignment

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

2. What does the other person defi ne as the beginning?

Answered: 1 week ago

Question

1. What do you defi ne as the start of interaction?

Answered: 1 week ago