Computer Vision Assignment on Color Quantization using K-means and Circle Detection using Hough Transform
This Repository contains a code solutions along with a Report for a Computer Vision Assignment for two problems:
- Quantization of Color Space using K-means Clustering:
- Implementation of Hough Transform Circle Detector:
- Quantize a 3-dimensional RGB image and map pixels to its nearest k-means center
- Converting a 3-dimensional RGB image into a HSVand quantize the 1-dimensional hue space
- Compute the SSD error between RGB image pixels and quantized pixels for both RGB and HSV space
- Displaying the histograms of hue values with equally spaced bins and bins defined by K cluster centers
- Implementing a hough transform Circle Detector that takes an input image and fixed radius and returns centers of any detected circles.
- The output centers is a NX2 matrix in which each row lists (x,y) position of the detected circles' center
- Displaying the Hough Transform accumulator array
- Experimenting on how to determine the number of circlepresent by post-processing the accumulator array
- Describing the impact of the vote space quantization(bin size)/i>
- ColorQuantize.py - main code that calls the other helper functions
- computeQuantizationerror.py - SSD error between quantized and original pixels
- quantizeHSV.py - converts RGB image to HSV and quantize 1-D Hue space
- quantizeRGB.py - quantizes 3D RGB image with K-means
- detectCircles.py - code implementation for CircleDetection
- Image 1 - fish.png
- Image 2 - jupiter.png
Given Image:

RGB Quantized

HSV Quantized

Histograms


SSD Error

Problem - 2: CIRCLE DETECTION
Given Image:

Results
Detection Radius =10 and accumulator array

Detection Radius =30 and accumulator array

Detection Radius =100 and accumulator array

Repository Files:
Code Implementation: