We are given training data in the form of 9-element vectors corresponding to 3x3 grayscale pixel patches, and the corresponding 'true' color of the center pixel. Using this training data, we are to develop an algorithm to color new grayscale images by taking gray pixel data and predicting the correct center color.
-To run- In the matlab console:
- Import the input.csv, color.csv and data.csv files into your workspace.
- Type [mat,inputSize] = train(input,color). You should get back a matrix 'mat' and integer variable 'inputSize'.
- Type newColor = test(data). You should get back a matrix 'newColor'.
- Type colorType = repColors(newColor). This will give you back a variable 'colorType' that contains each color prediction per pixel in data.
-To export colorType to csv:
- Type csvwrite('nameoffile.dat',colorType)
- Type 'type nameoffile.dat'
- Go to your Matlab working directory, nameoffile.dat should be there and can be opened as a text file or spreadsheet.