Computational Photography

Project 2: Bhoomi Kotharkar, Meera Dave, Emre Altman, Jack Hughes

Topic

Our project processes an input image to generate a new image with a kaleidoscope effect. This effect is achieved by overlapping triangles, whose number and arrangement are specified by the user. These triangles are symmetrically rotated around the center point, resulting in a visually captivating pattern. Low-Level Description: The process begins by identifying the center of the input image, regardless of its size. We employ Canny edge detection to pinpoint the area with the highest edge concentration. Using a sliding window technique, we locate the most edge-dense 11x11 region and move it to the image center. To address edge concentration in corners, we flip the image as needed to ensure this region is always in the upper-left quadrant, facilitating its translation to the center. For the kaleidoscope effect, we position one triangular point of the segment at the bottom-right corner and another at the center, the area with the highest edge concentration. A mask is then applied to the original image, extracting the triangular segments to create the kaleidoscope pattern.

Resources

  • getRotationMatrix and warpAffine - used for for rotating the segments around the center, works for any image and segment input size. https://docs.opencv.org/3.4/da/d54/group__imgproc__transform.html#gafbbc470ce83812914a70abfb604f4326
  • fillPolyConvex - used for forming the triangular segment https://pythongeeks.org/draw-polylines-fillpoly-fillconvexpoly-and-arrowedline-in-opencv

Image Outputs

Input Image

Input Image

Output Image

Output Image

Output Image 2

To start, we find the center of the input image so we can center around that. From there we use Canny edge detection to find the most concentrated region of edges in the input image.

Output Image 2

Using that, we implement a sliding window, similar to a kernel, to locate the most concentrated 11x11 region of edges before moving it to the center of the image. Highest concentration of edges denoted by red square.

Output Image 2

Image flipped to keep the focal point in the top left quadrant.

Output Image 2

Aligning the most concentrated region in the center and stretching it down to the bottom corner.

Output Image 2

To start the creation of the kaleidoscope effect, we first edit the image so that the one of the triangular points of the segment lines up with the bottom-right corner, while another is centered in the image. This center point is now the area determined to have the highest concentration of edges. We then use a mask on the original image to extract the triangular cuts out of it.

Output Image 2

Then, depending on the number of segments requested, the triangles are placed down on a new image rotating around the center.