(a)
To show the number of possible seams grows exponential.
(a)
Explanation of Solution
Consider an array A for the compressing the picture so it requires to remove the pixels in the two adjacent rows in the same or adjacent column and the pixels are removed forms a seam from the top row to the bottom row.
Suppose
The total area enclosed by the seams is order of m and it has two choices for every area of m so the total probability of the total number of seams can be varies from 2m to 2m -1.
Hence, the total number of possibilities of seams is bounded by
(b)
To give an algorithm that finds a seam with lowest disruption measure.
(b)
Explanation of Solution
The algorithm to find a seam with the lowest disruption is given below:
Seam(A)
Initialize tables
For
End for.
for
for
If
If
End if.
Else
End if.
Else if(
If() then
End if.
End if.
End for.
End for.
For
If
End if.
End for.
Print the list
End.
The algorithm compressing the picture so it requires to removes the pixels in the two adjacent rows in the same or adjacent column and the pixels are removed forms a seam from the top row to the bottom row.
This algorithm takes the array A as input and the cases to insert pixel according to the defined condition and return the list of seam as
Want to see more full solutions like this?
Chapter 15 Solutions
Introduction to Algorithms
- Describe an algorithm for converting a greyscale image to a two-bit image (i.e. only using black, dark grey, light grey and white), while preserving as much visual quality as possible. Your algorithm should map every input greyscale pixel to exactly one output pixel.arrow_forwardPerform histogram equalization on the following 6*6 image the gray scalelevel distribution of the image is given belowarrow_forwardComputer Science Let C be a black circular disk in front of a white background. The circular disk is parallel to the image plane. This disk is projected on the image plane through a pinhole. What is the shape of the disk’s projection on the image plane? [Hint: A circular disk parallel to the image plane is described algebraically as all 3D points [X,Y,Z]T with (X-X0) 2 +(Y-Y0) 2 =R2 , Z=Z0, where [X0,Y0,Z0] T is the center of the disk and R is its radius.]arrow_forward
- Motion History Image (MHI) technique uses a frame differencing inside to generate M(t). In its original form SFD is used. Instead of SFD, we can use a) ABS, b) TFD. Write pseudo-code for each case separately.arrow_forwardLaplacian Image Pyramid A Laplacian image pyramid is a multi-scale representation of a single image that highlights intensity discontinuities at multiple scales. It is obtained by convolving an image with a Gaussian mask and subtracting the smoothed image from the original one. The next level of the pyramid is obtain by repeating this process on the smoothed image after it is down-sampled. Create a 3 level Laplacian image pyramid of the woods image (after conversion from uint8 to double format), using a Gaussian with a standard deviation of 1.5, using "same" as the shape parameter for the conv2 function, and resizing by a scale factor of 0.5 using nearest-neighbour interpolation. Display the images in the pyramid as subplots in the same window.arrow_forwardLaplacian Image Pyramid A Laplacian image pyramid is a multi-scale representation of a single image that highlights intensity discontinuities at multiple scales. It is obtained by convolving an image with a Gaussian mask and subtracting the smoothed image from the original one. The next level of the pyramid is obtain by repeating this process on the smoothed image after it is down-sampled. Create a 3 level Laplacian image pyramid of the woods image (after conversion from uint8 to double format), using a Gaussian with a standard deviation of 1.5, using "same" as the shape parameter for the conv2 function, and resizing by a scale factor of 0.5 using nearest-neighbour interpolation. Display the images in the pyramid as subplots in the same window. EXERCISE: For the last level of the pyramid report the values at the following locations (correct to at least 2 decimal places): row=3, column=5 row=1, column=2arrow_forward
- Help with cg mcq The digitization process i.e. the digital image has M rows and N columns, requires decisions about values for M, N, and for the number, L, of gray levels allowed for each pixel. The value M and N have to be: a) M and N have to be positive integer b) M and N have to be negative integer c) M have to be negative and N have to be positive integer d) M have to be positive and N have to be negative integerarrow_forwardThe figure shown above is a binary images I in which white piİxels have values of one and black pixels have values of zero. First compute derivatives of the image intensities in the x and y directions following the numerical way to obtain Ix and Iy : Ix(i,j)= (I(i+1,j)-I(i-1,j))/2 and Iy(i,j) = (I(i,j+1)-I(i,j-1))/2. For the computation of Ix(i,j) on pixels in the first column Ix(i, j) = I(i+1,j) - I(i,j) or of Iy(i,j) on pixels in the first row Iy(i,j) = I(i,j+1) - I(i,j). For the computation of Ix(i,j) on pixels in the last column Ix(i,j) = I(i,j) - I(i-1,j) or of Iy(i,j) on pixels in the last row Iy(i,j) = I(i,j) - I(i,j-1). Calculate the response R of the Harris corner detector at each pixel based on Ix and ly, assuming (i) a value of k=0.05 in the calculation, (ii) that products of derivatives are summed over an equally weighted 3 by 3 pixel window around each pixel, (iii) that the image is padded with zeros when computing at pixels on the edge. ANSWER: R= (to 2 decimal places)arrow_forwardFor an image of size 32x32 and a filter of size 5x5, if you want the convolution result to keep the original image size, what's the padding size in pixels? a) 5 b) 2 c)10 d) 3 explain.arrow_forward
- Consider the following 8-bit greyscale image: 12 12 12 59 179 254 254 254 12 12 12 59 179 254 254 254 12 12 12 59 179 254 254 254 12 12 12 59 179 254 254 254 Compress the image using Huffman coding. Hint: construct the Huffman table and encode the image scanlines using the table entries.arrow_forwardGiven the image below f(x,y), and the filter h(x,y), perform a convolution and calculate the new filtered pixel values for pixel c in the filtered image.arrow_forward16- For the image portion given below, number of bits per pixel is 3 bits. Improve the histogram by histogram stretching. 1 1 3 4 3 2 1 5 5 1 2 4 3. 2. 2.arrow_forward
- New Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning