Question

In: Computer Science

Create two new images by applying a threshold first to various colors in the image. In...

Create two new images by applying a threshold first to various colors in the image. In practice, applying a threshold means that you zero out (set to zero) any value above or below a specified limit. For the first image (im1mod1), zero out all pixels that are below the value 128. For the second image (im1mod2), zero out all red pixels entirely, zero out all green pixels ABOVE 128, and zero out all blue pixels BELOW 128. Use the command image(image_variable) to display each image. In MatLab please.

Solutions

Expert Solution

clc; clear all;

im1mod1 = imread("lena_color.tiff");

figure()

image(im1mod1) %show the input image(Figure1)

for r=1:size(im1mod1,1)

for g=1:size(im1mod1,2)

for b=1:size(im1mod1,3)

if(im1mod1(r,g,b) < 128)

im1mod1(r,g,b) = 0;

end

end

end

end

figure() %show the modified image

image(im1mod1)

im1mod2 = imread("lena_color.tiff");

for r=1:size(im1mod2,1)

for g=1:size(im1mod2,2)

im1mod2(r,g,1) = 0;

if(im1mod2(r,g,2) > 128)

im1mod2(r,g,2) = 0;

if(im1mod2(r,g,3) < 128)

im1mod2(r,g,3) = 0;

end

end

end

end

figure()

image(im1mod2)

input image

im1mod1 image

im1mod2 image


Related Solutions

Consider two Images of same dimensions where one image is an original image and other should...
Consider two Images of same dimensions where one image is an original image and other should be a degraded image.    Write a matlab program to measure picture quality using objective assessment validation criteria for the degraded image and original image. Calculate MSE, PSNR, Normalized absolute error, Maximum Difference, Structural content, Average difference, Normalized cross correlation for the images.    Explain the importance of Objective assessment in Image processing
I NEED TO CREATE A GUI INTERFACE USING TKINTER CONTAINING : Colors, Image, Button, Title bar,...
I NEED TO CREATE A GUI INTERFACE USING TKINTER CONTAINING : Colors, Image, Button, Title bar, and a Menu bar FOR THE QUESTION BELOW: PLEASE HELP PROGRAMMING LANGUAGE IS PYTHON Write a simple quiz game that has a list of ten questions and a list of answers to those questions. The game should give the player four randomly selected questions to answer. It should ask the questions one-by-one, and tell the player whether they got the question right or wrong....
When two lenses are used in combination, the first one forms an image that then serves...
When two lenses are used in combination, the first one forms an image that then serves as the object for the second lens. The magnification of the combination is the ratio of the height of the final image to the height of the object. A 1.90 cm -tall object is 56.0 cm to the left of a converging lens of focal length 40.0 cm . A second converging lens, this one having a focal length of 60.0 cm , is...
When two lenses are used in combination, the first one forms an image that then serves...
When two lenses are used in combination, the first one forms an image that then serves as the object for the second lens. The magnification of the combination is the ratio of the height of the final image to the height of the object. A 1.80 cm -tall object is 51.0 cm to the left of a converging lens of focal length 40.0 cm . A second converging lens, this one having a focal length of 60.0 cm , is...
Create a new project in BlueJ. Create two new classes in the project, with the following...
Create a new project in BlueJ. Create two new classes in the project, with the following specifications: Class name: Part Fields: id (int) description (String) price (double) onSale (boolean) 1 Constructor: takes parameters partId, partDescrip, and partPrice to initialize fields id, description, and price; sets onSale field to false. Methods: Write get-methods (getters) for all four fields. The getters should be named getId, getDescription, getPrice, and isOnSale.
C++ Language Implement a two-dimensional image using a nested loop. 1) Create an integer constant DIM...
C++ Language Implement a two-dimensional image using a nested loop. 1) Create an integer constant DIM and set it equal to 5. 2) Use a nested loop to print the output in terms of DIM. Example output: ***** *---* *---* *---* *****
I need the output of the code like this in java First we create a new...
I need the output of the code like this in java First we create a new building and display the result: This building has no apartments. Press enter to continue......................... Now we add some apartments to the building and display the result: This building has the following apartments: Unit 1 3 Bedroom Rent $450 per month Currently unavailable Unit 2 2 Bedroom Rent $400 per month Currently available Unit 3 4 Bedroom Rent $1000 per month Currently unavailable Unit 4...
Operating Budget Create an operating budget for the first quarter of a new business. Projected Sales...
Operating Budget Create an operating budget for the first quarter of a new business. Projected Sales are: Month #1: $65,000 Month #2: $97,500 Month #3: $130,000 Month #4: $110,500 These sales are based on selling one product with a selling price of $6.50 Create a Production Budget based on Units (not dollars). Desired Finished Goods Ending Inventory each month is 10% of the next month’s projected sales. (Use the Finished Goods Ending Inventory amount for the previous year for the...
Requirements: In this assignment, you are going to create two switch functions. The first function is...
Requirements: In this assignment, you are going to create two switch functions. The first function is going to be called switchVal and the second is going to be called switchRef. The goal of this assignment is to demonstrate the understanding of what pass-by-reference (Links to an external site.) and pass-by-value (Links to an external site.) do when working with functions that you create. The two functions that you will modify need to accept two parameters and inside them they need...
Create a Java Swing form that will have two Buttons: (1) the first linked to an...
Create a Java Swing form that will have two Buttons: (1) the first linked to an event handler to write data from two TextFields on the form to an output file; and (2) the other with an event handler to read data from the same file as input and write output to a binary ObjectOutputStream file.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT