Question

QWrite a code to show the histogram of ('rice.png') then enhance the result of histogam and...

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]

Homework Answers

Answer #1

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

Know the answer?
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
Similar Questions
Write a matlab code for following : Load image ‘Balloon.tif’ into Matlab .  Develop a...
Write a matlab code for following : Load image ‘Balloon.tif’ into Matlab .  Develop a function to mark all pixels in green with 1 and 0 for the rest. Display the result image  Convert it into a grayscale image, denoted with ‘img1’  Create a copy of the clean grayscale image, denoted with ‘img2’, in the memory and add salt and pepper noise to it using imnoise  Remove salt and pepper noise using function medfilt2 and display...
1. Code is already written please show all outputs and comment on function of code. 2....
1. Code is already written please show all outputs and comment on function of code. 2. These are Python 3 programs. Please show outpouts and comment on fuctions. Note: this is a bit of a “backwards” exercise – we show you code, you figure out what it does. As a result, not much to submit – don’t worry about it – you’ll have a chance to use these in other exercises. >>> feast = ['lambs', 'sloths', 'orangutans', 'breakfast cereals', 'fruit...
We have provided the R code that calculates the information for the 7-number summary, histogram and...
We have provided the R code that calculates the information for the 7-number summary, histogram and boxplot for all observations and for the data with four outliers removed. Do you think that Age is a useful variable? Yes or no and explain. Min: 2.00 1st Qu: 19.00 Median: 20.00 Mean: 19.87 3rd Qu: 21.00 Max: 69.00 NA: 2 (after outliers removed) Min: 17.00 1st Qu: 19.00 Median: 20.00 Mean: 19.68 3rd Qu: 21.00 Max: 23.99 NA: 2
APPLIED STATISTICS 2 USE R CODE ! SHOW R CODE! Write a function to calculate the...
APPLIED STATISTICS 2 USE R CODE ! SHOW R CODE! Write a function to calculate the sum of cubes from 1 to n, but skip the multiple of 5. Say, if n=10, the result is 1^3+2^3+3^3+4^3+6^3+7^3+8^3+9^3. The input is the value of n, the output is the summation. (you need if statement to check whether a number is a multiple of 5.In R, a%%b is the remainder for a divided by b. So, we have 10%%5=0) APPLIED STATISTICS 2 USE...
What would be the result after the following code is executed? final int SIZE = 25;...
What would be the result after the following code is executed? final int SIZE = 25; int[] array1 = new int[SIZE]; // Code that will put values in array1 int value = 1; for (int a = 0; a < array1.length; a++) { array1[a] = value; value = value + array1[a]; }
The following code defines a simple absolute value macro. It fails in at least one case....
The following code defines a simple absolute value macro. It fails in at least one case. What value does it fail on? Think about what happens at the boundary. If you cannot find the issue, you can test some values quickly in code. #define abs(n) ((n) < 0 ? -(n) : (n) )
1. A golf coach suggests that altering your grip will result in greater distances in your...
1. A golf coach suggests that altering your grip will result in greater distances in your drive. You test their theory with the help of five of your friends. The results in the table below show the average drive for each golfer using the old and the new golf grip. Drive Distance (in yards) Swing / Golfer 1 2 3 4 5 6 Old 228 245 254 255 240 278 New 240 250 257 265 255 269 If the calculation...
Show what is written by the following segment of code, given that element1, element2, and element3...
Show what is written by the following segment of code, given that element1, element2, and element3 are int variables, and queue is an object that fits the ADT of a queue. element1 = 1; element2 = 0; element3 = 4; queue.enqueue(element2); queue.enqueue(element1); queue.enqueue(element1 + element3); element2 = queue.dequeue( ); queue.enqueue(element3 * element3); queue.enqueue(element2); queue.enqueue(3); element1 = queue.dequeue( ); System.out.println(element1 + “ “ + element2 + “ “ + element3); while (!queue.isEmpty( )) {    element1 = queue.dequeue( );    System.out.println(element1)...
4. When the second derivative test (SDT) is used for a critical point the result can...
4. When the second derivative test (SDT) is used for a critical point the result can be local maximum, local minimum, saddle point or test inconclusive. Consider the function f(x, y) = y^2 − 2y cos(x) with domain restricted to {(x, y) | −1 ≤ x ≤ 4 and − 2 ≤ y ≤ 4} and the three points P = ( π/2 , 0) Q = (0, 1) and R = (π, −1). (a) Find all the critical points...
Show graphically and explain why the private provision of a public good will not result in...
Show graphically and explain why the private provision of a public good will not result in an allocatively efficient outcome. As part of your answer you must provide a full explanation of what allocative efficiency is and from where it derives.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT