QWrite a code to show the histogram of ('rice.png') then enhance
the result of histogam and
show the image of it.
Q If you convert the image (G) to double form, what you think
the result will be?
G=[0 200
255 0]
Write code to show the histogram of ('rice.png') then enhance the result of the histogram and show the image of it.
Ans:
Code to read the png image and to create a histogram of that image:
Note: Used MATLAB for Coding
I = imread('rice.png'); imshow(I)
figure; imhist(I);
If you convert the image (G) to double form, what you think the result will be?
Ans:
Input image, specified as a numeric scalar, vector, matrix, or
multidimensional array. If the Parallel Computing Toolbox is
installed, then G can be a gpuArray and im2double
converts G on a GPU.
For example:
I1 = im2double(I) converts the intensity image I to double precision, rescaling the data if necessary. I can be a grayscale intensity image, a truecolor image, or a binary image. If the input image is of class double, then the output image is identical.
Remember: The im2double
function does not rescale
the output when the input image has single
or
double
data type. If your input image is a truecolor
image of data type single
or double
with
pixel values outside this range, then you can use the
rescale
function to scale pixel values to the expected
range [0, 1].
Hope I answered the question
If you have any doubts , feel free to ask.
And if you like my answer, then please upvote for this answer, your feedback really matters alot.
STAY HOME STAY SAFE
Get Answers For Free
Most questions answered within 1 hours.