一个掷骰子的gui matlab计算机视觉游戏编程期末project
当前位置:以往案例 > >一个掷骰子的gui matlab计算机视觉游戏编程期末project
2019-03-12

CS631T – Spring 2018

project 2 – Enhancement and Binary Analysis Exercises




Part1: Matlab Coding


Save all solutions in a single m-file. Be sure to place semicolons wherever appropriate, to suppress unnecessary console output, such as when loading images into memory, or operating on them. You should submit only your m-file via the BB system. Please do not send any image!


Please include comments at the top of each m-file. The comments should contain at least the following: your name, your email, and project number. In your main function, place a message “—–Finish Solving Problem X—–” followed by a pause command (i.e., wait for a key to be pressed before continuing) at the end of each solution, where X is the question number (i.e., 1, 2, or 3).



Problem1: Exercises on Image Scaling and Histogram Equalization [10 points]


a) Use the Matlab function imadjust to scale the image Food.jpg into an appropriate range [NewMin, NewMax] so the original image is enhanced to a good quality. Save the scaled image into ScaledFood. Display the original image, and the scaled image side-by-side on figure 1 with appropriate titles.


b) Use the Matlab function imhist to calculate the histogram of image Food. Tune the parameters of num_bins to see the different results. Display the above calculated histogram and its normalized histogram side-by-side on figure 2 with appropriate titles on both axes.


c) Use the Matlab histogram equalization function histeq on Food image. Save the enhanced image as EqualizedFood. Display the original image, your scaled image ScaledFood, and your histogram enhanced image EqualizedFood with appropriate titles on figure 3.


d) Close all figures and all variables in the workspace.



Problem2: [8 points]


Load in Shapes.tif image. Apply appropriate morphological operation(s) on the original image to obtain the following three desired images, respectively. Display the three resultant images on figure 2 with appropriate titles.



image.png

Hint: Matlab functions imdilate, imerode, imopen, imclose, strel might be needed. Choose a proper size of structuring element so the unwanted parts could be closed or opened.



Problem3: [8 points]


Load in Wirebond.tif image. Apply appropriate morphological operation(s) on the original image to obtain the following three desired images, respectively. Display the three resultant images on figure 3 with appropriate titles.

image.png

Hint: Try erode the image with circle shape SE of different sizes.



Problem4: Morphological operations on gray image [4 points]


Morphological operations (same matlab functions) can be applied on gray image as well. Load in City.jpg image. Apply the dilation, save the resultant image as A; then apply the erosion operation on the original image, save the resultant image as B. Let C = A – B. Use a 3-by-3 square structuring element. Display the resultant image C on figure 4. Use Matlab display command to discuss the reason for such an appearance.




Part2: Exercise. Submit the answers of this part as a word file or a pdf file separately from the Matlab m-file above.


In lecture 2, we covered textbook 2.5, 9.1-9.5 and 10.3.



Problem1: Combination of foreground set B1 and background B2 in Hit-or-Miss Transformation. [10 points]


Read through the following link http://homepages.inf.ed.ac.uk/rbf/HIPR2/hitmiss.htm which explains a simple way that B1 and B2 in the Hit-or-Miss Transformation can be combined into one structuring element (SE). In such a situation, the value 0, 1, and blank in SE have different meanings. Draw the result of first image in Figure 3 after applying the following SE:



image.png

Submit both m-file and text file (word or pdf) to BB on the due date.

(以上发布均为题目,为保证客户隐私,源代码绝不外泄!!)

代写计算机编程类/金融/高数/论文/英文
Final Project Proposal



How to play:


Left Center Right (also known as LCR), is a dice game for three or more players, and is entirely a game of chance.


At the beginning, each player receives at least 3 chips and seats to form a circle, in order to make sure every player has one on his/her left and one on his/her right.


Players take it in turn to roll three six-sided dice, each of which is marked with "L", "C", "R" on one side, and a single dot on the three remaining sides. For each "L" or "R" thrown, the player must pass one chip to the player to his left or right, respectively. A "C" indicates a chip to the center (pot). A dot has no effect.


If a player has fewer than three chips left, he is still in the game but his number of chips is the number of dice he rolls on his turn, rather than rolling all three. When a player has zero chips, he passes the dice on his turn, but may receive chips from others and take his next turn accordingly. The player who does not receive chips after two passes is out of the game. Winner is the last player with chips left.


What’s special:


In our LCR game, numbers of players and chips are flexible to fit any circumstance. For instance, there can be 4 players in a game at once while the number of chips could be limit to a relatively small amount to make sure the game end in a comparatively short time.


Meanwhile, various of visual and auditory effects including animation would make a LCR game more user-friendly. The initial interface (start-up screen), including buttons and instruction, would be equipped with animation. Audio effect would also be added to increase human-computer interaction.


Programming Tasks:


User Interface :

Buttons to start, pause and restart the game, animation of rolling dice and passing chips, displaying of dice results, gamers’s remaining chips, and out and victory messages and effects.

Function 1:

Let user to enter the number of players and initial chips

Function 2:

Link to the button which triggers the animation of rolling dice

Function 3:

Bring the random output of rolling dices(L,R,C,·); display sounds and animations

Function 4:

Distribute chips according to the output; display sounds and animations

Function 5:

Count and show the result (number of chips each player hold) after the distribution with sounds and animations

Function 6:

Test whether the number of chips each player hold fit the requirement of game (chip>0 || (chip=0&&pass<2)). If not(chip=0&&pass>=2), the player will quit the game with the animation on user interface.

Function 7:

Test the number of player. If (player ==1), quit the loop of throwing dices and the last player become winner. (Display sounds and animations at user interface)

Function 8:

Link to the button which resets the data and restart the game

Function 9:

Link to the button which quits the project

以上发布均为题目,为保证客户隐私,源代码绝不外泄!!)


在线提交订单