Question

I need help with a Matlab assignment. Ignore step 5 please. Additional Notes: Gray scale images...

I need help with a Matlab assignment.
I need help with a Matlab assignment. Ignore ste

Ignore step 5 please.

Additional Notes:

Gray scale images are stored in unsigned 8 bit integers, so in order to multiply a B matrix with a factor 0.5, etc. you will need to change the B matrix to a double precision.

You can do this by B=double(A).^0.5

since your matrix B is now double precision, you need to change it back to unsigned 8 bit integer and display.

You can do this by imshow(uint8(B)).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is the code for you:

%Use matlab command imread.

A = imread('FordEcosport.png');

figure;

imshow(A);

%Use matlab command rgb2gray.

B = rgb2gray(A);

figure;

imshow(B);

%Use matlab command size.

[a, b] = size(B);

%Raise each pixel values by a power of 0.5, 1, 1.5

B = double(A);

C = B.^0.5; %.^is raising by 0.5 for each array value.

D = B.^1;

E = B.^1.5;

F = B.^2;

G = B.^4;

figure;

imshow(uint8(C));

figure;

imshow(uint8(D));

figure;

imshow(uint8(E));

figure;

imshow(uint8(F));

figure;

imshow(uint8(G));

imwrite(B, 'B.png');

imwrite(C, 'C.png');

imwrite(D, 'D.png');

imwrite(E, 'E.png');

imwrite(F, 'F.png');

imwrite(G, 'G.png');

%Use matlab command im2bw.

H = im2bw(B, 0.5);

I = imresize(A, 0.5);

figure;

imshow(I);

Add a comment
Know the answer?
Add Answer to:
I need help with a Matlab assignment. Ignore step 5 please. Additional Notes: Gray scale images...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • use MATLAB to upload the following: an image that you want to process (can be taken...

    use MATLAB to upload the following: an image that you want to process (can be taken yourself or downloaded from the internet) a script that processes the image in TWO ways. manipulates the colors averages pixels together Please make sure the script displays the images (like how I did with the 40 and 80 pixel averaging) so I can easily compare them to the original. Make sure to COMMENT your code as well. Homework 13 Please upload the following: an...

  • Please I need help with MATLAB .. PLease help me . Thankyou Write Matlab code to...

    Please I need help with MATLAB .. PLease help me . Thankyou Write Matlab code to plot a 2D sinc function over a 2D cartesian grid where x ranges from 100 to 355 and y ranges from 0 to 255 and the sinc is centered at somewhere not midway in the grid. First plot the grid, and then plot the function on the grid (both as grayscale and as a surface plot). Comment the code well, generate the figures and...

  • When images are scaled or resized, the values between pixels need to be guessed/interpolated in o...

    Whats wrong with my code? Please use MATLAB and can you answer the questions too. When images are scaled or resized, the values between pixels need to be guessed/interpolated in order to fill in the missing gaps. Write a function that takes a grayscale image (pick your own image) and a scaling factor (any positive decimal value) as input and resizes the image using the following methods; a) Nearest neighbouring pixel b) Linear interpolation (in x-direction first, then y-direction) c)...

  • the picture above is the one you are supposed to use for the MATlab code please...

    the picture above is the one you are supposed to use for the MATlab code please help Problems. Grayscale images are composed of a 2D matrix of light intensities from O (Black) to 255 (White). In this lab you will be using grayscale images and do 2D-array operations along with loops and iflelse branches. 1. We can regard 2D grayscale images as 2D arrays. Now load the provided image of scientists at the Solvay Conference in 1927 using the imread)...

  • Can somebody help me with this assignment. I will highly appreciate. Also, please display the output...

    Can somebody help me with this assignment. I will highly appreciate. Also, please display the output as well. I need to use JAVA to to write the program. This is the sample output provided by my professor. HOME WORK: due 09.17.2019 (Rational Numbers) Create a class called Rational for performing arithmetic with fractions. Write a program to test your class. Use integer variables to represent the private instance variables of the class- the numerator and the denominator. Provide a constructor...

  • I need help with this assignment. My answers are in bold but I am not getting...

    I need help with this assignment. My answers are in bold but I am not getting the correct output which is also below. Can you please take a look at it. #include   <stdlib.h> #include   <stdio.h> #include   <float.h> #include   <math.h> // PURPOSE: To define a nickname for type 'unsigned int'. typedef   unsigned int           uInt; //--          Sign related constants           --// // PURPOSE: To tell how many bits to shift the sign field from the //   least...

  • Matlab Homework Please write a script that does the following: generates a 3 x 5 matrix...

    Matlab Homework Please write a script that does the following: generates a 3 x 5 matrix of random integersand call it A. generates a 3 x 3matrix of random integers and call it B. "Fix" A so it can be compared to B How do we "Fix" A? Make sure to reassign the value to A Tell me how many elements of A are greater than or equal to B This can be done in a single line. You will...

  • please answer all the questions! really need the help! >of 5 4. ZOOM Page The questions...

    please answer all the questions! really need the help! >of 5 4. ZOOM Page The questions listed below are intended to be answered using MATLAB which is available t p eapps.ps.edu. MATLAB are available lastpage o tis project, You should work out the solutions to these questions before starting the online quiz. You may use your solutions when you take the online quiz 1. Find the augmented matrix [Ab when T30, T 0, T = 20° and T= 10. 2....

  • Please use MATLAB for the specified parts, I appreciate the help! 1. Complex Numbers and phasor...

    Please use MATLAB for the specified parts, I appreciate the help! 1. Complex Numbers and phasor analysis can be used to solve many problems. For example if we want to determine the currents of each of the voltage sources in the following circuit, VI ov then we can use a technique called mesh analysis to write mesh equations that involve the currents of each source. Let libe the current of the voltage source vl = 2 cos(t), I be the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT