Question

In MatLab, write your own program that uses the picture 'tire.tif' to perform histogram equilization using...

In MatLab, write your own program that uses the picture 'tire.tif' to perform histogram equilization using PMF and CDF.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
I = imread('pout.tif');
J = histeq(I);
subplot(2,2,1);
imshow( I );
subplot(2,2,2);
imhist(I)
subplot(2,2,3);
imshow( J );
subplot(2,2,4);
imhist(J)

MATLAB Design

design_name = 'mlhdlc_heq';
testbench_name = 'mlhdlc_heq_tb';

Let us take a look at the MATLAB design

type(design_name);
type(testbench_name);

Simulate the Design

It is always a good practice to simulate the design with the testbench prior to code generation to make sure there are no runtime errors.

mlhdlc_heq_tb

Setup for the Example

Executing the following lines copies the necessary files into a temporary folder

mlhdlc_demo_dir = fullfile(matlabroot, 'toolbox', 'hdlcoder', 'hdlcoderdemos', 'matlabhdlcoderdemos');
mlhdlc_temp_dir = [tempdir 'mlhdlc_heq'];

% create a temporary folder and copy the MATLAB files
cd(tempdir);
[~, ~, ~] = rmdir(mlhdlc_temp_dir, 's');
mkdir(mlhdlc_temp_dir);
cd(mlhdlc_temp_dir);

% copy files to the temp dir
copyfile(fullfile(mlhdlc_demo_dir, [design_name,'.m*']), mlhdlc_temp_dir);
copyfile(fullfile(mlhdlc_demo_dir, [testbench_name,'.m*']), mlhdlc_temp_dir);
copyfile(fullfile(mlhdlc_demo_dir, 'mlhdlc_img_peppers.png'), mlhdlc_temp_dir);

Create a New HDL Coder™ Project

coder -hdlcoder -new mlhdlc_heq_prj

Next, add the file 'mlhdlc_heq.m' to the project as the MATLAB Function and 'mlhdlc_heq_tb.m' as the MATLAB Test Bench.

Add a comment
Know the answer?
Add Answer to:
In MatLab, write your own program that uses the picture 'tire.tif' to perform histogram equilization using...
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
  • Please the write code using Matlab 8. Write your own code to perform matrix multiplication. Recall...

    Please the write code using Matlab 8. Write your own code to perform matrix multiplication. Recall that to multiply two matrices, the inner dimensions must be Every element in the resulting C matrix is obtained by: Your code must be a function file and it must check to see if matrix multiplication can be performed on the provided matrices. Test your code with the following matrices: 4 4 2 9 -3 A2 17

  • Write your own matlab code to perform matrix multiplication. Recall that to multiply two matrices, the...

    Write your own matlab code to perform matrix multiplication. Recall that to multiply two matrices, the inner dimensions must be the same. Write this as a function with input arguments the matrices to be multiplied and output argument the resultant matrix, use "assert" statement(s) to check that the input arguments are valid and print an error message if they are not. Test with A=[1,2,3;4,5,6] and B=[7,8;9,10;11,12] showing results for: (a) A*B, (b) B*A, and (c) A*A.

  • Write a Matlab Program to perform recovery of original document from torn fragments using Image Mosaicing...

    Write a Matlab Program to perform recovery of original document from torn fragments using Image Mosaicing of binary Image Processing with two step approach. Initially identify the initial set of matching fragment pairs and resolve the ambiguity among these fragments by reconstructing in to a original document

  • How to caclculate 2d cdf from joint histogram in matlab

    the joint histogram is 2d matrix that can be calculated by count the number of occurrences of the grey level pair f(x, y) and (gx, y) between two images and store it at the same spatial location x, y.how to calculate 2d cdf from the joint histogram in matlab by using this :Note: the two images are gray scale images and the size of the joint histogram and cdf are the same (256 * 256).

  • write in C Task: Write the imagej macro code to perform Histogram Equalization Your code should perform the following steps: . Find the minimum intensity in the image. Construct a histogram in an arra...

    write in C Task: Write the imagej macro code to perform Histogram Equalization Your code should perform the following steps: . Find the minimum intensity in the image. Construct a histogram in an array . Construct a cumulative histogram in an array. Construct a lookup table (in an array) that maps old intensity values to new intensity values. Use the round() function! . Use the lookup table to update the image with new values. Task: Write the imagej macro code...

  • write a matlab code for histogram and histogram equallization code without built in commands

    write a matlab code for histogram and histogram equallization code without built in commands

  • Perform the following using Matlab For an additive Gaussian noise: a. Generate 4000 samples with ...

    using matlab Perform the following using Matlab For an additive Gaussian noise: a. Generate 4000 samples with mean value of 3 and variance of 9. b. Plot the sample values using two different ways. c. Determine the actual mean, variance, and standard deviation. d. Determine the median, mode, and range. e. Sketch the histogram. tle- enerate and plot the probability density function (pdf) and its corresponding cumulative distribution function (cdf) ror he M For the following two signals: / and...

  • write a Matlab program ( solve the three questions). please use array and create your own...

    write a Matlab program ( solve the three questions). please use array and create your own function to check primality Question 1 : [10 points) Write a MATLAB program that will store all the first 1000 prime numbers in an array variable named arr_of_primes. Please note that a prime number is a positive integer that is bigger than or equal to 2 which is divisible only by 1 and itself. Examples of the first 8 primes are: 2, 3, 5,...

  • You will write a program in C that multiplies a matrix by a vector, using MATLAB...

    You will write a program in C that multiplies a matrix by a vector, using MATLAB to check the results. Create a program in MATLAB to solve the Topic 5 "File I/O" assignment. Use any built-in MATLAB functions of your choice. Some might require you to change your input files slightly; if so, document what you did and explain why. Compare and contrast the C and MATLAB versions of your code. works in matlab

  • You will write a program in C that multiplies a matrix by a vector, using MATLAB...

    You will write a program in C that multiplies a matrix by a vector, using MATLAB to check the results. Create a program in MATLAB to solve the Topic 5 "File I/O" assignment. Use any built-in MATLAB functions of your choice. Some might require you to change your input files slightly; if so, document what you did and explain why. Compare and contrast the C and MATLAB versions of your code.

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