Homework 1 Solved

$24.99 $18.99

IMAGE READ & WRITE; HISTOGRAM PLOT: Read ” COLOR_Birds.bmp”, store it in an array I and display the image. Use the imwrite function and write the array I to a disk file with the filename extension “.png”. Use the iminfo function to see the contents of the written file. Extract R, G, B color components…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:
Tags:

Description

5/5 – (2 votes)

IMAGE READ & WRITE; HISTOGRAM PLOT: Read ” COLOR_Birds.bmp”, store it in an array I and display the image. Use the imwrite function and write the array I to a disk file with the filename extension “.png”. Use the iminfo function to see the contents of the written file.

  1. Extract R, G, B color components of COLOR_Birds.bmp and display (plot) separately each component.

  2. Create a new image named ”GRAY_Birds.bmp” by taking the average of the color component (R + G + B)/3 and display (plot) it.

  3. Use the imhist function and plot the histograms of the R, G, B, and gray-level components. Comment on the plots. Do they occupy evenly all of the gray level axis?

  4. Find the spatial locations (x,y) of the pixels having the following R,G,B color values: R > 150, G > 130 and B < 10. Create a new binary matrix (image) that has 1 in the corresponding spatial locations, and otherwise 0 in the rest of the image. Display the binary image and comment on the result. (1 should be plotted as 255, and 0 as 0; or vice versa). Absence or weak presence of the blue component corresponds to yellow (the complementary color): Do you think these parts have yellow content?

  5. Do the same for B > 130, G > 130 and R < 100. Absence or weak presence of the red component corresponds to cyan. Do the 1 pixels correspond to cyan?

  6. Finally, do the same for B > 130, R > 130 and G < 200. Absence or weak presence of the green component corresponds to magenta. Do these 1 pixels correspond to that color?

  7. Divide all the gray-scale pixel values of GRAY_Birds.bmp by 2 and display the resulting image and its histogram. Comment on the results.

  8. Find the coordinates of the reddest on the Birds image according to your visual judgement. Find also the maximum value in the R component. Do these points agree?

AVERAGE OPTICAL DENSITY: Read the face images

a ) Find the AOD: average optical density of the images, that is, AOD:

AOD: . (1)

where, I is M x N image.

b) Use the imhist function and plot the histogram of face images and label the x and y axes. Comment on the plot. Does it cover the whole 0-255 range? Should an image cover all gray levels in its histogram?

c) Set the AOD value to 100 by adding a constant, c to every pixel. Display the new images, and comment on the caption of the displayed image. (Note: If an overflow occurs, since your image can have only gray level values between 0 and 255, set any value above 255 to 255 and any value below o to 0 ). Compare the histograms of the original images and of the new images.

d) Change the luminance range of the gray image by multiplying each pixel with a certain number, a. When the factor you multiply with is smaller than 1 (a<1) you are decreasing the gray level range and also darkening the image; conversely, for a>1, the contrast in increasing and the image becomes brighter. In order to keep the same average intensity or AOD do this:

    • Multiply every pixel by a, find the new AOD’,

    • Then add AOD – AOD’ or AOD(before) – AOD(after) to all the pixels. Do the operation for a = 0.5 and 2, display the image, and comment on the caption of the displayed images. Again watch out for any overflow and underflow problems.

GET a FEELING ABOUT the AMOUNT OF PIXELS : Amount of digital image data to be processed:

a) Driver assistant system: A 640×480 camera detects road lanes and traffic signs at 25 Hz frame rate. The camera delivers RGB images. What rate image data must be processed in real time?

b) Medical volumetric image sequences: A computer tomographic system for dynamic medical analysis takes data with a resolution of 256x256x256 and at 10 frame/sec. The number of quantization levels is 65536. Image processing rate?

c) Industrial inspection of laser welding: The high-speed camera system takes 1000 frames/s at a spatial resolution of 256×256 and at a quantal resolution of 16 bits to control the welding of one piece. One thousand parts are inspected per hour. The line runs around the clock. What amount of data to be processed per day?

d) Digital cinema: A Yeşilçam movie is captured with a Sony camera at a resolution 2048×1080, RGB, with a color depth of 12 bits at 25 frame/s. This is equivalent to the 35 mm film quality. The film runs for two hours. How much storage is needed?

PIXELS VARIETIES

Consider the images below:

    1. If the object is self-luminous, as in the Cetus galaxy (actually, a small galaxy in the constellation Cetus, contains 200 million suns’ worth of stars), what are the approximate coordinates of the point that emits the most amount of light?

    2. If the image is taken with a range camera, as in the Office image, what are the approximate coordinates of the closest point and farthest points?

    3. If the image represents material density, as in the Breast and Skull images, what are the approximate coordinates of the opaquest (densest) and least opaque (most transparent) points with the Region of Interest (RoI)?

    4. If the image is captured with a thermal camera, what are the coldest and hottest points?

    5. In the sequence of images, Taxi, what are the fastest changing points?

Skull

Breast

Office

Galaxy

Thermal

T axi (frame 36)

T axi (frame 40)

IMAGE QUANTIZATION

Load the image “lena.bmp”. Each pixel is represented by one 8-bit byte; gray-level values range from 0 to 255.

  1. Obtain a binary image by only considering the most significant bit (MSB) of each pixel. In the binary MSB plane image, if the bit value is 1, set it to 255, and if it is 0, leave it as zero. Display the image: Is Lena still perceptible?

  2. Repeat the same experiment with the least significant bits (LSBs): Is Lena still perceptible?

  3. Set in the Lena image bits of order 5-8 to zero and display the image with only bits of order 1-4. What is the distortion you are observing?

  4. Set in the Lena image bits 1-4 to zero and display the image with only bits 5-8. What is the distortion you are observing?

Comment on all the above resulting images.

Homework 1 Solved
$24.99 $18.99