1 year ago

#134419

test-img

bananaf

How to implement gaussian mixture models to classify each image pixel as one of the ROYGBIV colors?

Goal: implement gaussian mixture models (GMMs) to classify each image pixel as one of the ROYGBIV colors by replicating the steps described in this project: https://github.com/srane96/Underwater-Buoy-Detection-Using-Gaussian-Mixture-Models

I am new to GMMs. I found color buoy detection GMM projects on GitHub, but I am having trouble understanding the steps required to achieve my goal. I have referred to other stackoverflow posts about GMMs to try to understand. I've also referred to this paper https://github.com/ramaprv/underwater-buoy-detection/blob/master/Report.pdf. I am trying to go through the readme of https://github.com/srane96/Underwater-Buoy-Detection-Using-Gaussian-Mixture-Models step by step to understand and implement.

From my understanding, these are the steps:

STEP 1: PREPARE DATA

  1. Capture images of each of the ROYGBIV colors in a variety of lighting environments. Store images as numpy arrays to allow for easy manipulation. Sort them out into appropriate folders. Use np.random.shuffle() to shuffle images (to ensure algorithm does not learn the order?) Store a portion for training and a portion for testing.

  2. Compute the histogram for all the color channels. How do I create these histograms for each color channel? Use the histograms to infer the number of Gaussian curves to fit the given histogram and estimate the initial mean and variance by computing the same from the histogram data, which can be used as a start value for EM algorithm.

STEP 2: GENERATE MODEL

  1. Determine the number of Gaussians to fit for each channel.
  2. Generate GMM using the EM Algorithm.

STEP 3: COLOR DETECTION AND SEGMENTATION

  1. Create masks.
  2. Detect colors and draw contours around classifications.

I understand the high level steps, but am having trouble practically implementing these steps. I would appreciate guidance on particularly STEP 1 and STEP 2. How to gerenate historgrams for each color? Do I need to create 1 GMM for each ROYGBIV color, so 7 GMMs in total? How do I determine the number of gaussians to fit for each channel and generate a GMM using the EM algorithm?

python

tensorflow

image-segmentation

gaussian-mixture-model

0 Answers

Your Answer

Accepted video resources