image_processing_hw

.pdf

School

University of California, Berkeley *

*We aren’t endorsed by this school

Course

109

Subject

Astronomy

Date

Apr 3, 2024

Type

pdf

Pages

4

Uploaded by MateResolveChinchilla36

EPS 109 “Computer Simulations in Earth and Planetary Science” Instructor: B. Militzer Homework Assignment 12 Image Processing Please download all accompanying ‘.jpg’ and ‘.tif’ images from bCourses. Part 1 – How much hair and beard? The Australian sculptor Ron Mueck is known for his oversized and very realistic but slightly creepy looking sculptures. The head, about 5 feet long, was displayed at SF MOMA and is believed to be self-portrait. In this part, we want to count the number of pixels that show hair and beard in the image on the left. Download and display the image file “head_by_Ron_Mueck.jpg”. Then apply an entropy filter with the following commands: from skimage.filters.rank import entropy from skimage.morphology import disk from skimage.color import rgb2gray gray_image = rgb2gray(image) entropy_image = entropy(gray_image, disk(50)) (1) Display the resulting image and adjust the size of the disk until the hair and beard stand out best. (2) Convert the entropy image to black and white by choosing a reasonable threshold value. Your black-and-white image should approximately look like image on the right image above. (3) Determine the fraction of pixels in percent that show hair and beard. Answers with 1% will earn you full credit.
EPS 109 “Computer Simulations in Earth and Planetary Science” Instructor: B. Militzer (4) For this image, provide one example why this approach may overestimate the pixel fraction and one why it may underestimate this fraction. Part 2 – Bubbles in Pumice 2 Review part 2 of the lab, in which we used Scikit-image to identify and label regions of a black and white image, and then to quantified properties of the labeled regions. We provide with two images 3.jpg that show dark bubbles in pumice. (1) Read and display the image in file ‘3.jpg’. Display the histogram of pixel intensities. Notice that this time there are light grey crystals in addition to the black bubbles. (2) Apply the necessary intensity threshold(s) to create two black & white images, one displaying ONLY the bubbles, and the other displaying ONLY the lighter grains. You can find the part of the image within a specific intensity ranges using Boolean arithmetic: image_grains = ( image < val1 ) * (image > val0 ) (3) Apply the scikit-image measure.label(image) and measure.regionprops(labels) functions as you did in the lab separately for BOTH bubbles and the and the grains. How many bubbles and how many grains do you detect ? The following command is needed to import the functions. from skimage import measure
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help