Code Monkey home page Code Monkey logo

machinelearningmicrosoftpetnica's Introduction

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.

machinelearningmicrosoftpetnica's People

Contributors

gordicaleksa avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.