ECE 5554 / ECE 4554: Computer Vision Fall 2018Instructions
Part 1: Hybrid image (30 points)OverviewA hybrid image is the sum of a low-pass filtered version of the one image and a high-pass filtered version of a second image. There is a free parameter, which can be tuned for each image pair, which controls how much high frequency to remove from the first image and how much low frequency to leave in the second image. This is called the “cutoff-frequency”. In the paper it is suggested to use two cutoff frequencies (one tuned for each image) and you are free to try that, as well. In the starter code, the cutoff frequency is controlled by changing the standard deviation of the Gausian filter used in constructing the hybrid images. We provided 7 pairs of aligned images. The alignment is important because it affects the perceptual grouping (read the paper for details). We encourage you to create additional examples (e.g. change of expression, morph between different objects, change over time, etc.). Write-upPlease provide three hybrid image results. For one of your favorite results, show
Briefly (a few sentences) explain how it works, using your favorite results as illustrations. HintIn Matlab, you can compute and display the 2D Fourier transform with with: imagesc(log(abs(fftshift(fft2(gray_image))))) Rubric
Part 2: Image pyramid (30 points)OverviewChoose an image that has interesting variety of textures (from Flickr or your own images). The images should be at least 640x480 pixels and converted to grayscale. Write code for a Gaussian and Laplacian pyramid of level N (use for loops). In each level, the resolution should be reduced by a factor of 2. Show the pyramids for your chosen image and include the code in your write-up. Write-up
Rubric
Hint
Part 3: Edge detection (40 points)OverviewThe main steps of edge detection are: (1) assign a score to each pixel; (2) find local maxima along the direction perpendicular to the edge. Sometimes a third step is performed where local evidence is propagated so that long contours are more confident or strong edges boost the confidence of nearby weak edges. Optionally, a thresholding step can then convert from soft boundaries to hard binary boundaries. We have provided 50 test images with ground truth from BSDS, along with some code for evaluation. Your job is to build a simple gradient-based edge detector, extend it using multiple oriented filters, and then describe other possible improvements.
function [mag, theta] = gradientMagnitude(im, sigma); This function should take an RGB image as input, smooth the image with Gaussian std=sigma, compute the x and y gradient values of the smoothed image, and output image maps of the gradient magnitude and orientation at each pixel. You can compute the gradient magnitude of an RGB image by taking the L2-norm of the R, G, and B gradients. The orientation can be computed from the channel corresponding to the largest gradient magnitude. The overall gradient magnitude is the L2-norm of the x and y gradients. mag and theta should be the same size as im. function bmap = edgeGradient(im); This function should use gradientMagnitude to compute a soft boundary map and then perform non-maxima suppression. For this assignment, it is acceptable to perform non-maxima suppression by retaining only the magnitudes along the binary edges produce by the Canny edge detector: edge(im, ‘canny’). Alternatively, you could use the provided nonmax.m (be careful about the way orientation is defined if you do). You may obtain better results by writing a non-maxima suppression algorithm that uses your own estimates of the magnitude and orientation. If desired, the boundary scores can be rescaled, e.g., by raising to an exponent: mag2 = mag.^0.7 , which is primarily useful for visualization. Evaluate using evaluateSegmentation.m and record the overall and average F-scores.
function [mag,theta] = orientedFilterMagnitude(im) Computes the boundary magnitude and orientation using a set of oriented filters, such as elongated Gaussian derivative filters. Explain your choice of filters. Use at least four orientations. One way to combine filter responses is to compute a boundary score for each filter (simply by filtering with it) and then use the max and argmax over filter responses to compute the magnitude and orientation for each pixel. function bmap = edgeOrientedFilters(im) Similar to part (a), this should call orientedFilterMagnitude, perform the non-maxima suppression, and output the final soft edge map. Evaluation: The provided evaluateSegmentation.m will evaluate your boundary detectors against the ground truth segmentations and summarize the performance. You will need to edit to put in your own directories and edge detection functions. Note that I modified the evaluation function from the original BSDS criteria, so the numbers are not comparable to the BSDS web page. The overall and average F-score for my implementation were (0.57, 0.62) for part (a) and (0.58, 0.63) for part (b). You might do better (or slightly worse). Write-upInclude your code with your electronic submission. In your write-up, include:
Rubric
HintReading these papers will help understanding and may help with the programming assignment. Graduate points (up to 5 points each, max possible 30 points graduate credit)In your answer sheet, describe the graduate points under a separate heading. Hybrid image
Image pyramid
Edge detection
AcknowledgementsThis homework is adapted from the projects developed by Derek Hoiem (UIUC) and James Hays (GaTech) |