程序代写案例-MA 325 SP22
时间:2022-04-25
MA 325 SP22 HW2
Image Processing Module, Prof. Lubkin

HW2 due Wednesday 4/27 (or earlier if you prefer!)

Submit to Moodle a single pdf containing: Your Matlab code, the images asked for, and any additional
information asked for, such as a small matrix, or a comment. Clearly label which part of the question you
are answering (a, b, etc.)

This assignment's selfie will be of just your hand, with fingers spread, flat on a background surface (such
as a piece of paper). It will be helpful if you have a background that contrasts well with your hand color.
Convert it to grayscale and read it into Matlab.

Objective: explore erosion, dilation, and binary operations

a. Convert your grayscale hand image into a binary image, using simple thresholding. Show the grayscale
image and your BW image.

b. Switch the B for the W and vice versa. Display both.

For parts (c) - (i), use the binary hand from (b) which has the hand as W and the background as B. That is
your segmented hand.

c. Determine the approximate diameter D of your fingers in pixels. I am not looking for a precise value
here, just an estimate. Create a structuring element S which is a disk of diameter d with approximately d ~
D/4. (You may want to look at the Help page for strel and note that disks take a radius as input.) Report
your values of D and d and show your structuring element S (either an image, or a display of its array
values if d is small). Does S actually look like a disk?

d. Create and display a dilation of your hand with S.

e. Create and display an erosion of your hand with S.

f. Using binary operations, find and display that portion of your hand which is within a distance d of the
edge.

g. Calculate what proportion of your hand image lies within d of its edge.

h. Find the portion of the image which is outside the hand, and has distance to the hand greater than D
but less than 2D. Create and display an image showing both the hand and this region around it. (It should
look like a white hand with a white halo, on a black background.) Explain (briefly) how you did it.

i. Use your binary hand, grayscale hand, and Boolean operations to create an image which is black in the
background, and grayscale where your hand is. Display. (We call the binary hand a "mask" as in
"masking tape".) Explain (briefly) how you did it.

j. Use the mask and the image from (i) to determine the average grayscale color of your hand. Explain
(briefly) how you did it.


essay、essay代写