Skip to content

Problems I solved for Microsoft ML summer camp in Petnica, Serbia

Notifications You must be signed in to change notification settings

gordicaleksa/MachineLearningMicrosoftPetnica

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Solutions for Microsoft ML summer camp

Qualification Round Problems

Here are my solutions for the problems given as a part of a qualification round for Petnica Summer Institute of Machine Learning (PSI:ML) 2018. Round lasted for 4 days from 3-7 March, 2018.

OpenCV library was used for developing solutions for the problems.

Problem 1 - Pixel

This was more of a warmup problem. The idea was to connect Visual Studio IDE with OpenCV library and to output RGB components of a pixel to standard output.

Problem 2 - Keypoints

The problem consisted of reading the root directory path and then iterating through that directory reading through some files, manipulating the data inside and printing the results to stdout.

The root directory contains only directories and in those directories we have exactly 1 file. File has arbitrarily many lines. Each line consists of 4 points. First 3 points define a new coordinate system. The goal was to transform 4th point to a new coordinate system defined by the first 3 points.

You can find the code here and the public data set here.
The code got maximum 200 points for the public data set as well as for the hidden one.

Problem 3 - Resistors

The problem was to recognize the colors of bands of a 4-band resistor, thus finding out it's resistance. You had to recognize at least 2 colors otherwise you would get 0 points. The more you get the better. My approach was the following:

color_codes

Original image:

step0

I first did some preprocessing using blur filters and some morphological operators, I converted the image to grayscale and did some more processing.

step1

After applying the Canny edge detector I found Hough lines and by averaging I found the main line.

step21

I used that line to allign the resistor horizontally.

step22

I then simply cropped the picture so that it's 100 pixels high.

step23

Later converting the picture to Lab system and used those information to crop the body of the resistor, first horizontally:

step3

and later vertically:

step4

I didn't get max points on this problem as I didn't have the time to extract the color information from the body of the resistor. As soon as I finish the project I'll upload the rest of the code.
You can find the code here and the datasets here.

Problem 4 - Wheel and Arrow

The problem was a rather involved one. The idea was to first get some statistics about the wheel and later use that information to find the biggest time span such that the arrow can fly through the wheel without touching it.

requests:

  1. find (x,y), central point of the wheel with tolerance +1/-1 pixel
  2. find the number of spokes, zero tolerance
  3. find the number of broken spokes, zero tolerance
  4. find the biggest arc in degrees, +1/-1 degree tolerance
  5. find k1,k2 frames such that if the arrows head was to enter at k1 it should fly through without touching the wheel until k2. k1 and k2 should be the biggest such interval.

First I converted the image to grayscale

step0

Then I found the center point using the tangent method

step2

After that I cropped the wheel

step3

And found the intersection matrix, which was used to calculate all of the wheel statistics such as number of spokes, number of broken spokes, largest arc length.

step4

I than removed the noise so that I can iterate through the data set and find the biggest time span such that the arrow can fly through without touching the edges.

step6

You can find the solution here and the public datasets here.
The code got maximum 400 points for the public data set as well as for the hidden one.

About

Problems I solved for Microsoft ML summer camp in Petnica, Serbia

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages